Skip to content

Commit

Permalink
not depend on doIO to free an MPI_Comm object (#1642)
Browse files Browse the repository at this point in the history
  • Loading branch information
wkliao authored Apr 15, 2022
1 parent 852ed69 commit ea26955
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions testpar/t_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,10 @@ external_links(void)

for (i = 0; i < 2; i++) {

if (i == 0) {
comm = MPI_COMM_WORLD;

if (i == 0)
doIO = 1;
comm = MPI_COMM_WORLD;
}
else {
doIO = mpi_rank % 2;
mrc = MPI_Comm_split(MPI_COMM_WORLD, doIO, mpi_rank, &comm);
Expand Down Expand Up @@ -614,11 +614,11 @@ external_links(void)

ret = H5Fclose(fid);
VRFY((ret >= 0), "H5Fclose succeeded");
}

if (i == 1) {
mrc = MPI_Comm_free(&comm);
VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free succeeded");
}
if (comm != MPI_COMM_WORLD) {
mrc = MPI_Comm_free(&comm);
VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free succeeded");
}
}

Expand Down

0 comments on commit ea26955

Please sign in to comment.