Skip to content

Commit c35ecea

Browse files
committed
More function converted.
Signed-off-by: George Bosilca <[email protected]>
1 parent ea0355a commit c35ecea

File tree

5 files changed

+52
-16
lines changed

5 files changed

+52
-16
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,8 @@ void ompi_ialltoallw_f(char *sendbuf, MPI_Fint *sendcounts,
137137
nb_request->data.release_arrays[idx++] = OMPI_ARRAY_NAME_CONVERT(sdispls);
138138
nb_request->data.release_arrays[idx++] = OMPI_ARRAY_NAME_CONVERT(rdispls);
139139
}
140+
nb_request->data.release_arrays[idx++] = c_recvtypes;
141+
nb_request->data.release_arrays[idx++] = c_sendtypes;
142+
nb_request->data.release_arrays[idx] = NULL;
140143
}
141144
}

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
44
* University Research and Technology
55
* Corporation. All rights reserved.
6-
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* Copyright (c) 2004-2021 The University of Tennessee and The University
77
* of Tennessee Research Foundation. All rights
88
* reserved.
99
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -26,6 +26,7 @@
2626

2727
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2828
#include "ompi/mpi/fortran/base/constants.h"
29+
#include "ompi/mca/coll/base/coll_base_util.h"
2930

3031
#if OMPI_BUILD_MPI_PROFILING
3132
#if OPAL_HAVE_WEAK_SYMBOLS
@@ -78,7 +79,7 @@ void ompi_ineighbor_alltoallv_f(char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *s
7879
MPI_Comm c_comm;
7980
MPI_Datatype c_sendtype, c_recvtype;
8081
MPI_Request c_request;
81-
int size, c_ierr;
82+
int size, idx = 0, c_ierr;
8283
OMPI_ARRAY_NAME_DECL(sendcounts);
8384
OMPI_ARRAY_NAME_DECL(sdispls);
8485
OMPI_ARRAY_NAME_DECL(recvcounts);
@@ -109,8 +110,17 @@ void ompi_ineighbor_alltoallv_f(char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *s
109110
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
110111
if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request);
111112

112-
OMPI_ARRAY_FINT_2_INT_CLEANUP(sendcounts);
113-
OMPI_ARRAY_FINT_2_INT_CLEANUP(sdispls);
114-
OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts);
115-
OMPI_ARRAY_FINT_2_INT_CLEANUP(rdispls);
113+
if ( REQUEST_COMPLETE(c_request)) {
114+
OMPI_ARRAY_FINT_2_INT_CLEANUP(sendcounts);
115+
OMPI_ARRAY_FINT_2_INT_CLEANUP(sdispls);
116+
OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts);
117+
OMPI_ARRAY_FINT_2_INT_CLEANUP(rdispls);
118+
} else {
119+
ompi_coll_base_nbc_request_t* nb_request = (ompi_coll_base_nbc_request_t*)c_request;
120+
nb_request->data.release_arrays[idx++] = OMPI_ARRAY_NAME_CONVERT(sendcounts);
121+
nb_request->data.release_arrays[idx++] = OMPI_ARRAY_NAME_CONVERT(sdispls);
122+
nb_request->data.release_arrays[idx++] = OMPI_ARRAY_NAME_CONVERT(sendcounts);
123+
nb_request->data.release_arrays[idx++] = OMPI_ARRAY_NAME_CONVERT(rdispls);
124+
nb_request->data.release_arrays[idx] = NULL;
125+
}
116126
}

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
44
* University Research and Technology
55
* Corporation. All rights reserved.
6-
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* Copyright (c) 2004-2021 The University of Tennessee and The University
77
* of Tennessee Research Foundation. All rights
88
* reserved.
99
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -26,6 +26,7 @@
2626

2727
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2828
#include "ompi/mpi/fortran/base/constants.h"
29+
#include "ompi/mca/coll/base/coll_base_util.h"
2930

