11 #ifndef ROOT_Minuit2_MPIProcess 12 #define ROOT_Minuit2_MPIProcess 32 if (MPI::Is_initialized() && !(MPI::Is_finalized())) {
33 std::cout <<
"Info --> MPITerminate:: End MPI on #" 34 << MPI::COMM_WORLD.Get_rank() <<
" processor" 47 MPIProcess(
unsigned int nelements,
unsigned int indexComm);
54 {
return NumElements4JobIn()+((rank<NumElements4JobOut()) ? 1 : 0); }
57 {
return ((fRank<NumElements4JobOut()) ? (fRank*NumElements4Job(fRank)) :
58 (fNelements-(fSize-fRank)*NumElements4Job(fRank))); }
61 {
return StartElementIndex()+NumElements4Job(fRank); }
73 if (!(MPI::Is_initialized())) {
75 std::cout <<
"Info --> MPIProcess::StartMPI: Start MPI on #" 76 << MPI::COMM_WORLD.Get_rank() <<
" processor" 79 fgGlobalSize = MPI::COMM_WORLD.Get_size();
80 fgGlobalRank = MPI::COMM_WORLD.Get_rank();
86 if (fgCommunicators[0]!=0 && fgCommunicators[1]!=0) {
87 delete fgCommunicators[0]; fgCommunicators[0] = 0; fgIndecesComm[0] = 0;
88 delete fgCommunicators[1]; fgCommunicators[1] = 0; fgIndecesComm[1] = 0;
96 static bool SetCartDimension(
unsigned int dimX,
unsigned int dimY);
97 static bool SetDoFirstMPICall(
bool doFirstMPICall =
true);
104 fgCommunicator->Allreduce(&sub,&total,1,MPI::DOUBLE,MPI::SUM);
112 void MPISyncVector(
double *ivector,
int svector,
double *ovector);
132 static MPI::Intracomm *fgCommunicator;
133 static int fgIndexComm;
134 static MPI::Intracomm *fgCommunicators[2];
135 static unsigned int fgIndecesComm[2];
unsigned int fNumElements4JobOut
Namespace for new ROOT classes and functions.
static unsigned int fgGlobalSize
void SumReduce(const double &sub, double &total)
Class describing a symmetric matrix of size n.
static unsigned int GetMPIGlobalSize()
static void TerminateMPI()
static unsigned int fgCartDimension
unsigned int fNumElements4JobIn
unsigned int EndElementIndex() const
unsigned int NumElements4JobOut() const
static unsigned int GetMPIGlobalRank()
void Init(TClassEdit::TInterpreterLookupHelper *helper)
unsigned int StartElementIndex() const
static unsigned int fgCartSizeX
unsigned int GetMPISize() const
static unsigned int fgGlobalRank
unsigned int NumElements4Job(unsigned int rank) const
static unsigned int fgCartSizeY
unsigned int GetMPIRank() const
static unsigned int total
unsigned int NumElements4JobIn() const