MPI bugfix for dump netcdf from Paul Coffman

This commit is contained in:
Axel Kohlmeyer
2025-01-08 21:18:03 -05:00
parent 24763bfd8e
commit 41e7cf7879
2 changed files with 5 additions and 5 deletions

View File

@ -639,8 +639,8 @@ void DumpNetCDFMPIIO::write()
nme = count();
int *block_sizes = new int[comm->nprocs];
MPI_Allgather(&nme, 1, MPI_INT, block_sizes, 1, MPI_INT, world);
blocki = 0;
for (int i = 0; i < comm->me; i++) blocki += block_sizes[i];
blocki = (MPI_Offset) 0;
for (int i = 0; i < comm->me; i++) blocki += (MPI_Offset) (block_sizes[i]);
delete[] block_sizes;
// ensure buf is sized for packing and communicating

View File

@ -49,11 +49,11 @@ class DumpNetCDFMPIIO : public DumpCustom {
int quantity; // type of the quantity
};
int framei; // current frame index
int blocki; // current block index
MPI_Offset framei; // current frame index
MPI_Offset blocki; // current block index
int ndata; // number of data blocks to expect
bigint ntotalgr; // # of atoms
MPI_Offset ntotalgr; // # of atoms
int n_perat; // # of netcdf per-atom properties
nc_perat_t *perat; // per-atom properties