Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONOTMERGE: Purge communicator before free on mpich4+ #787

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/runtime-libraries/mpi/mpi_caf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,23 @@ finalize_internal(int status_code)
ierr = MPI_Finalize(); chk_err(ierr);
}
#else
#ifdef MPICH
{
int probe_flag;
MPI_Status status;
do {
ierr = MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, CAF_COMM_WORLD, &probe_flag,
&status); /* error is not of interest. */
if (probe_flag) {
int cnt;
MPI_Get_count(&status, MPI_BYTE, &cnt);
void * buf = alloca(cnt);
ierr = MPI_Recv(buf, cnt, MPI_BYTE, status.MPI_SOURCE, status.MPI_TAG,
CAF_COMM_WORLD, &status); chk_err(ierr);
}
} while (probe_flag);
}
#endif
ierr = MPI_Comm_free(&CAF_COMM_WORLD); chk_err(ierr);

CAF_Win_unlock_all(*stat_tok);
Expand Down
Loading