3031
#if OMPI_BUILD_MPI_PROFILING
3132
#if OPAL_HAVE_WEAK_SYMBOLS
@@ -79,7 +80,7 @@ void ompi_ineighbor_alltoallw_f(char *sendbuf, MPI_Fint *sendcounts,
7980
MPI_Comm c_comm;
8081
MPI_Datatype *c_sendtypes, *c_recvtypes;
8182
MPI_Request c_request;
82-
int size, c_ierr;
83+
int size, idx = 0, c_ierr;
8384
OMPI_ARRAY_NAME_DECL(sendcounts);
8485
OMPI_ARRAY_NAME_DECL(recvcounts);
8586

@@ -113,8 +114,17 @@ void ompi_ineighbor_alltoallw_f(char *sendbuf, MPI_Fint *sendcounts,
113114
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
114115
if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request);
115116

116-
OMPI_ARRAY_FINT_2_INT_CLEANUP(sendcounts);
117-
OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts);
118-
free(c_sendtypes);
119-
free(c_recvtypes);
117+
if ( REQUEST_COMPLETE(c_request)) {
118+
OMPI_ARRAY_FINT_2_INT_CLEANUP(sendcounts);
119+
OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts);
120+
free(c_sendtypes);
121+
free(c_recvtypes);
122+
} else {
123+
ompi_coll_base_nbc_request_t* nb_request = (ompi_coll_base_nbc_request_t*)c_request;
124+
nb_request->data.release_arrays[idx++] = OMPI_ARRAY_NAME_CONVERT(sendcounts);
125+
nb_request->data.release_arrays[idx++] = OMPI_ARRAY_NAME_CONVERT(recvcounts);
126+
nb_request->data.release_arrays[idx++] = c_sendtypes;
127+
nb_request->data.release_arrays[idx++] = c_recvtypes;
128+
nb_request->data.release_arrays[idx] = NULL;
129+
}
120130
}

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
33
* University Research and Technology
44
* Corporation. All rights reserved.
5-
* Copyright (c) 2004-2005 The University of Tennessee and The University
5+
* Copyright (c) 2004-2021 The University of Tennessee and The University
66
* of Tennessee Research Foundation. All rights
77
* reserved.
88
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -23,6 +23,7 @@
2323

2424
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2525
#include "ompi/mpi/fortran/base/constants.h"
26+
#include "ompi/mca/coll/base/coll_base_util.h"
2627

2728
#if OMPI_BUILD_MPI_PROFILING
2829
#if OPAL_HAVE_WEAK_SYMBOLS
@@ -72,12 +73,11 @@ void ompi_ireduce_scatter_f(char *sendbuf, char *recvbuf,
7273
MPI_Fint *op, MPI_Fint *comm, MPI_Fint *request,
7374
MPI_Fint *ierr)
7475
{
75-
int c_ierr;
76+
int c_ierr, size;
7677
MPI_Comm c_comm;
7778
MPI_Datatype c_type;
7879
MPI_Request c_request;
7980
MPI_Op c_op;
80-
int size;
8181
OMPI_ARRAY_NAME_DECL(recvcounts);
8282

8383
c_comm = PMPI_Comm_f2c(*comm);
@@ -96,4 +96,12 @@ void ompi_ireduce_scatter_f(char *sendbuf, char *recvbuf,
9696
c_type, c_op, c_comm, &c_request);
9797
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
9898
if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request);
99+
100+
if ( REQUEST_COMPLETE(c_request)) {
101+
OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts);
102+
} else {
103+
ompi_coll_base_nbc_request_t* nb_request = (ompi_coll_base_nbc_request_t*)c_request;
104+
nb_request->data.release_arrays[0] = recvcounts;
105+
nb_request->data.release_arrays[1] = NULL;
106+
}
99107
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
33
* University Research and Technology
44
* Corporation. All rights reserved.
5-
* Copyright (c) 2004-2005 The University of Tennessee and The University
5+
* Copyright (c) 2004-2021 The University of Tennessee and The University
66
* of Tennessee Research Foundation. All rights
77
* reserved.
88
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -23,6 +23,7 @@
2323

2424
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2525
#include "ompi/mpi/fortran/base/constants.h"
26+
#include "ompi/mca/coll/base/coll_base_util.h"
2627

2728
#if OMPI_BUILD_MPI_PROFILING
2829
#if OPAL_HAVE_WEAK_SYMBOLS
@@ -98,4 +99,8 @@ void ompi_reduce_scatter_init_f(char *sendbuf, char *recvbuf,
9899
c_type, c_op, c_comm, c_info, &c_request);
99100
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
100101
if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request);
102+
103+
ompi_coll_base_nbc_request_t* nb_request = (ompi_coll_base_nbc_request_t*)c_request;
104+
nb_request->data.release_arrays[0] = OMPI_ARRAY_NAME_CONVERT(recvcounts);
105+
nb_request->data.release_arrays[1] = NULL;
101106
}

0 commit comments

Comments
 (0)