Skip to content

Commit

Permalink
Always wait to complete all receives.
Browse files Browse the repository at this point in the history
Without waiting for the last receive before going to the next iteration we
might overwrite data if the current left neighbor become the right at the next
iteration.

Start with an MPI_REQUEST_NULL request.
If the request is not NULL and the first rcounts is 0, the ompi_request_wait
will segfault.

Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
  • Loading branch information
bosilca authored and bwbarrett committed Nov 16, 2021
1 parent d8c50a5 commit 6802702
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions ompi/mca/coll/base/coll_base_alltoallv.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
{
int i, size, rank, left, right, err = MPI_SUCCESS, line;
ptrdiff_t extent;
ompi_request_t *req;
ompi_request_t *req = MPI_REQUEST_NULL;
char *tmp_buffer;
size_t packed_size = 0, max_size;
opal_convertor_t convertor;
Expand Down Expand Up @@ -140,10 +140,10 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
right, MCA_COLL_BASE_TAG_ALLTOALLV, MCA_PML_BASE_SEND_STANDARD,
comm));
if (MPI_SUCCESS != err) { goto error_hndl; }

err = ompi_request_wait (&req, MPI_STATUSES_IGNORE);
if (MPI_SUCCESS != err) { goto error_hndl; }
}

err = ompi_request_wait (&req, MPI_STATUSES_IGNORE);
if (MPI_SUCCESS != err) { goto error_hndl; }
}

error_hndl:
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/basic/coll_basic_alltoallw.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ mca_coll_basic_alltoallw_intra_inplace(const void *rbuf, const int *rcounts, con
right, MCA_COLL_BASE_TAG_ALLTOALLW, MCA_PML_BASE_SEND_STANDARD,
comm));
if (MPI_SUCCESS != err) { goto error_hndl; }

err = ompi_request_wait (&req, MPI_STATUSES_IGNORE);
if (MPI_SUCCESS != err) { goto error_hndl; }
}

err = ompi_request_wait (&req, MPI_STATUSES_IGNORE);
if (MPI_SUCCESS != err) { goto error_hndl; }
}

error_hndl:
Expand Down

0 comments on commit 6802702

Please sign in to comment.