Geant4  10.01.p03
G4MPIRunMerger.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 #ifndef G4MPIRUNMERGER_HH
27 #define G4MPIRUNMERGER_HH
28 #include "G4Run.hh"
29 #include <mpi.h>
30 #include "G4MPImanager.hh"
31 
33 public:
34  G4MPIRunMerger( const G4Run* aRun ,
35  G4int destination = G4MPImanager::kRANK_MASTER ,
36  G4int verbosity = 0);
37  virtual ~G4MPIRunMerger() {}
38  void SetRun( G4Run* r ) { run = r; }
39  const G4Run* GetRun() const { return run; }
42  G4int GetCommSize() const { return commSize; }
43  virtual void Merge();
44  void SetVerbosity( G4int ver ) { verbose = ver; }
45  G4int GetVerbosity() const { return verbose; }
46 protected:
47  virtual void Send();
48  virtual void Receive(G4int rank);
49 
50  void SendDouble( G4double* val , G4int size=1);
51  void SendInt( G4int* val , G4int size=1);
52  void ReceiveDouble( G4int rank , G4double* val , G4int size=1);
53  void ReceiveInt(G4int rank , G4int* val, G4int size=1);
57  MPI::Intracomm COMM_G4COMMAND_;
59 
60 };
61 
62 #endif //G4MPIRUNMERGER_HH
63 
void SetVerbosity(G4int ver)
int G4int
Definition: G4Types.hh:78
virtual void Merge()
void SetRun(G4Run *r)
void SendInt(G4int *val, G4int size=1)
virtual ~G4MPIRunMerger()
MPI manager class.
G4int GetCommSize() const
G4int GetVerbosity() const
Definition: G4Run.hh:46
void SendDouble(G4double *val, G4int size=1)
virtual void Receive(G4int rank)
void ReceiveInt(G4int rank, G4int *val, G4int size=1)
virtual void Send()
G4MPIRunMerger(const G4Run *aRun, G4int destination=G4MPImanager::kRANK_MASTER, G4int verbosity=0)
G4int GetDestinationRank() const
const G4Run * GetRun() const
MPI::Intracomm COMM_G4COMMAND_
double G4double
Definition: G4Types.hh:76
void ReceiveDouble(G4int rank, G4double *val, G4int size=1)
void SetDestinationRank(G4int i)