Skip to content

Commit

Permalink
Fix MPI method: wait for Isend() so that Cray MPICH will actually fre…
Browse files Browse the repository at this point in the history
…e communicator in MPI_Comm_free()
  • Loading branch information
pnorbert committed Feb 21, 2018
1 parent 607e5a4 commit 415484c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/write/adios_mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,11 @@ int adios_mpi_open (struct adios_file_struct * fd
,&md->fh
);
}
// Wait for Isend to complete before otherwise the request variable may disappear from the stack
if (next != -1)
{
MPI_Wait(&md->req, &md->status);
}

if (err != MPI_SUCCESS)
{
Expand Down Expand Up @@ -608,6 +613,11 @@ int adios_mpi_open (struct adios_file_struct * fd
,&md->fh
);
}
// Wait for Isend to complete before otherwise the request variable may disappear from the stack
if (next != -1)
{
MPI_Wait(&md->req, &md->status);
}

if (err != MPI_SUCCESS)
{
Expand Down Expand Up @@ -799,6 +809,11 @@ int adios_mpi_open (struct adios_file_struct * fd
,&md->fh
);
}
// Wait for Isend to complete before otherwise the request variable may disappear from the stack
if (next != -1)
{
MPI_Wait(&md->req, &md->status);
}

if (err != MPI_SUCCESS)
{
Expand Down

0 comments on commit 415484c

Please sign in to comment.