Skip to content

Commit 47fbc39

Browse files
committed
mpi: incorporate review comments
Incorporate the comments received during the review of the PR. Signed-off-by: Edgar Gabriel <[email protected]>
1 parent 2076ec2 commit 47fbc39

File tree

6 files changed

+19
-22
lines changed

6 files changed

+19
-22
lines changed

docs/man-openmpi/man3/MPI_Request_get_status_all.3.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ operations associated with *active* handles in the array have completed.
3131
In this case, each status entry that corresponds to an active request
3232
is set to the status of the corresponding operation. It
3333
does not deallocate or deactivate the request; a subsequent call to
34-
test, wait, or free should be executed with each of those requests.
34+
any of the MPI test, wait, or free routines should be executed with each
35+
of those requests.
3536

3637
Each status entry that corresponds to a null or inactive handle is set
3738
to empty. Otherwise, ``flag = false`` is returned and the values of the
3839
status entries are undefined.
3940

4041
If your application does not need to examine the *status* field, you can
41-
save resources by using the predefined constant ``MPI_STATUS_IGNORE`` as a
42+
save resources by using the predefined constant ``MPI_STATUSES_IGNORE`` as a
4243
special value for the ``array_of_statuses`` argument.
4344

4445

docs/man-openmpi/man3/MPI_Request_get_status_any.3.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ DESCRIPTION
3131
of the operations associated with active handles has completed. In
3232
this case it returns in ``index`` the index of this request in the
3333
array and the status of the operation in ``status``. It does not
34-
deallocate or deactivate the request; a subsequent call to test, wait,
35-
or free should be executed with that request.
34+
deallocate or deactivate the request; a subsequent call to any of the MPI
35+
test, wait, or free routines should be executed with that request.
3636

3737
If no operation completed, it returns ``flag = false`` and a value of
3838
``MPI_UNDEFINED`` in ``index``. ``status`` is undefined in this

docs/man-openmpi/man3/MPI_Request_get_status_some.3.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ first ``outcount`` locations of the array ``array_of_indices`` and
3434
within the array ``array_of_requests`` and the status of these
3535
operations respectively. The array is indexed from zero in C and from
3636
one in Fortran. It does not deallocate or deactivate the request; a
37-
subsequent call to test, wait, or free should be executed with each completed
38-
request.
37+
subsequent call to any of the MPI test, wait, or free routines should be
38+
executed with each completed request.
3939

4040
If no operation in ``array_of_requests`` is complete, it returns
4141
``outcount = 0``. If all operations in ``array_of_requests`` are either
4242
``MPI_REQUEST_NULL`` or inactive, ``outcount`` will be set to ``MPI_UNDEFINED``.
4343

4444
If your application does not need to examine the *status* field, you can
45-
save resources by using the predefined constant ``MPI_STATUS_IGNORE`` as a
45+
save resources by using the predefined constant ``MPI_STATUSES_IGNORE`` as a
4646
special value for the ``array_of_statuses`` argument.
4747

4848

ompi/mpi/c/request_get_status_all.c.in

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,36 +70,32 @@ PROTOTYPE ERROR_CLASS request_get_status_all(INT count, REQUEST_CONST requests:c
7070
}
7171

7272
bool all_done;
73-
bool one_done;
7473

7574
#if OPAL_ENABLE_PROGRESS_THREADS == 0
76-
int do_it_once = 0;
75+
bool do_it_once = true;
7776
recheck_request_status:
7877
#endif
7978

8079
opal_atomic_mb();
8180
int i;
8281
all_done = true;
8382
for (i = 0; i < count; i++) {
84-
one_done = false;
8583
if( (requests[i] == MPI_REQUEST_NULL) || (requests[i]->req_state == OMPI_REQUEST_INACTIVE) ||
8684
(requests[i]->req_complete) ) {
8785
continue;
8886
}
89-
if (!one_done) {
90-
all_done = false;
91-
break;
92-
}
87+
all_done = false;
88+
break;
9389
}
9490

9591
if (!all_done) {
9692
#if OPAL_ENABLE_PROGRESS_THREADS == 0
97-
if( 0 == do_it_once ) {
93+
if(do_it_once) {
9894
/* If we run the opal_progress then check the status of the
9995
request before leaving. We will call the opal_progress only
10096
once per call. */
10197
opal_progress();
102-
do_it_once++;
98+
do_it_once = false;
10399
goto recheck_request_status;
104100
}
105101
#endif

ompi/mpi/c/request_get_status_any.c.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ PROTOTYPE ERROR_CLASS request_get_status_any(INT count, REQUEST_CONST requests:c
7777
bool all_inactive;
7878

7979
#if OPAL_ENABLE_PROGRESS_THREADS == 0
80-
int do_it_once = 0;
80+
bool do_it_once = true;
8181
recheck_request_status:
8282
#endif
8383

@@ -117,12 +117,12 @@ PROTOTYPE ERROR_CLASS request_get_status_any(INT count, REQUEST_CONST requests:c
117117
}
118118

119119
#if OPAL_ENABLE_PROGRESS_THREADS == 0
120-
if( 0 == do_it_once ) {
120+
if(do_it_once) {
121121
/* If we run the opal_progress then check the status of the
122122
request before leaving. We will call the opal_progress only
123123
once per call. */
124124
opal_progress();
125-
do_it_once++;
125+
do_it_once = false;
126126
goto recheck_request_status;
127127
}
128128
#endif

ompi/mpi/c/request_get_status_some.c.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ PROTOTYPE ERROR_CLASS request_get_status_some(INT incount, REQUEST_CONST request
7373
bool all_inactive;
7474

7575
#if OPAL_ENABLE_PROGRESS_THREADS == 0
76-
int do_it_once = 0;
76+
bool do_it_once = true;
7777
recheck_request_status:
7878
#endif
7979

@@ -112,12 +112,12 @@ PROTOTYPE ERROR_CLASS request_get_status_some(INT incount, REQUEST_CONST request
112112
}
113113

114114
#if OPAL_ENABLE_PROGRESS_THREADS == 0
115-
if( 0 == do_it_once ) {
115+
if(do_it_once) {
116116
/* If we run the opal_progress then check the status of the
117117
request before leaving. We will call the opal_progress only
118118
once per call. */
119119
opal_progress();
120-
do_it_once++;
120+
do_it_once = false;
121121
goto recheck_request_status;
122122
}
123123
#endif

0 commit comments

Comments
 (0)