File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -375,27 +375,25 @@ static inline int ompi_request_free(ompi_request_t** request)
375375 * Wait a particular request for completion
376376 */
377377
378- #if OPAL_ENABLE_MULTI_THREADS
379378static inline void ompi_request_wait_completion (ompi_request_t * req )
380379{
381- ompi_wait_sync_t sync ;
382- WAIT_SYNC_INIT (& sync , 1 );
380+ if (opal_using_threads ()) {
381+ ompi_wait_sync_t sync ;
382+ WAIT_SYNC_INIT (& sync , 1 );
383383
384- if (OPAL_ATOMIC_CMPSET_PTR (& req -> req_complete , REQUEST_PENDING , & sync )) {
385- SYNC_WAIT (& sync );
386- }
384+ if (OPAL_ATOMIC_CMPSET_PTR (& req -> req_complete , REQUEST_PENDING , & sync )) {
385+ SYNC_WAIT (& sync );
386+ }
387387
388- assert (REQUEST_COMPLETE (req ));
389- WAIT_SYNC_RELEASE (& sync );
390- }
391- #else
392- static inline void ompi_request_wait_completion (ompi_request_t * req )
393- {
394- while (!REQUEST_COMPLETE (req )) {
395- opal_progress ();
388+ assert (REQUEST_COMPLETE (req ));
389+ WAIT_SYNC_RELEASE (& sync );
390+ } else {
391+ while (!REQUEST_COMPLETE (req )) {
392+ opal_progress ();
393+ }
396394 }
397395}
398- #endif
396+
399397/**
400398 * Signal or mark a request as complete. If with_signal is true this will
401399 * wake any thread pending on the request. If with_signal is false, the
You can’t perform that action at this time.
0 commit comments