Geant4  10.01.p02
G4MPImanager Class Reference

#include <G4MPImanager.hh>

+ Collaboration diagram for G4MPImanager:

Public Types

enum  { kRANK_MASTER = 0 }
 
enum  { kTAG_G4COMMAND = 100, kTAG_G4STATUS = 200, kTAG_G4SEED = 300, kTAG_DATA = 1000 }
 

Public Member Functions

 G4MPImanager ()
 
 G4MPImanager (int argc, char **argv)
 
 ~G4MPImanager ()
 
G4MPIsessionGetMPIsession () const
 
G4int GetVerbose () const
 
void SetVerbose (G4int iverbose)
 
G4int GetSize () const
 
G4int GetRank () const
 
G4bool IsMaster () const
 
G4bool IsSlave () const
 
G4bool IsInitMacro () const
 
const G4StringGetInitFileName () const
 
G4bool IsBatchMode () const
 
const G4StringGetMacroFileName () const
 
void SetMasterWeight (G4double aweight)
 
G4double GetMasterWeight () const
 
G4VMPIseedGeneratorGetSeedGenerator () const
 
G4String BcastCommand (const G4String &command)
 
void ShowStatus ()
 
void ShowSeeds ()
 
void SetSeed (G4int inode, G4long seed)
 
void WaitBeamOn ()
 
void DistributeSeeds ()
 
void ExecuteMacroFile (const G4String &fname, G4bool qbatch=false)
 
G4bool CheckThreadStatus ()
 
void ExecuteThreadCommand (const G4String &command)
 
void ExecuteBeamOnThread (const G4String &command)
 
void JoinBeamOnThread ()
 
void BeamOn (G4int nevent, G4bool qdivide=true)
 
void Print (const G4String &message)
 
void ShowHelp () const
 

Static Public Member Functions

static G4MPImanagerGetManager ()
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (G4MPImanager)
 
void Initialize ()
 
void ParseArguments (G4int argc, char **argv)
 
void UpdateStatus ()
 

Private Attributes

G4MPImessengermessenger_
 
G4MPIsessionsession_
 
G4VMPIseedGeneratorseed_generator_
 
G4MPIstatusstatus_
 
G4int verbose_
 
G4bool is_master_
 
G4bool is_slave_
 
G4int rank_
 
G4int size_
 
MPI::Intracomm COMM_G4COMMAND_
 
G4bool qfcout_
 
std::ofstream fscout_
 
G4bool qinitmacro_
 
G4String init_file_name_
 
G4bool qbatchmode_
 
G4String macro_file_name_
 
pthread_t thread_id_
 
G4double master_weight_
 

Static Private Attributes

static G4MPImanagerg4mpi_ = NULL
 

Detailed Description

Definition at line 45 of file G4MPImanager.hh.

Member Enumeration Documentation

anonymous enum
Enumerator
kRANK_MASTER 

Definition at line 48 of file G4MPImanager.hh.

anonymous enum
Enumerator
kTAG_G4COMMAND 
kTAG_G4STATUS 
kTAG_G4SEED 
kTAG_DATA 

Definition at line 50 of file G4MPImanager.hh.

Constructor & Destructor Documentation

G4MPImanager::G4MPImanager ( )

Definition at line 68 of file G4MPImanager.cc.

References Initialize().

+ Here is the call graph for this function:

G4MPImanager::G4MPImanager ( int  argc,
char **  argv 
)

Definition at line 78 of file G4MPImanager.cc.

References Initialize(), and ParseArguments().

+ Here is the call graph for this function:

G4MPImanager::~G4MPImanager ( )

Definition at line 89 of file G4MPImanager.cc.

References COMM_G4COMMAND_, Finalize(), fscout_, is_slave_, messenger_, qfcout_, session_, and status_.

+ Here is the call graph for this function:

Member Function Documentation

G4String G4MPImanager::BcastCommand ( const G4String command)

Definition at line 416 of file G4MPImanager.cc.

References COMM_G4COMMAND_, is_master_, kRANK_MASTER, kTAG_G4COMMAND, and size_.

void G4MPImanager::BeamOn ( G4int  nevent,
G4bool  qdivide = true 
)

Definition at line 460 of file G4MPImanager.cc.

References G4UIcommand::ConvertToString(), G4cout, G4endl, G4RunManager::GetRunManager(), G4UImanager::GetUIpointer(), is_master_, master_weight_, size_, status_, and verbose_.

+ Here is the call graph for this function:

G4bool G4MPImanager::CheckThreadStatus ( )

Definition at line 325 of file G4MPImanager.cc.

References COMM_G4COMMAND_, is_master_, kRANK_MASTER, kTAG_G4STATUS, size_, and thread_id_.

