BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ROOT::Minuit2::MPIProcess Class Reference

Description

Definition at line 46 of file MPIProcess.h.

Public Member Functions

 MPIProcess (unsigned int nelements, unsigned int indexComm)
 
 ~MPIProcess ()
 
unsigned int EndElementIndex () const
 
unsigned int GetMPIRank () const
 
unsigned int GetMPISize () const
 
unsigned int NumElements4Job (unsigned int rank) const
 
unsigned int NumElements4JobIn () const
 
unsigned int NumElements4JobOut () const
 
unsigned int StartElementIndex () const
 
void SumReduce (const double &sub, double &total)
 
bool SyncSymMatrixOffDiagonal (ROOT::Minuit2::MnAlgebraicSymMatrix &mnmatrix)
 
bool SyncVector (ROOT::Minuit2::MnAlgebraicVector &mnvector)
 

Static Public Member Functions

static unsigned int GetMPIGlobalRank ()
 
static unsigned int GetMPIGlobalSize ()
 
static bool SetCartDimension (unsigned int dimX, unsigned int dimY)
 
static bool SetDoFirstMPICall (bool doFirstMPICall=true)
 
static void StartMPI ()
 
static void TerminateMPI ()
 

Private Attributes

unsigned int fNelements
 
unsigned int fNumElements4JobIn
 
unsigned int fNumElements4JobOut
 
unsigned int fRank
 
unsigned int fSize
 

Static Private Attributes

static unsigned int fgCartDimension
 
static unsigned int fgCartSizeX
 
static unsigned int fgCartSizeY
 
static unsigned int fgGlobalRank
 
static unsigned int fgGlobalSize
 
static bool fgNewCart
 

Constructor & Destructor Documentation

◆ MPIProcess()

ROOT::Minuit2::MPIProcess::MPIProcess ( unsigned int  nelements,
unsigned int  indexComm 
)

◆ ~MPIProcess()

ROOT::Minuit2::MPIProcess::~MPIProcess ( )

Member Function Documentation

◆ EndElementIndex()

unsigned int ROOT::Minuit2::MPIProcess::EndElementIndex ( ) const
inline

Definition at line 61 of file MPIProcess.h.

unsigned int NumElements4Job(unsigned int rank) const
Definition: MPIProcess.h:54
unsigned int StartElementIndex() const
Definition: MPIProcess.h:57

References fRank, NumElements4Job(), and StartElementIndex().

Here is the call graph for this function:

◆ GetMPIGlobalRank()

static unsigned int ROOT::Minuit2::MPIProcess::GetMPIGlobalRank ( )
inlinestatic

Definition at line 70 of file MPIProcess.h.

70 { StartMPI(); return fgGlobalRank; }
static void StartMPI()
Definition: MPIProcess.h:72
static unsigned int fgGlobalRank
Definition: MPIProcess.h:122

References fgGlobalRank, and StartMPI().

Here is the call graph for this function:

◆ GetMPIGlobalSize()

static unsigned int ROOT::Minuit2::MPIProcess::GetMPIGlobalSize ( )
inlinestatic

Definition at line 71 of file MPIProcess.h.

71 { StartMPI(); return fgGlobalSize; }
static unsigned int fgGlobalSize
Definition: MPIProcess.h:121

References fgGlobalSize, and StartMPI().

Here is the call graph for this function:

◆ GetMPIRank()

unsigned int ROOT::Minuit2::MPIProcess::GetMPIRank ( ) const
inline

Definition at line 65 of file MPIProcess.h.

65 { return fRank; }

References fRank.

◆ GetMPISize()

unsigned int ROOT::Minuit2::MPIProcess::GetMPISize ( ) const
inline

Definition at line 64 of file MPIProcess.h.

64 { return fSize; }

References fSize.

◆ NumElements4Job()

unsigned int ROOT::Minuit2::MPIProcess::NumElements4Job ( unsigned int  rank) const
inline

Definition at line 54 of file MPIProcess.h.

55  { return NumElements4JobIn()+((rank<NumElements4JobOut()) ? 1 : 0); }
unsigned int NumElements4JobOut() const
Definition: MPIProcess.h:52
unsigned int NumElements4JobIn() const
Definition: MPIProcess.h:51

References NumElements4JobIn(), and NumElements4JobOut().

Referenced by EndElementIndex(), and StartElementIndex().

Here is the call graph for this function:

◆ NumElements4JobIn()

unsigned int ROOT::Minuit2::MPIProcess::NumElements4JobIn ( ) const
inline

Definition at line 51 of file MPIProcess.h.

51 { return fNumElements4JobIn; }
unsigned int fNumElements4JobIn
Definition: MPIProcess.h:129

References fNumElements4JobIn.

Referenced by NumElements4Job().

◆ NumElements4JobOut()

unsigned int ROOT::Minuit2::MPIProcess::NumElements4JobOut ( ) const
inline

Definition at line 52 of file MPIProcess.h.

52 { return fNumElements4JobOut; }
unsigned int fNumElements4JobOut
Definition: MPIProcess.h:130

