26 #ifndef G4MPIRUNMERGER_HH
27 #define G4MPIRUNMERGER_HH
46 virtual void Pack() = 0;
49 void InputUserData(
void* input_data ,
const MPI::Datatype& dt,
int count) {
50 input_userdata.push_back( const_registered_data{input_data,dt,count} );
53 output_userdata.push_back( registered_data{input_data,dt,count} );
60 outputBufferSize=size;
64 delete[] outputBuffer;
65 outputBuffer =
nullptr;
67 outputBufferPosition=0;
75 void Send(
const unsigned int destination);
76 void Receive(
const unsigned int source);
79 G4int outputBufferSize;
80 G4int outputBufferPosition;
82 unsigned int destinationRank;
84 unsigned int commSize;
85 MPI::Intracomm COMM_G4COMMAND_;
90 struct const_registered_data {
91 const_registered_data(
const const_registered_data&) =
default;
92 const_registered_data& operator=(
const const_registered_data&) =
default;
99 std::vector<const_registered_data> input_userdata;
102 struct registered_data {
103 registered_data(
const registered_data&) =
default;
104 registered_data& operator=(
const registered_data&) =
default;
109 std::vector<registered_data> output_userdata;
114 #endif //G4MPIRUNMERGER_HH
void SetDestinationRank(G4int i)
G4int GetBufferSize() const
virtual G4Run * UnPack()=0
void Send(const unsigned int destination)
void SetVerbosity(G4int ver)
void Receive(const unsigned int source)
void OutputUserData(void *input_data, const MPI::Datatype &dt, int count)
virtual ~G4VUserMPIrunMerger()
void SetupOutputBuffer(char *buff, G4int size, G4int position)
void InputUserData(void *input_data, const MPI::Datatype &dt, int count)
G4int GetPosition() const