13 #if !defined(INC_netCDF_NcMPI)
14 #define INC_netCDF_NcMPI
17 #error For parallel netCDF, define USE_PARALLEL during library compilation.
45 if ( pComm != 0 && !MPI::Is_initialized() )
50 : pComm (rhs.pComm), pInfo (rhs.pInfo)
54 MPI::Comm &
Comm () {
return *pComm; }
55 MPI::Info &
Info () {
return *pInfo; }
59 return pComm != 0 ? MPI::Is_initialized() :
false;
64 #if defined(MPICH_VERSION)
65 return std::string(
"MPICH ") + std::string(MPICH_VERSION);
66 #elif defined(OMPI_MAJOR_VERSION)
70 << OMPI_MAJOR_VERSION << dot << OMPI_MINOR_VERSION << dot << OMPI_RELEASE_VERSION;
74 int version = 0, subversion = 0;
75 MPI::Get_version( version, subversion );
76 os << version <<
'.' << subversion;
83 MPI::Comm *
const pComm;
84 MPI::Info *
const pInfo;
94 #endif // USE_PARALLEL
96 #endif // INC_netCDF_NcMPI
MPI::Info & Info()
Definition: NcMPI.h:55
NcMPI(MPI::Comm &mpiComm, MPI::Info &mpiInfo)
Definition: NcMPI.h:39
NcMPI(NcMPI const &rhs)
Definition: NcMPI.h:49
NcMPI()
Definition: NcMPI.h:33
Manages data related to the MPI implementation.
Definition: NcMPI.h:29
#define NcEXCEPTION(a_)
Definition: NcException.h:67
static std::string GetVersion()
Definition: NcMPI.h:62
MPI::Comm & Comm()
Definition: NcMPI.h:54
bool IsInitialized() const
Definition: NcMPI.h:57