Skip to content

Commit fc5d458

Browse files
committed
Consistency in handling OPAL_ENABLE_FT_CR.
I am not sure if we should continue to maintain the request support for FT_CR, but I tried here to simplify the code while maintaining the same meaning.
1 parent 483b9c3 commit fc5d458

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

ompi/request/req_test.c

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ int ompi_request_default_test(ompi_request_t ** rptr,
4949
}
5050

5151
if( REQUEST_COMPLETE(request) ) {
52-
OMPI_CRCP_REQUEST_COMPLETE(request);
52+
#if OPAL_ENABLE_FT_CR == 1
53+
if( opal_cr_is_enabled) {
54+
OMPI_CRCP_REQUEST_COMPLETE(request);
55+
}
56+
#endif
5357

5458
*completed = true;
5559
/* For a generalized request, we *have* to call the query_fn
@@ -120,7 +124,11 @@ int ompi_request_default_test_any(
120124
}
121125

122126
if( REQUEST_COMPLETE(request) ) {
123-
OMPI_CRCP_REQUEST_COMPLETE(request);
127+
#if OPAL_ENABLE_FT_CR == 1
128+
if( opal_cr_is_enabled) {
129+
OMPI_CRCP_REQUEST_COMPLETE(request);
130+
}
131+
#endif
124132

125133
*index = i;
126134
*completed = true;
@@ -226,7 +234,11 @@ int ompi_request_default_test_all(
226234
if (OMPI_REQUEST_GEN == request->req_type) {
227235
ompi_grequest_invoke_query(request, &request->req_status);
228236
}
229-
OMPI_CRCP_REQUEST_COMPLETE(request);
237+
#if OPAL_ENABLE_FT_CR == 1
238+
if( opal_cr_is_enabled) {
239+
OMPI_CRCP_REQUEST_COMPLETE(request);
240+
}
241+
#endif
230242
statuses[i] = request->req_status;
231243
if( request->req_persistent ) {
232244
request->req_state = OMPI_REQUEST_INACTIVE;
@@ -257,7 +269,11 @@ int ompi_request_default_test_all(
257269
if (OMPI_REQUEST_GEN == request->req_type) {
258270
ompi_grequest_invoke_query(request, &request->req_status);
259271
}
260-
OMPI_CRCP_REQUEST_COMPLETE(request);
272+
#if OPAL_ENABLE_FT_CR == 1
273+
if( opal_cr_is_enabled) {
274+
OMPI_CRCP_REQUEST_COMPLETE(request);
275+
}
276+
#endif
261277
if( request->req_persistent ) {
262278
request->req_state = OMPI_REQUEST_INACTIVE;
263279
continue;
@@ -285,7 +301,7 @@ int ompi_request_default_test_some(
285301
int * indices,
286302
ompi_status_public_t * statuses)
287303
{
288-
size_t i, num_requests_null_inactive=0, num_requests_done = 0;
304+
size_t i, num_requests_null_inactive = 0, num_requests_done = 0;
289305
int rc = OMPI_SUCCESS;
290306
ompi_request_t **rptr;
291307
ompi_request_t *request;
@@ -299,7 +315,11 @@ int ompi_request_default_test_some(
299315
continue;
300316
}
301317
if( REQUEST_COMPLETE(request) ) {
302-
OMPI_CRCP_REQUEST_COMPLETE(request);
318+
#if OPAL_ENABLE_FT_CR == 1
319+
if( opal_cr_is_enabled) {
320+
OMPI_CRCP_REQUEST_COMPLETE(request);
321+
}
322+
#endif
303323
indices[num_requests_done++] = i;
304324
}
305325
}

ompi/request/req_wait.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ int ompi_request_default_wait_any(size_t count,
143143

144144
request = requests[*index];
145145
assert( REQUEST_COMPLETE(request) );
146+
#if OPAL_ENABLE_FT_CR == 1
147+
if( opal_cr_is_enabled ) {
148+
OMPI_CRCP_REQUEST_COMPLETE(request);
149+
}
150+
#endif
146151
/* Per note above, we have to call gen request query_fn even
147152
if STATUS_IGNORE was provided */
148153
if (OMPI_REQUEST_GEN == request->req_type) {
@@ -166,17 +171,6 @@ int ompi_request_default_wait_any(size_t count,
166171
rc = ompi_request_free(&requests[*index]);
167172
}
168173

169-
#if OPAL_ENABLE_FT_CR == 1
170-
if( opal_cr_is_enabled) {
171-
ompi_request_t **rptr = requests;
172-
for (i = 0; i < count; i++, rptr++) {
173-
request = *rptr;
174-
if( REQUEST_COMPLETE(request) ) {
175-
OMPI_CRCP_REQUEST_COMPLETE(request);
176-
}
177-
}
178-
}
179-
#endif
180174
WAIT_SYNC_RELEASE(&sync);
181175
return rc;
182176
}

0 commit comments

Comments
 (0)