diff --git a/src/parallel_io.c b/src/parallel_io.c index 154ec442c6435188874b0087a65150f84f6d7f03..f073104e890f4ad33be92c0c9ceef3721c9f18aa 100644 --- a/src/parallel_io.c +++ b/src/parallel_io.c @@ -342,6 +342,8 @@ void readArray(hid_t grp, struct io_props props, size_t N, long long N_total, props.parts += max_chunk_size; /* part* on the part */ props.xparts += max_chunk_size; /* xpart* on the xpart */ props.gparts += max_chunk_size; /* gpart* on the gpart */ + props.sparts += max_chunk_size; /* spart* on the spart */ + props.bparts += max_chunk_size; /* bpart* on the bpart */ offset += max_chunk_size; redo = 1; } else { @@ -646,6 +648,8 @@ void writeArray(struct engine* e, hid_t grp, char* fileName, props.parts += max_chunk_size; /* part* on the part */ props.xparts += max_chunk_size; /* xpart* on the xpart */ props.gparts += max_chunk_size; /* gpart* on the gpart */ + props.sparts += max_chunk_size; /* spart* on the spart */ + props.bparts += max_chunk_size; /* bpart* on the bpart */ offset += max_chunk_size; redo = 1; } else { @@ -1419,13 +1423,13 @@ void write_output_parallel(struct engine* e, const char* baseName, Nstars_written, Nblackholes_written}; long long N_total[swift_type_count] = {0}; long long offset[swift_type_count] = {0}; - MPI_Exscan(&N, &offset, swift_type_count, MPI_LONG_LONG_INT, MPI_SUM, comm); + MPI_Exscan(N, offset, swift_type_count, MPI_LONG_LONG_INT, MPI_SUM, comm); for (int ptype = 0; ptype < swift_type_count; ++ptype) N_total[ptype] = offset[ptype] + N[ptype]; /* The last rank now has the correct N_total. Let's * broadcast from there */ - MPI_Bcast(&N_total, 6, MPI_LONG_LONG_INT, mpi_size - 1, comm); + MPI_Bcast(N_total, 6, MPI_LONG_LONG_INT, mpi_size - 1, comm); /* Now everybody konws its offset and the total number of * particles of each type */ diff --git a/src/serial_io.c b/src/serial_io.c index 9efa2e81aa42d8b71198d7e8a8c8991003f8a2cb..dc033b95c46f7ca4a519254a45ad4f9f6b907367 100644 --- a/src/serial_io.c +++ b/src/serial_io.c @@ -648,7 +648,7 @@ void read_ic_serial(char* fileName, const struct unit_system* internal_units, /* Now need to broadcast that information to all ranks. */ MPI_Bcast(flag_entropy, 1, MPI_INT, 0, comm); - MPI_Bcast(&N_total, swift_type_count, MPI_LONG_LONG_INT, 0, comm); + MPI_Bcast(N_total, swift_type_count, MPI_LONG_LONG_INT, 0, comm); MPI_Bcast(dim, 3, MPI_DOUBLE, 0, comm); MPI_Bcast(ic_units, sizeof(struct unit_system), MPI_BYTE, 0, comm); @@ -932,12 +932,12 @@ void write_output_serial(struct engine* e, const char* baseName, Nstars_written, Nblackholes_written}; long long N_total[swift_type_count] = {0}; long long offset[swift_type_count] = {0}; - MPI_Exscan(&N, &offset, swift_type_count, MPI_LONG_LONG_INT, MPI_SUM, comm); + MPI_Exscan(N, offset, swift_type_count, MPI_LONG_LONG_INT, MPI_SUM, comm); for (int ptype = 0; ptype < swift_type_count; ++ptype) N_total[ptype] = offset[ptype] + N[ptype]; /* The last rank now has the correct N_total. Let's broadcast from there */ - MPI_Bcast(&N_total, 6, MPI_LONG_LONG_INT, mpi_size - 1, comm); + MPI_Bcast(N_total, 6, MPI_LONG_LONG_INT, mpi_size - 1, comm); /* Now everybody konws its offset and the total number of particles of each * type */