1
1

Merge pull request #1807 from hjelmn/request_perfm_regression

ompi/request: fix performance regression
Этот коммит содержится в:
Nathan Hjelm 2016-06-21 14:47:56 -06:00 коммит произвёл GitHub
родитель 8b7d81de13 544adb9aed
Коммит 7bd7c0578b

Просмотреть файл

@ -375,27 +375,25 @@ static inline int ompi_request_free(ompi_request_t** request)
* Wait a particular request for completion * Wait a particular request for completion
*/ */
#if OPAL_ENABLE_MULTI_THREADS
static inline void ompi_request_wait_completion(ompi_request_t *req) static inline void ompi_request_wait_completion(ompi_request_t *req)
{ {
ompi_wait_sync_t sync; if (opal_using_threads ()) {
WAIT_SYNC_INIT(&sync, 1); ompi_wait_sync_t sync;
WAIT_SYNC_INIT(&sync, 1);
if(OPAL_ATOMIC_CMPSET_PTR(&req->req_complete, REQUEST_PENDING, &sync)) { if(OPAL_ATOMIC_CMPSET_PTR(&req->req_complete, REQUEST_PENDING, &sync)) {
SYNC_WAIT(&sync); SYNC_WAIT(&sync);
} }
assert(REQUEST_COMPLETE(req)); assert(REQUEST_COMPLETE(req));
WAIT_SYNC_RELEASE(&sync); WAIT_SYNC_RELEASE(&sync);
} } else {
#else while(!REQUEST_COMPLETE(req)) {
static inline void ompi_request_wait_completion(ompi_request_t *req) opal_progress();
{ }
while(!REQUEST_COMPLETE(req)) {
opal_progress();
} }
} }
#endif
/** /**
* Signal or mark a request as complete. If with_signal is true this will * Signal or mark a request as complete. If with_signal is true this will
* wake any thread pending on the request. If with_signal is false, the * wake any thread pending on the request. If with_signal is false, the