must not use MPI_COMM_WORLD to be compatible with multi-partition runs

This commit is contained in:
Axel Kohlmeyer
2020-12-14 15:53:21 -05:00
parent 17f8aed268
commit ac36fb8290

View File

@ -292,7 +292,7 @@ void DumpNetCDFMPIIO::openfile()
if (singlefile_opened) return; if (singlefile_opened) return;
singlefile_opened = 1; singlefile_opened = 1;
NCERRX( ncmpi_open(MPI_COMM_WORLD, filecurrent, NC_WRITE, MPI_INFO_NULL, NCERRX( ncmpi_open(world, filecurrent, NC_WRITE, MPI_INFO_NULL,
&ncid), filecurrent ); &ncid), filecurrent );
// dimensions // dimensions
@ -372,7 +372,7 @@ void DumpNetCDFMPIIO::openfile()
if (singlefile_opened) return; if (singlefile_opened) return;
singlefile_opened = 1; singlefile_opened = 1;
NCERRX( ncmpi_create(MPI_COMM_WORLD, filecurrent, NC_64BIT_DATA, NCERRX( ncmpi_create(world, filecurrent, NC_64BIT_DATA,
MPI_INFO_NULL, &ncid), filecurrent ); MPI_INFO_NULL, &ncid), filecurrent );
// dimensions // dimensions
@ -748,7 +748,7 @@ void DumpNetCDFMPIIO::write()
nme = count(); nme = count();
int *block_sizes = new int[comm->nprocs]; int *block_sizes = new int[comm->nprocs];
MPI_Allgather(&nme, 1, MPI_INT, block_sizes, 1, MPI_INT, MPI_COMM_WORLD); MPI_Allgather(&nme, 1, MPI_INT, block_sizes, 1, MPI_INT, world);
blocki = 0; blocki = 0;
for (int i = 0; i < comm->me; i++) blocki += block_sizes[i]; for (int i = 0; i < comm->me; i++) blocki += block_sizes[i];
delete [] block_sizes; delete [] block_sizes;