Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions
G4MPIstatus Class Reference

#include <G4MPIstatus.hh>

Public Types

enum  { kNSIZE = 10 }
 

Public Member Functions

 G4MPIstatus ()
 
 ~G4MPIstatus ()
 
void SetStatus (G4int arank, G4int runid, G4int noe, G4int evtid, G4ApplicationState state)
 
G4int GetRank () const
 
G4int GetRunID () const
 
G4int GetNEventToBeProcessed () const
 
G4int GetEventID () const
 
G4double GetCPUTime () const
 
G4ApplicationState GetG4State () const
 
G4int SizeOf () const
 
void Pack (G4int *data) const
 
void UnPack (G4int *data)
 
void StartTimer ()
 
void StopTimer ()
 
void Print () const
 

Detailed Description

Definition at line 37 of file G4MPIstatus.hh.

Member Enumeration Documentation

anonymous enum
Enumerator
kNSIZE 

Definition at line 64 of file G4MPIstatus.hh.

64 { kNSIZE = 10 };

Constructor & Destructor Documentation

G4MPIstatus::G4MPIstatus ( )

Definition at line 32 of file G4MPIstatus.cc.

33  : rank_(0), run_id_(0), nevent_to_be_processed_(0), event_id_(0),
34  cputime_(0.), g4state_(G4State_Quit)
35 {
36  timer_ = new G4Timer;
37 }
G4MPIstatus::~G4MPIstatus ( )

Definition at line 40 of file G4MPIstatus.cc.

41 {
42  delete timer_;
43 }

Member Function Documentation

G4double G4MPIstatus::GetCPUTime ( ) const
inline

Definition at line 104 of file G4MPIstatus.hh.

105 {
106  return cputime_;
107 }
G4int G4MPIstatus::GetEventID ( ) const
inline

Definition at line 99 of file G4MPIstatus.hh.

100 {
101  return event_id_;
102 }
G4ApplicationState G4MPIstatus::GetG4State ( ) const
inline

Definition at line 109 of file G4MPIstatus.hh.

110 {
111  return g4state_;
112 }
G4int G4MPIstatus::GetNEventToBeProcessed ( ) const
inline

Definition at line 94 of file G4MPIstatus.hh.

95 {
96  return nevent_to_be_processed_;
97 }
G4int G4MPIstatus::GetRank ( ) const
inline

Definition at line 84 of file G4MPIstatus.hh.

85 {
86  return rank_;
87 }
G4int G4MPIstatus::GetRunID ( ) const
inline

Definition at line 89 of file G4MPIstatus.hh.

90 {
91  return run_id_;
92 }
void G4MPIstatus::Pack ( G4int data) const

Definition at line 71 of file G4MPIstatus.cc.

72 {
73  data[0] = rank_;
74  data[1] = run_id_;
75  data[2] = nevent_to_be_processed_;
76  data[3] = event_id_;
77  data[4] = g4state_;
78 
79  G4double* ddata = (G4double*)(data+5);
80  ddata[0] = cputime_;
81 }
double G4double
Definition: G4Types.hh:76
const XML_Char const XML_Char * data
void G4MPIstatus::Print ( void  ) const

Definition at line 97 of file G4MPIstatus.cc.

References G4cout, and G4endl.

98 {
99  // * rank= 001 run= 10002 event= 00001 / 100000 state= Idle"
100  G4cout << "* rank= " << rank_
101  << " run= " << run_id_
102  << " event= " << event_id_ << " / " << nevent_to_be_processed_
103  << " state= " << GetStateString(g4state_)
104  << " time= " << cputime_ << "s"
105  << G4endl;
106 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4MPIstatus::SetStatus ( G4int  arank,
G4int  runid,
G4int  noe,
G4int  evtid,
G4ApplicationState  state 
)

Definition at line 58 of file G4MPIstatus.cc.

60 {
61  rank_ = arank;
62  run_id_ = runid;
63  nevent_to_be_processed_ = noe;
64  event_id_ = evtid;
65  g4state_ = state;
66  if ( timer_-> IsValid() ) cputime_= timer_-> GetUserElapsed();
67  else cputime_ = 0.;
68 }
G4int G4MPIstatus::SizeOf ( ) const
inline

Definition at line 79 of file G4MPIstatus.hh.

References kNSIZE.

80 {
81  return kNSIZE;
82 }
void G4MPIstatus::StartTimer ( )

Definition at line 46 of file G4MPIstatus.cc.

47 {
48  timer_-> Start();
49 }
void G4MPIstatus::StopTimer ( )

Definition at line 52 of file G4MPIstatus.cc.

53 {
54  timer_-> Stop();
55 }
void G4MPIstatus::UnPack ( G4int data)

Definition at line 84 of file G4MPIstatus.cc.

85 {
86  rank_ = data[0];
87  run_id_ = data[1];
88  nevent_to_be_processed_ = data[2];
89  event_id_ = data[3];
90  g4state_ = (G4ApplicationState)data[4];
91 
92  G4double* ddata = (G4double*)(data+5);
93  cputime_ = ddata[0];
94 }
double G4double
Definition: G4Types.hh:76
const XML_Char const XML_Char * data
G4ApplicationState

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