Skip to content
Merged
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
18 changes: 8 additions & 10 deletions ompi/request/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,18 +522,16 @@ static inline int ompi_request_complete(ompi_request_t* request, bool with_signa
}

if (0 == rc) {
if( OPAL_LIKELY(with_signal) ) {
void *_tmp_ptr = REQUEST_PENDING;

if(!OPAL_ATOMIC_COMPARE_EXCHANGE_STRONG_PTR(&request->req_complete, &_tmp_ptr, REQUEST_COMPLETED)) {
ompi_wait_sync_t *tmp_sync = (ompi_wait_sync_t *) OPAL_ATOMIC_SWAP_PTR(&request->req_complete,
REQUEST_COMPLETED);
/* In the case where another thread concurrently changed the request to REQUEST_PENDING */
if( REQUEST_PENDING != tmp_sync )
wait_sync_update(tmp_sync, 1, request->req_status.MPI_ERROR);
if (OPAL_LIKELY(with_signal)) {

ompi_wait_sync_t *tmp_sync = (ompi_wait_sync_t *) OPAL_ATOMIC_SWAP_PTR(&request->req_complete,
REQUEST_COMPLETED);
if( REQUEST_PENDING != tmp_sync ) {
wait_sync_update(tmp_sync, 1, request->req_status.MPI_ERROR);
}
} else
} else {
request->req_complete = REQUEST_COMPLETED;
}
}

return OMPI_SUCCESS;
Expand Down