Commit 5a14a88b authored by Shane Snyder's avatar Shane Snyder

shared file reduction bug fix

parent 3fae9404
......@@ -1147,7 +1147,7 @@ static void darshan_get_shared_records(struct darshan_core_runtime *core,
* which modules accessed them collectively
*/
DARSHAN_MPI_CALL(PMPI_Allreduce)(mod_flags, global_mod_flags,
DARSHAN_CORE_MAX_RECORDS, MPI_UINT64_T, MPI_LAND, MPI_COMM_WORLD);
DARSHAN_CORE_MAX_RECORDS, MPI_UINT64_T, MPI_BAND, MPI_COMM_WORLD);
ndx = 0;
for(i=0; (i<DARSHAN_CORE_MAX_RECORDS && id_array[i] != 0); i++)
......
......@@ -263,6 +263,17 @@ static void mpiio_get_output_data(
assert(mpiio_runtime);
/* TODO: clean up reduction stuff */
if(my_rank == 0)
{
int tmp_ndx = mpiio_runtime->file_array_ndx - mpiio_runtime->shared_rec_count;
memcpy(&(mpiio_runtime->file_record_array[tmp_ndx]), mpiio_runtime->red_buf,
mpiio_runtime->shared_rec_count * sizeof(struct darshan_mpiio_file));
free(mpiio_runtime->red_buf);
}
else
{
mpiio_runtime->file_array_ndx -= mpiio_runtime->shared_rec_count;
}
*buffer = (void *)(mpiio_runtime->file_record_array);
*size = mpiio_runtime->file_array_ndx * sizeof(struct darshan_mpiio_file);
......
Markdown is supported
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