Commit ac0a956b authored by John Biddiscombe's avatar John Biddiscombe
Browse files

BUG: If we have compiled with Parallel IO and MPI, but are actually runnin a...

BUG: If we have compiled with Parallel IO and MPI, but are actually runnin a serial only process, the Parallel file access needs to be disabled.
Add a check in the XdmfHDF constructor to set UseSerialFile if either MPI is not initialized, or nprocs<=1
parent 63b6854f
......@@ -49,6 +49,21 @@ XdmfHDF::XdmfHDF() {
this->NumberOfChildren = 0;
this->Compression = 0;
this->UseSerialFile = 0;
// We may have been compiled with Parallel IO support, but be run only on a single
// machine without mpiexec. Disable parallel if just one process.
#if H5_HAVE_PARALLEL && ((H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=6)))
int valid, nprocs=0;
MPI_Initialized(&valid);
if (valid)
{
MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
}
if (nprocs<=1)
{
this->UseSerialFile = 1;
}
#endif
#ifndef XDMF_NO_MPI
this->DsmBuffer = 0;
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment