Skip to content

Commit 3760e5f

Browse files
committed
Let the test and wait calls set CRs to inactive
Also: always store continuations directly in poll-only CRs. Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
1 parent e557ad7 commit 3760e5f

File tree

3 files changed

+1
-82
lines changed

3 files changed

+1
-82
lines changed

ompi/mpiext/continue/c/continuation.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,7 @@ ompi_continue_enqueue_runnable(ompi_continuation_t *cont)
546546
if (!req_volatile) {
547547
opal_list_remove_item(&cont_req->cont_incomplete_list, &cont->super.super);
548548
}
549-
if (cont_req->super.req_state == OMPI_REQUEST_INACTIVE) {
550-
opal_list_append(&cont_req->cont_complete_defer_list, &cont->super.super);
551-
} else if (NULL != cont_req->cont_complete_list) {
549+
if (NULL != cont_req->cont_complete_list) {
552550
opal_list_append(cont_req->cont_complete_list, &cont->super.super);
553551
} else {
554552
/* someone started the request before we took the lock, go back and check again
@@ -700,7 +698,6 @@ static void handle_failed_cont(ompi_continuation_t *cont, int status, bool have_
700698
if (0 == num_active) {
701699
opal_atomic_wmb();
702700
ompi_request_complete(&cont_req->super, true);
703-
cont_req->super.req_state = OMPI_REQUEST_INACTIVE;
704701
}
705702

706703
if (!have_cont_req_lock) {

ompi/request/req_test.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ int ompi_request_default_test(ompi_request_t ** rptr,
6262
OMPI_COPY_STATUS(status, request->req_status, false);
6363
}
6464

65-
#if OMPI_HAVE_MPI_EXT_CONTINUE
66-
if (OMPI_REQUEST_CONT == request->req_type) {
67-
/* continuation requests are alwys active, don't modify the state */
68-
return request->req_status.MPI_ERROR;
69-
}
70-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
71-
7265
if( request->req_persistent ) {
7366
request->req_state = OMPI_REQUEST_INACTIVE;
7467
return request->req_status.MPI_ERROR;
@@ -154,13 +147,6 @@ int ompi_request_default_test_any(
154147
OMPI_COPY_STATUS(status, request->req_status, false);
155148
}
156149

157-
#if OMPI_HAVE_MPI_EXT_CONTINUE
158-
if (OMPI_REQUEST_CONT == request->req_type) {
159-
/* continuation requests are alwys active, don't modify the state */
160-
return OMPI_SUCCESS;
161-
}
162-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
163-
164150
if( request->req_persistent ) {
165151
request->req_state = OMPI_REQUEST_INACTIVE;
166152
return OMPI_SUCCESS;
@@ -295,13 +281,6 @@ int ompi_request_default_test_all(
295281
}
296282
OMPI_COPY_STATUS(&statuses[i], request->req_status, true);
297283

298-
#if OMPI_HAVE_MPI_EXT_CONTINUE
299-
if (OMPI_REQUEST_CONT == request->req_type) {
300-
/* continuation requests are alwys active, don't modify the state */
301-
continue;
302-
}
303-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
304-
305284
if( request->req_persistent ) {
306285
request->req_state = OMPI_REQUEST_INACTIVE;
307286
continue;
@@ -338,13 +317,6 @@ int ompi_request_default_test_all(
338317
ompi_grequest_invoke_query(request, &request->req_status);
339318
}
340319

341-
#if OMPI_HAVE_MPI_EXT_CONTINUE
342-
if (OMPI_REQUEST_CONT == request->req_type) {
343-
/* continuation requests are alwys active, don't modify the state */
344-
continue;
345-
}
346-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
347-
348320
if( request->req_persistent ) {
349321
request->req_state = OMPI_REQUEST_INACTIVE;
350322
continue;
@@ -467,13 +439,6 @@ int ompi_request_default_test_some(
467439
#endif /* OPAL_ENABLE_FT_MPI */
468440
}
469441

470-
#if OMPI_HAVE_MPI_EXT_CONTINUE
471-
if (OMPI_REQUEST_CONT == request->req_type) {
472-
/* continuation requests are alwys active, don't modify the state */
473-
continue;
474-
}
475-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
476-
477442
if( request->req_persistent ) {
478443
request->req_state = OMPI_REQUEST_INACTIVE;
479444
} else {

ompi/request/req_wait.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@ int ompi_request_default_wait(
6363
OMPI_COPY_STATUS(status, req->req_status, false);
6464
}
6565

66-
#if OMPI_HAVE_MPI_EXT_CONTINUE
67-
if (OMPI_REQUEST_CONT == req->req_type) {
68-
/* continuation requests are alwys active, don't modify the state */
69-
return req->req_status.MPI_ERROR;
70-
}
71-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
72-
7366
if( req->req_persistent ) {
7467
if( req->req_state == OMPI_REQUEST_INACTIVE ) {
7568
if (MPI_STATUS_IGNORE != status) {
@@ -78,13 +71,6 @@ int ompi_request_default_wait(
7871
return OMPI_SUCCESS;
7972
}
8073

81-
#if OMPI_HAVE_MPI_EXT_CONTINUE
82-
if (OMPI_REQUEST_CONT == req->req_type) {
83-
/* continuation requests are alwys active, don't modify the state */
84-
return req->req_status.MPI_ERROR;
85-
}
86-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
87-
8874
req->req_state = OMPI_REQUEST_INACTIVE;
8975
return req->req_status.MPI_ERROR;
9076
}
@@ -245,14 +231,7 @@ int ompi_request_default_wait_any(size_t count,
245231
}
246232
rc = request->req_status.MPI_ERROR;
247233
if( request->req_persistent ) {
248-
#if OMPI_HAVE_MPI_EXT_CONTINUE
249-
if (OMPI_REQUEST_CONT != request->req_type) {
250-
request->req_state = OMPI_REQUEST_INACTIVE;
251-
}
252-
#else // OMPI_HAVE_MPI_EXT_CONTINUE
253234
request->req_state = OMPI_REQUEST_INACTIVE;
254-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
255-
256235
} else if (MPI_SUCCESS == rc) {
257236
/* Only free the request if there is no error on it */
258237
/* If there's an error while freeing the request,
@@ -408,14 +387,6 @@ int ompi_request_default_wait_all( size_t count,
408387

409388
OMPI_COPY_STATUS(&statuses[i], request->req_status, true);
410389

411-
412-
#if OMPI_HAVE_MPI_EXT_CONTINUE
413-
if (OMPI_REQUEST_CONT == request->req_type) {
414-
/* continuation requests are alwys active, don't modify the state */
415-
continue;
416-
}
417-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
418-
419390
if( request->req_persistent ) {
420391
request->req_state = OMPI_REQUEST_INACTIVE;
421392
continue;
@@ -487,13 +458,6 @@ int ompi_request_default_wait_all( size_t count,
487458

488459
rc = request->req_status.MPI_ERROR;
489460

490-
#if OMPI_HAVE_MPI_EXT_CONTINUE
491-
if (OMPI_REQUEST_CONT == request->req_type) {
492-
/* continuation requests are alwys active, don't modify the state */
493-
continue;
494-
}
495-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
496-
497461
if( request->req_persistent ) {
498462
request->req_state = OMPI_REQUEST_INACTIVE;
499463
} else if (MPI_SUCCESS == rc) {
@@ -702,13 +666,6 @@ int ompi_request_default_wait_some(size_t count,
702666
rc = MPI_ERR_IN_STATUS;
703667
}
704668

705-
#if OMPI_HAVE_MPI_EXT_CONTINUE
706-
if (OMPI_REQUEST_CONT == request->req_type) {
707-
/* continuation requests are alwys active, don't modify the state */
708-
continue;
709-
}
710-
#endif // OMPI_HAVE_MPI_EXT_CONTINUE
711-
712669
if( request->req_persistent ) {
713670
request->req_state = OMPI_REQUEST_INACTIVE;
714671
} else {

0 commit comments

Comments
 (0)