#include "G4MPImanager.hh"
#include "G4MPIsession.hh"
#include "G4MPIextraWorker.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UserRunAction.hh"
#include "G4VisExecutive.hh"
#include "ActionInitialization.hh"
#include "DetectorConstruction.hh"
#include "RunActionMaster.hh"
#include "FTFP_BERT.hh"
#include "G4ScoringManager.hh"
#include "globals.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
| A MPI example code. More...
|
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
A MPI example code.
Definition at line 50 of file exMPI04.cc.
References Initialize(), and session.
55 bool useNtuple =
true;
56 bool mergeNtuple =
true;
62 G4int nofExtraWorkers = 0;
63 #ifndef G4MULTITHREADED 64 if ( mergeNtuple ) nofExtraWorkers = 1;
66 G4MPImanager* g4MPI =
new G4MPImanager(argc, argv, nofExtraWorkers);
71 G4MPIsession*
session = g4MPI-> GetMPIsession();
76 prompt +=
"[40;31m(%s)[40;36m[%/][00;30m:";
77 session-> SetPrompt(prompt);
82 #ifdef G4MULTITHREADED 83 G4MTRunManager* runManager =
new G4MTRunManager();
84 runManager-> SetNumberOfThreads(4);
86 G4RunManager* runManager =
new G4RunManager();
88 G4ScoringManager * scManager = G4ScoringManager::GetScoringManager();
89 scManager->SetVerboseLevel(1);
92 runManager-> SetUserInitialization(
new FTFP_BERT);
93 runManager-> SetUserInitialization(
94 new ActionInitialization(useNtuple, mergeNtuple));
99 if ( g4MPI->IsExtraWorker() ) {
100 G4cout <<
"Set extra worker" << G4endl;
101 G4UserRunAction* runAction
102 =
const_cast<G4UserRunAction*
>(runManager->GetUserRunAction());
103 g4MPI->SetExtraWorker(
new G4MPIextraWorker(runAction));
106 G4VisExecutive* visManager =
new G4VisExecutive;
115 session-> SessionStart();
static G4UIterminal * session