Commit 1ac9f228 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'io_bug' into 'master'

Io bug?

See merge request !992
parents a61064c2 9d92a618
......@@ -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 */
......
......@@ -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 */
......
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