Referenced by ExecuteBeamOnThread(), and ShowStatus().

+ Here is the caller graph for this function:

G4MPImanager::DISALLOW_COPY_AND_ASSIGN ( G4MPImanager  )
private
void G4MPImanager::DistributeSeeds ( )

Definition at line 287 of file G4MPImanager.cc.

References rank_, and seed_generator_.

Referenced by Initialize().

+ Here is the caller graph for this function:

void G4MPImanager::ExecuteBeamOnThread ( const G4String command)

Definition at line 385 of file G4MPImanager.cc.

References CheckThreadStatus(), FatalException, G4cout, G4endl, G4Exception(), is_master_, and thread_id_.

+ Here is the call graph for this function:

void G4MPImanager::ExecuteMacroFile ( const G4String fname,
G4bool  qbatch = false 
)

Definition at line 449 of file G4MPImanager.cc.

References qbatchmode_.

void G4MPImanager::ExecuteThreadCommand ( const G4String command)

Definition at line 356 of file G4MPImanager.cc.

References fCommandSucceeded, fIllegalApplicationState, G4cerr, G4endl, G4UImanager::GetUIpointer(), and thread_id_.

+ Here is the call graph for this function:

const G4String & G4MPImanager::GetInitFileName ( ) const
inline

Definition at line 199 of file G4MPImanager.hh.

References init_file_name_.

Referenced by G4MPIsession::SessionStart().

+ Here is the caller graph for this function:

const G4String & G4MPImanager::GetMacroFileName ( ) const
inline

Definition at line 210 of file G4MPImanager.hh.

References macro_file_name_.

Referenced by G4MPIsession::SessionStart().

+ Here is the caller graph for this function:

G4MPImanager * G4MPImanager::GetManager ( )
static

Definition at line 103 of file G4MPImanager.cc.

References FatalException, G4Exception(), and g4mpi_.

Referenced by G4MPIrandomSeedGenerator::CheckDoubleCount(), G4VMPIsession::G4VMPIsession(), and G4MPIrandomSeedGenerator::GenerateSeeds().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4double G4MPImanager::GetMasterWeight ( ) const
inline

Definition at line 223 of file G4MPImanager.hh.

References master_weight_.

Referenced by G4MPImessenger::GetCurrentValue().

+ Here is the caller graph for this function:

G4MPIsession * G4MPImanager::GetMPIsession ( ) const
inline

Definition at line 153 of file G4MPImanager.hh.

References session_.

G4int G4MPImanager::GetRank ( ) const
inline

Definition at line 173 of file G4MPImanager.hh.

References rank_.

G4VMPIseedGenerator * G4MPImanager::GetSeedGenerator ( ) const
inline

Definition at line 228 of file G4MPImanager.hh.

References seed_generator_.

G4int G4MPImanager::GetSize ( ) const
inline

Definition at line 178 of file G4MPImanager.hh.

References size_.

G4int G4MPImanager::GetVerbose ( ) const
inline

Definition at line 158 of file G4MPImanager.hh.

References verbose_.

Referenced by G4MPImessenger::GetCurrentValue().

+ Here is the caller graph for this function:

void G4MPImanager::Initialize ( )
private

Definition at line 113 of file G4MPImanager.cc.

References COMM_G4COMMAND_, DistributeSeeds(), FatalException, G4Exception(), g4mpi_, is_master_, is_slave_, kRANK_MASTER, messenger_, rank_, seed_generator_, session_, size_, and status_.

Referenced by G4MPImanager().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4bool G4MPImanager::IsBatchMode ( ) const
inline

Definition at line 205 of file G4MPImanager.hh.

References qbatchmode_.

G4bool G4MPImanager::IsInitMacro ( ) const
inline

Definition at line 193 of file G4MPImanager.hh.

References qinitmacro_.

G4bool G4MPImanager::IsMaster ( ) const
inline

Definition at line 183 of file G4MPImanager.hh.

References is_master_.

G4bool G4MPImanager::IsSlave ( ) const
inline

Definition at line 188 of file G4MPImanager.hh.

References is_slave_.

void G4MPImanager::JoinBeamOnThread ( )

Definition at line 407 of file G4MPImanager.cc.

References thread_id_.

void G4MPImanager::ParseArguments ( G4int  argc,
char **  argv 
)
private

Definition at line 143 of file G4MPImanager.cc.

References Finalize(), fscout_, G4cerr, G4endl, init_file_name_, is_master_, is_slave_, macro_file_name_, qbatchmode_, qfcout_, qinitmacro_, rank_, ShowHelp(), and verbose_.

Referenced by G4MPImanager().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4MPImanager::Print ( const G4String message)

Definition at line 532 of file G4MPImanager.cc.

References fscout_, is_master_, qfcout_, and rank_.

