Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
G4MPIstatus Class Reference

#include <Doxymodules_parallel.h>

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
 

Private Member Functions

G4String GetStateString (G4ApplicationState astate) const
 

Private Attributes

G4int rank_
 
G4int run_id_
 
G4int nevent_to_be_processed_
 
G4int event_id_
 
G4double cputime_
 
G4ApplicationState g4state_
 
G4Timertimer_
 

Detailed Description

Definition at line 69 of file Doxymodules_parallel.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kNSIZE 

Definition at line 64 of file G4MPIstatus.hh.

64{ kNSIZE = 10 };

Constructor & Destructor Documentation

◆ G4MPIstatus()

G4MPIstatus::G4MPIstatus ( )

Definition at line 32 of file G4MPIstatus.cc.

34 cputime_(0.), g4state_(G4State_Quit)
35{
36 timer_ = new G4Timer;
37}
G4Timer * timer_
G4double cputime_
G4ApplicationState g4state_
G4int nevent_to_be_processed_
G4int event_id_

◆ ~G4MPIstatus()

G4MPIstatus::~G4MPIstatus ( )

Definition at line 40 of file G4MPIstatus.cc.

41{
42 delete timer_;
43}

Member Function Documentation

◆ SetStatus()

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;
64 event_id_ = evtid;
65 g4state_ = state;
66 if ( timer_-> IsValid() ) cputime_= timer_-> GetRealElapsed();
67 else cputime_ = 0.;
68}

◆ GetRank()

G4int G4MPIstatus::GetRank ( ) const
inline

Definition at line 84 of file G4MPIstatus.hh.

85{
86 return rank_;
87}

◆ GetRunID()

G4int G4MPIstatus::GetRunID ( ) const
inline

Definition at line 89 of file G4MPIstatus.hh.

90{
91 return run_id_;
92}

◆ GetNEventToBeProcessed()

G4int G4MPIstatus::GetNEventToBeProcessed ( ) const
inline

Definition at line 94 of file G4MPIstatus.hh.

95{
97}

◆ GetEventID()

G4int G4MPIstatus::GetEventID ( ) const
inline

Definition at line 99 of file G4MPIstatus.hh.

100{
101 return event_id_;
102}

◆ GetCPUTime()

G4double G4MPIstatus::GetCPUTime ( ) const
inline

Definition at line 104 of file G4MPIstatus.hh.

105{
106 return cputime_;
107}

◆ GetG4State()

G4ApplicationState G4MPIstatus::GetG4State ( ) const
inline

Definition at line 109 of file G4MPIstatus.hh.

110{
111 return g4state_;
112}

◆ SizeOf()

G4int G4MPIstatus::SizeOf ( ) const
inline

Definition at line 79 of file G4MPIstatus.hh.

80{
81 return kNSIZE;
82}

◆ Pack()

void G4MPIstatus::Pack ( G4int *  data) const

Definition at line 71 of file G4MPIstatus.cc.

72{
73 data[0] = rank_;
74 data[1] = run_id_;
76 data[3] = event_id_;
77 data[4] = g4state_;
78
79 G4double* ddata = (G4double*)(data+5);
80 ddata[0] = cputime_;
81}

◆ UnPack()

void G4MPIstatus::UnPack ( G4int *  data)

Definition at line 84 of file G4MPIstatus.cc.

85{
86 rank_ = data[0];
87 run_id_ = data[1];
89 event_id_ = data[3];
90 g4state_ = (G4ApplicationState)data[4];
91
92 G4double* ddata = (G4double*)(data+5);
93 cputime_ = ddata[0];
94}

◆ StartTimer()

void G4MPIstatus::StartTimer ( )

Definition at line 46 of file G4MPIstatus.cc.

47{
48 timer_-> Start();
49}

◆ StopTimer()

void G4MPIstatus::StopTimer ( )

Definition at line 52 of file G4MPIstatus.cc.

53{
54 timer_-> Stop();
55}

◆ Print()

void G4MPIstatus::Print ( ) const

Definition at line 97 of file G4MPIstatus.cc.

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}
G4String GetStateString(G4ApplicationState astate) const

◆ GetStateString()

G4String G4MPIstatus::GetStateString ( G4ApplicationState  astate) const
private

Definition at line 109 of file G4MPIstatus.cc.

110{
111 G4String sname;
112
113 switch(astate) {
114 case G4State_PreInit:
115 sname = "PreInit";
116 break;
117 case G4State_Init:
118 sname = "Init";
119 break;
120 case G4State_Idle:
121 sname = "Idle";
122 break;
123 case G4State_GeomClosed:
124 sname = "GeomClosed";
125 break;
126 case G4State_EventProc:
127 sname = "EventProc";
128 break;
129 case G4State_Quit:
130 sname = "Quit";
131 break;
132 case G4State_Abort:
133 sname = "Abort";
134 break;
135 default:
136 sname = "Unknown";
137 break;
138 }
139
140 return sname;
141}

Member Data Documentation

◆ rank_

G4int G4MPIstatus::rank_
private

Definition at line 67 of file G4MPIstatus.hh.

◆ run_id_

G4int G4MPIstatus::run_id_
private

Definition at line 68 of file G4MPIstatus.hh.

◆ nevent_to_be_processed_

G4int G4MPIstatus::nevent_to_be_processed_
private

Definition at line 69 of file G4MPIstatus.hh.

◆ event_id_

G4int G4MPIstatus::event_id_
private

Definition at line 70 of file G4MPIstatus.hh.

◆ cputime_

G4double G4MPIstatus::cputime_
private

Definition at line 71 of file G4MPIstatus.hh.

◆ g4state_

G4ApplicationState G4MPIstatus::g4state_
private

Definition at line 72 of file G4MPIstatus.hh.

◆ timer_

G4Timer* G4MPIstatus::timer_
private

Definition at line 73 of file G4MPIstatus.hh.


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

Applications | User Support | Publications | Collaboration