Import Geant4 11.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2025-06-26 09:17:29 +02:00
parent 20a218bbe1
commit a499fb82e9
1941 changed files with 203285 additions and 95593 deletions
@@ -34,6 +34,7 @@
#include <fstream>
#include <pthread.h>
#include <vector>
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
@@ -123,11 +124,13 @@ class G4MPImanager
// misc
void ShowHelp() const;
const MPI::Intracomm* GetComm() const { return &COMM_G4COMMAND_; }
const MPI_Comm* GetComm() const { return &COMM_G4COMMAND_; }
const MPI_Comm* GetProcessingComm() const { return &processing_comm_; }
const MPI_Comm* GetCollectingComm() const { return &collecting_comm_; }
const MPI_Comm* GetAllComm() const { return &all_comm_; }
std::vector<G4String> ReturnArguments() { return _options; }
private:
DISALLOW_COPY_AND_ASSIGN(G4MPImanager);
@@ -157,7 +160,7 @@ class G4MPImanager
G4int world_size_; // world comm size
// MPI communicator (when no extra ranks)
MPI::Intracomm COMM_G4COMMAND_;
MPI_Comm COMM_G4COMMAND_;
// MPI communicator (processing ranks - if ntuple merging)
MPI_Comm processing_comm_;
// MPI communicator (collecting ranks - if ntuple merging)
@@ -188,6 +191,8 @@ class G4MPImanager
// parallel parameters
G4double master_weight_;
G4int nof_extra_workers_;
std::vector<G4String> _options;
};
// ====================================================================
@@ -103,7 +103,7 @@ class G4MPIscorerMerger
G4ScoringManager* scoringManager;
unsigned int commSize;
unsigned int destinationRank;
MPI::Intracomm comm;
MPI_Comm comm;
G4int verbose;
};
@@ -72,7 +72,7 @@ commMap_t buildCommunicationMap(std::vector<rank_t>& input);
// Performs merging to rank 0 using the provided sender, receiver and barrier functions.
// CommSize is the size of the communicator and myrank is the rank of the caller
// For example: assume a class UserMerger has two members Send(uint) and
// Receive(uint) and we are using a MPI::Intracomm object as
// Receive(uint) and we are using a MPI_Comm object as
// communicator, then to use this function the ranks can:
// using std::placeholers::_1;
// std::function<void(unsigned int)> sender =
@@ -80,7 +80,7 @@ commMap_t buildCommunicationMap(std::vector<rank_t>& input);
// std::function<void(unsigned int)> receiver =
// std::bind(&Merger::Receiver,&mergerInst,_1);
// std::function<void(void)> barrier =
// std::bind(&MPI::Intracomm::Barrier,&commInst);
// [&commInst](){MPI_Barrier(commInst);};
// G4mpi::Merge(sender,receiver,barrier,commSize,myrank);
void Merge(std::function<void(unsigned int)> senderF, std::function<void(unsigned int)> receiverF,
std::function<void(void)> barrierF, unsigned int commSize, unsigned int myrank);
@@ -50,16 +50,16 @@ class G4VUserMPIrunMerger
virtual void Pack() = 0;
virtual G4Run* UnPack() = 0;
void InputUserData(/*const*/ void* input_data, const MPI::Datatype& dt, int count)
void InputUserData(/*const*/ void* input_data, const MPI_Datatype& dt, int count)
{
input_userdata.push_back(const_registered_data{input_data, dt, count});
}
void OutputUserData(void* input_data, const MPI::Datatype& dt, int count)
void OutputUserData(void* input_data, const MPI_Datatype& dt, int count)
{
output_userdata.push_back(registered_data{input_data, dt, count});
}
// void GetUserData(void* output_data,const MPI::Datatype& dt, int count);
// void GetUserData(void* output_data,const MPI_Datatype& dt, int count);
void SetupOutputBuffer(char* buff, G4int size, G4int position)
{
@@ -88,10 +88,10 @@ class G4VUserMPIrunMerger
G4int outputBufferSize;
G4int outputBufferPosition;
G4bool ownsBuffer;
unsigned int destinationRank;
G4int destinationRank;
G4Run* run;
unsigned int commSize;
MPI::Intracomm COMM_G4COMMAND_;
MPI_Comm COMM_G4COMMAND_;
G4int verbose;
long bytesSent;
@@ -103,7 +103,7 @@ class G4VUserMPIrunMerger
// const_registered_data(const_registered_data&&) = default;
// const_registered_data& operator=(const_registered_data&&) = default;
/*const*/ void* p_data;
/*const*/ MPI::Datatype dt;
/*const*/ MPI_Datatype dt;
/*const*/ int count;
};
std::vector<const_registered_data> input_userdata;
@@ -114,7 +114,7 @@ class G4VUserMPIrunMerger
registered_data(const registered_data&) = default;
registered_data& operator=(const registered_data&) = default;
void* p_data;
/*const*/ MPI::Datatype dt;
/*const*/ MPI_Datatype dt;
/*const*/ int count;
};
std::vector<registered_data> output_userdata;