Referenced by ShowStatus().

+ Here is the caller graph for this function:

void G4MPImanager::SetMasterWeight ( G4double  aweight)
inline

Definition at line 215 of file G4MPImanager.hh.

References master_weight_.

void G4MPImanager::SetSeed ( G4int  inode,
G4long  seed 
)

Definition at line 317 of file G4MPImanager.cc.

References rank_.

void G4MPImanager::SetVerbose ( G4int  iverbose)
inline

Definition at line 163 of file G4MPImanager.hh.

References verbose_.

void G4MPImanager::ShowHelp ( ) const

Definition at line 546 of file G4MPImanager.cc.

References G4cout, G4endl, and is_slave_.

Referenced by ParseArguments().

+ Here is the caller graph for this function:

void G4MPImanager::ShowSeeds ( )

Definition at line 294 of file G4MPImanager.cc.

References COMM_G4COMMAND_, G4cout, G4endl, is_master_, kRANK_MASTER, kTAG_G4SEED, rank_, and size_.

void G4MPImanager::ShowStatus ( )

Definition at line 238 of file G4MPImanager.cc.

References CheckThreadStatus(), COMM_G4COMMAND_, G4cout, G4endl, G4FFGEnumerations::INT, is_master_, G4MPIstatus::kNSIZE, kRANK_MASTER, kTAG_G4STATUS, Print(), size_, status_, and UpdateStatus().

+ Here is the call graph for this function:

void G4MPImanager::UpdateStatus ( )
private

Definition at line 211 of file G4MPImanager.cc.

References G4State_EventProc, G4State_GeomClosed, G4RunManager::GetRunManager(), G4StateManager::GetStateManager(), rank_, and status_.

Referenced by ShowStatus().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4MPImanager::WaitBeamOn ( )

Member Data Documentation

MPI::Intracomm G4MPImanager::COMM_G4COMMAND_
private
std::ofstream G4MPImanager::fscout_
private

Definition at line 137 of file G4MPImanager.hh.

Referenced by ParseArguments(), Print(), and ~G4MPImanager().

G4MPImanager * G4MPImanager::g4mpi_ = NULL
staticprivate

Definition at line 115 of file G4MPImanager.hh.

Referenced by GetManager(), and Initialize().

G4String G4MPImanager::init_file_name_
private

Definition at line 141 of file G4MPImanager.hh.

Referenced by GetInitFileName(), and ParseArguments().

G4bool G4MPImanager::is_slave_
private

Definition at line 128 of file G4MPImanager.hh.

Referenced by Initialize(), IsSlave(), ParseArguments(), ShowHelp(), and ~G4MPImanager().

G4String G4MPImanager::macro_file_name_
private

Definition at line 143 of file G4MPImanager.hh.

Referenced by GetMacroFileName(), and ParseArguments().

G4double G4MPImanager::master_weight_
private

Definition at line 149 of file G4MPImanager.hh.

Referenced by BeamOn(), GetMasterWeight(), and SetMasterWeight().

G4MPImessenger* G4MPImanager::messenger_
private

Definition at line 116 of file G4MPImanager.hh.

Referenced by Initialize(), and ~G4MPImanager().

G4bool G4MPImanager::qbatchmode_
private

Definition at line 142 of file G4MPImanager.hh.

Referenced by ExecuteMacroFile(), IsBatchMode(), ParseArguments(), and WaitBeamOn().

G4bool G4MPImanager::qfcout_
private

Definition at line 136 of file G4MPImanager.hh.

Referenced by ParseArguments(), Print(), and ~G4MPImanager().

G4bool G4MPImanager::qinitmacro_
private

Definition at line 140 of file G4MPImanager.hh.

Referenced by IsInitMacro(), and ParseArguments().

G4int G4MPImanager::rank_
private
G4VMPIseedGenerator* G4MPImanager::seed_generator_
private

Definition at line 120 of file G4MPImanager.hh.

Referenced by DistributeSeeds(), GetSeedGenerator(), and Initialize().

G4MPIsession* G4MPImanager::session_
private

Definition at line 117 of file G4MPImanager.hh.

Referenced by GetMPIsession(), Initialize(), and ~G4MPImanager().

G4int G4MPImanager::size_
private
G4MPIstatus* G4MPImanager::status_
private

Definition at line 122 of file G4MPImanager.hh.

Referenced by BeamOn(), Initialize(), ShowStatus(), UpdateStatus(), and ~G4MPImanager().

pthread_t G4MPImanager::thread_id_
private
G4int G4MPImanager::verbose_
private

Definition at line 124 of file G4MPImanager.hh.

Referenced by BeamOn(), GetVerbose(), ParseArguments(), and SetVerbose().


The documentation for this class was generated from the following files: