11 #ifndef ROOT_Minuit2_MPIProcess 12 #define ROOT_Minuit2_MPIProcess 33 if (MPI::Is_initialized() && !(MPI::Is_finalized())) {
34 std::cout <<
"Info --> MPITerminate:: End MPI on #" 35 << MPI::COMM_WORLD.Get_rank() <<
" processor" 48 MPIProcess(
unsigned int nelements,
unsigned int indexComm);
55 {
return NumElements4JobIn()+((rank<NumElements4JobOut()) ? 1 : 0); }
58 {
return ((fRank<NumElements4JobOut()) ? (fRank*NumElements4Job(fRank)) :
59 (fNelements-(fSize-fRank)*NumElements4Job(fRank))); }
62 {
return StartElementIndex()+NumElements4Job(fRank); }
74 if (!(MPI::Is_initialized())) {
76 std::cout <<
"Info --> MPIProcess::StartMPI: Start MPI on #" 77 << MPI::COMM_WORLD.Get_rank() <<
" processor" 80 fgGlobalSize = MPI::COMM_WORLD.Get_size();
81 fgGlobalRank = MPI::COMM_WORLD.Get_rank();
87 if (fgCommunicators[0]!=0 && fgCommunicators[1]!=0) {
88 delete fgCommunicators[0]; fgCommunicators[0] = 0; fgIndecesComm[0] = 0;
89 delete fgCommunicators[1]; fgCommunicators[1] = 0; fgIndecesComm[1] = 0;
97 static bool SetCartDimension(
unsigned int dimX,
unsigned int dimY);
98 static bool SetDoFirstMPICall(
bool doFirstMPICall =
true);
105 fgCommunicator->Allreduce(&sub,&total,1,MPI::DOUBLE,MPI::SUM);
113 void MPISyncVector(
double *ivector,
int svector,
double *ovector);
133 static MPI::Intracomm *fgCommunicator;
134 static int fgIndexComm;
135 static MPI::Intracomm *fgCommunicators[2];
136 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