Skip to content

Commit 88d7f08

Browse files
committed
pr feedback for f77/f90 variants
Signed-off-by: Howard Pritchard <[email protected]>
1 parent 3c3dffc commit 88d7f08

File tree

3 files changed

+20
-26
lines changed

3 files changed

+20
-26
lines changed

ompi/mpi/fortran/mpif-h/request_get_status_all_f.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,12 @@ void ompi_request_get_status_all_f(MPI_Fint *count, MPI_Fint *array_of_requests,
110110

111111
if (MPI_SUCCESS == c_ierr) {
112112
OMPI_SINGLE_INT_2_LOGICAL(flag);
113-
for (i = 0; i < OMPI_FINT_2_INT(*count); ++i) {
114-
array_of_requests[i] = c_req[i]->req_f_to_c_index;
115-
if (!OMPI_IS_FORTRAN_STATUSES_IGNORE(array_of_statuses) &&
116-
!OMPI_IS_FORTRAN_STATUS_IGNORE(&array_of_statuses[i])) {
117-
PMPI_Status_c2f( &c_status[i], &array_of_statuses[i * (sizeof(MPI_Status) / sizeof(int))]);
113+
if (1 == OMPI_LOGICAL_2_INT(*flag)){
114+
for (i = 0; i < OMPI_FINT_2_INT(*count); ++i) {
115+
if (!OMPI_IS_FORTRAN_STATUSES_IGNORE(array_of_statuses) &&
116+
!OMPI_IS_FORTRAN_STATUS_IGNORE(&array_of_statuses[i])) {
117+
PMPI_Status_c2f( &c_status[i], &array_of_statuses[i * (sizeof(MPI_Status) / sizeof(int))]);
118+
}
118119
}
119120
}
120121
}

ompi/mpi/fortran/mpif-h/request_get_status_any_f.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,12 @@ void ompi_request_get_status_any_f(MPI_Fint *count, MPI_Fint *array_of_requests,
113113

114114
OMPI_SINGLE_INT_2_LOGICAL(flag);
115115

116-
/* Increment index by one for fortran conventions */
117-
118-
OMPI_SINGLE_INT_2_FINT(indx);
119-
if (MPI_UNDEFINED != *(OMPI_SINGLE_NAME_CONVERT(indx))) {
120-
array_of_requests[OMPI_INT_2_FINT(*indx)] =
121-
c_req[OMPI_INT_2_FINT(*indx)]->req_f_to_c_index;
122-
++(*indx);
123-
}
124-
if (!OMPI_IS_FORTRAN_STATUS_IGNORE(status)) {
125-
PMPI_Status_c2f(&c_status, status);
116+
if (1 == OMPI_LOGICAL_2_INT(*flag)){
117+
OMPI_SINGLE_INT_2_FINT(indx);
118+
++(*indx); /* Increment indexes by one for fortran conventions */
119+
if (!OMPI_IS_FORTRAN_STATUS_IGNORE(status)) {
120+
PMPI_Status_c2f(&c_status, status);
121+
}
126122
}
127123
}
128124
free(c_req);

ompi/mpi/fortran/mpif-h/request_get_status_some_f.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,18 @@ void ompi_request_get_status_some_f(MPI_Fint *incount, MPI_Fint *array_of_reques
117117

118118
if (MPI_SUCCESS == c_ierr) {
119119
OMPI_SINGLE_INT_2_FINT(*outcount);
120-
OMPI_ARRAY_INT_2_FINT(array_of_indices, *outcount);
121-
122-
/* Increment indexes by one for fortran conventions */
123120

124121
if (MPI_UNDEFINED != OMPI_FINT_2_INT(*outcount)) {
122+
OMPI_ARRAY_INT_2_FINT(array_of_indices, *outcount);
125123
for (i = 0; i < OMPI_FINT_2_INT(*outcount); ++i) {
126-
array_of_requests[OMPI_INT_2_FINT(array_of_indices[i])] =
127-
c_req[OMPI_INT_2_FINT(array_of_indices[i])]->req_f_to_c_index;
128-
++array_of_indices[i];
124+
++array_of_indices[i]; /* Increment indexes by one for fortran conventions */
129125
}
130-
}
131-
if (!OMPI_IS_FORTRAN_STATUSES_IGNORE(array_of_statuses)) {
132-
for (i = 0; i < OMPI_FINT_2_INT(*incount); ++i) {
133-
if (!OMPI_IS_FORTRAN_STATUS_IGNORE(&array_of_statuses[i])) {
134-
PMPI_Status_c2f(&c_status[i], &array_of_statuses[i * (sizeof(MPI_Status) / sizeof(int))]);
126+
if (!OMPI_IS_FORTRAN_STATUSES_IGNORE(array_of_statuses)) {
127+
for (i = 0; i < OMPI_FINT_2_INT(*outcount); ++i) {
128+
if (!OMPI_IS_FORTRAN_STATUS_IGNORE(&array_of_statuses[i])) {
129+
PMPI_Status_c2f(&c_status[i],
130+
&array_of_statuses[i * (sizeof(MPI_Status) / sizeof(int))]);
131+
}
135132
}
136133
}
137134
}

0 commit comments

Comments
 (0)