Skip to content

Commit 3cf5004

Browse files
nysalawlauria
authored andcommitted
Improve MPI_Waitall performance for MPI_THREAD_MULTIPLE
Avoid atomic cmpxchng operations for MPI requests that are already complete. This improves the performance in message rate benchmarks. Signed-off-by: Austen Lauria <awlauria@us.ibm.com>
1 parent 729468a commit 3cf5004

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ompi/request/req_wait.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ int ompi_request_default_wait_all( size_t count,
243243
continue;
244244
}
245245

246-
if (!OPAL_ATOMIC_COMPARE_EXCHANGE_STRONG_PTR(&request->req_complete, &_tmp_ptr, &sync)) {
246+
if (REQUEST_COMPLETE(request) || !OPAL_ATOMIC_COMPARE_EXCHANGE_STRONG_PTR(&request->req_complete, &_tmp_ptr, &sync)) {
247247
if( OPAL_LIKELY( REQUEST_COMPLETE(request) ) ) {
248248
if( OPAL_UNLIKELY( MPI_SUCCESS != request->req_status.MPI_ERROR ) ) {
249249
failed++;

0 commit comments

Comments
 (0)