48 #ifdef G4MULTITHREADED 49 #include "G4MTRunManager.hh" 50 #include "G4Threading.hh" 53 #include "G4RunManager.hh" 57 #include "Randomize.hh" 60 #include "TSDetectorConstruction.hh" 61 #include "TSPhysicsList.hh" 62 #include "TSActionInitialization.hh" 64 #include "G4UImanager.hh" 65 #include "G4VisExecutive.hh" 66 #include "G4UIExecutive.hh" 67 #include "G4TiMemory.hh" 76 #ifdef G4MULTITHREADED 77 runmanager->SetNumberOfThreads(G4Threading::G4GetNumberOfCores());
78 G4cout <<
"\n\n\t--> Running in multithreaded mode with " 79 << runmanager->GetNumberOfThreads()
80 <<
" threads\n\n" << G4endl;
83 runmanager->SetVerboseLevel(runmanager->GetVerboseLevel());
84 G4cout <<
"\n\n\t--> Running in serial mode\n\n" << G4endl;
90 int main(
int argc,
char** argv)
92 TIMEMORY_INIT(argc, argv);
94 #if defined(GEANT4_USE_TIMEMORY) 96 tim::settings::json_output() =
true;
97 tim::settings::dart_output() =
true;
98 tim::settings::dart_type() =
"peak_rss";
99 tim::settings::dart_count() = 1;
104 G4UIExecutive* ui = 0;
106 ui =
new G4UIExecutive(argc, argv);
109 CLHEP::HepRandom::setTheSeed(1245214UL);
115 runmanager->SetUserInitialization(
new TSDetectorConstruction);
117 runmanager->SetUserInitialization(
new TSPhysicsList);
119 runmanager->SetUserInitialization(
new TSActionInitialization);
121 runmanager->Initialize();
126 G4VisManager* visManager =
new G4VisExecutive;
129 visManager->Initialize();
132 G4UImanager* UImanager = G4UImanager::GetUIpointer();
139 G4String command =
"/control/execute ";
141 UImanager->ApplyCommand(command+fileName);
145 UImanager->ApplyCommand(
"/control/execute vis.mac");
int main(int argc, char **argv)
void message(RunManager *runmanager)