References fNumElements4JobOut.

Referenced by NumElements4Job(), and StartElementIndex().

◆ SetCartDimension()

static bool ROOT::Minuit2::MPIProcess::SetCartDimension ( unsigned int  dimX,
unsigned int  dimY 
)
static

◆ SetDoFirstMPICall()

static bool ROOT::Minuit2::MPIProcess::SetDoFirstMPICall ( bool  doFirstMPICall = true)
static

◆ StartElementIndex()

unsigned int ROOT::Minuit2::MPIProcess::StartElementIndex ( ) const
inline

Definition at line 57 of file MPIProcess.h.

References fNelements, fRank, fSize, NumElements4Job(), and NumElements4JobOut().

Referenced by EndElementIndex().

Here is the call graph for this function:

◆ StartMPI()

static void ROOT::Minuit2::MPIProcess::StartMPI ( )
inlinestatic

Definition at line 72 of file MPIProcess.h.

72  {
73 #ifdef MPIPROC
74  if (!(MPI::Is_initialized())) {
75  MPI::Init();
76  std::cout << "Info --> MPIProcess::StartMPI: Start MPI on #"
77  << MPI::COMM_WORLD.Get_rank() << " processor"
78  << std::endl;
79  }
80  fgGlobalSize = MPI::COMM_WORLD.Get_size();
81  fgGlobalRank = MPI::COMM_WORLD.Get_rank();
82 #endif
83  }

References fgGlobalRank, and fgGlobalSize.

Referenced by GetMPIGlobalRank(), and GetMPIGlobalSize().

◆ SumReduce()

void ROOT::Minuit2::MPIProcess::SumReduce ( const double &  sub,
double &  total 
)
inline

Definition at line 100 of file MPIProcess.h.

100  {
101  total = sub;
102 
103 #ifdef MPIPROC
104  if (fSize>1) {
105  fgCommunicator->Allreduce(&sub,&total,1,MPI::DOUBLE,MPI::SUM);
106  }
107 #endif
108  }

References fSize.

◆ SyncSymMatrixOffDiagonal()

bool ROOT::Minuit2::MPIProcess::SyncSymMatrixOffDiagonal ( ROOT::Minuit2::MnAlgebraicSymMatrix mnmatrix)

◆ SyncVector()

bool ROOT::Minuit2::MPIProcess::SyncVector ( ROOT::Minuit2::MnAlgebraicVector mnvector)

◆ TerminateMPI()

static void ROOT::Minuit2::MPIProcess::TerminateMPI ( )
inlinestatic

Definition at line 85 of file MPIProcess.h.

85  {
86 #ifdef MPIPROC
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;
90  }
91 
92  MPITerminate();
93 
94 #endif
95  }

Member Data Documentation

◆ fgCartDimension

unsigned int ROOT::Minuit2::MPIProcess::fgCartDimension
staticprivate

Definition at line 126 of file MPIProcess.h.

◆ fgCartSizeX

unsigned int ROOT::Minuit2::MPIProcess::fgCartSizeX
staticprivate

Definition at line 124 of file MPIProcess.h.

◆ fgCartSizeY

unsigned int ROOT::Minuit2::MPIProcess::fgCartSizeY
staticprivate

Definition at line 125 of file MPIProcess.h.

◆ fgGlobalRank

unsigned int ROOT::Minuit2::MPIProcess::fgGlobalRank
staticprivate

Definition at line 122 of file MPIProcess.h.

Referenced by GetMPIGlobalRank(), and StartMPI().

◆ fgGlobalSize

unsigned int ROOT::Minuit2::MPIProcess::fgGlobalSize
staticprivate

Definition at line 121 of file MPIProcess.h.

Referenced by GetMPIGlobalSize(), and StartMPI().

◆ fgNewCart

bool ROOT::Minuit2::MPIProcess::fgNewCart
staticprivate

Definition at line 127 of file MPIProcess.h.

◆ fNelements

unsigned int ROOT::Minuit2::MPIProcess::fNelements
private

Definition at line 117 of file MPIProcess.h.

Referenced by StartElementIndex().

◆ fNumElements4JobIn

unsigned int ROOT::Minuit2::MPIProcess::fNumElements4JobIn
private

Definition at line 129 of file MPIProcess.h.

Referenced by NumElements4JobIn().

◆ fNumElements4JobOut

unsigned int ROOT::Minuit2::MPIProcess::fNumElements4JobOut
private

Definition at line 130 of file MPIProcess.h.

Referenced by NumElements4JobOut().

◆ fRank

unsigned int ROOT::Minuit2::MPIProcess::fRank
private

Definition at line 119 of file MPIProcess.h.

Referenced by EndElementIndex(), GetMPIRank(), and StartElementIndex().

◆ fSize

unsigned int ROOT::Minuit2::MPIProcess::fSize
private

Definition at line 118 of file MPIProcess.h.

Referenced by GetMPISize(), StartElementIndex(), and SumReduce().


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