|
3 | 3 | * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
4 | 4 | * University Research and Technology
|
5 | 5 | * 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 |
7 | 7 | * of Tennessee Research Foundation. All rights
|
8 | 8 | * reserved.
|
9 | 9 | * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
26 | 26 |
|
27 | 27 | #include "ompi/mpi/fortran/mpif-h/bindings.h"
|
28 | 28 | #include "ompi/mpi/fortran/base/constants.h"
|
| 29 | +#include "ompi/mca/coll/base/coll_base_util.h" |
29 | 30 |
|
30 | 31 | #if OMPI_BUILD_MPI_PROFILING
|
31 | 32 | #if OPAL_HAVE_WEAK_SYMBOLS
|
@@ -78,7 +79,7 @@ void ompi_ineighbor_alltoallv_f(char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *s
|
78 | 79 | MPI_Comm c_comm;
|
79 | 80 | MPI_Datatype c_sendtype, c_recvtype;
|
80 | 81 | MPI_Request c_request;
|
81 |
| - int size, c_ierr; |
| 82 | + int size, idx = 0, c_ierr; |
82 | 83 | OMPI_ARRAY_NAME_DECL(sendcounts);
|
83 | 84 | OMPI_ARRAY_NAME_DECL(sdispls);
|
84 | 85 | OMPI_ARRAY_NAME_DECL(recvcounts);
|
@@ -109,8 +110,17 @@ void ompi_ineighbor_alltoallv_f(char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *s
|
109 | 110 | if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
|
110 | 111 | if (MPI_SUCCESS == c_ierr) *request = PMPI_Request_c2f(c_request);
|
111 | 112 |
|
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 | + } |
116 | 126 | }
|
0 commit comments