|
10 | 10 | * Copyright (c) 2004-2005 The Regents of the University of California. |
11 | 11 | * All rights reserved. |
12 | 12 | * Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. |
13 | | - * Copyright (c) 2015-2019 Research Organization for Information Science |
14 | | - * and Technology (RIST). All rights reserved. |
| 13 | + * Copyright (c) 2015 Research Organization for Information Science |
| 14 | + * and Technology (RIST). All rights reserved. |
15 | 15 | * $COPYRIGHT$ |
16 | 16 | * |
17 | 17 | * Additional copyrights may follow |
|
23 | 23 |
|
24 | 24 | #include "ompi/mpi/fortran/mpif-h/bindings.h" |
25 | 25 | #include "ompi/mpi/fortran/base/constants.h" |
26 | | -#include "ompi/communicator/communicator.h" |
27 | 26 |
|
28 | 27 | #if OMPI_BUILD_MPI_PROFILING |
29 | 28 | #if OPAL_HAVE_WEAK_SYMBOLS |
@@ -73,44 +72,40 @@ void ompi_alltoallv_f(char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *sdispls, |
73 | 72 | MPI_Fint *rdispls, MPI_Fint *recvtype, |
74 | 73 | MPI_Fint *comm, MPI_Fint *ierr) |
75 | 74 | { |
76 | | - int c_ierr; |
77 | | - MPI_Comm c_comm = PMPI_Comm_f2c(*comm); |
78 | | - MPI_Datatype c_sendtype = NULL, c_recvtype = PMPI_Type_f2c(*recvtype); |
79 | | - OMPI_COND_STATEMENT(int size = OMPI_COMM_IS_INTER(c_comm)?ompi_comm_remote_size(c_comm):ompi_comm_size(c_comm)); |
| 75 | + MPI_Comm c_comm; |
| 76 | + MPI_Datatype c_sendtype, c_recvtype; |
| 77 | + int size, c_ierr; |
80 | 78 | OMPI_ARRAY_NAME_DECL(sendcounts); |
81 | 79 | OMPI_ARRAY_NAME_DECL(sdispls); |
82 | 80 | OMPI_ARRAY_NAME_DECL(recvcounts); |
83 | 81 | OMPI_ARRAY_NAME_DECL(rdispls); |
84 | 82 |
|
85 | | - if (OMPI_COMM_IS_INTER(c_comm) || !OMPI_IS_FORTRAN_IN_PLACE(sendbuf)) { |
86 | | - c_sendtype = PMPI_Type_f2c(*sendtype); |
87 | | - OMPI_ARRAY_FINT_2_INT(sendcounts, size); |
88 | | - OMPI_ARRAY_FINT_2_INT(sdispls, size); |
89 | | - } else { |
90 | | - sendbuf = MPI_IN_PLACE; |
91 | | - } |
| 83 | + c_comm = PMPI_Comm_f2c(*comm); |
| 84 | + c_sendtype = PMPI_Type_f2c(*sendtype); |
| 85 | + c_recvtype = PMPI_Type_f2c(*recvtype); |
92 | 86 |
|
| 87 | + PMPI_Comm_size(c_comm, &size); |
| 88 | + OMPI_ARRAY_FINT_2_INT(sendcounts, size); |
| 89 | + OMPI_ARRAY_FINT_2_INT(sdispls, size); |
93 | 90 | OMPI_ARRAY_FINT_2_INT(recvcounts, size); |
94 | 91 | OMPI_ARRAY_FINT_2_INT(rdispls, size); |
95 | 92 |
|
| 93 | + sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf); |
96 | 94 | sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf); |
97 | 95 | recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf); |
98 | 96 |
|
99 | 97 | c_ierr = PMPI_Alltoallv(sendbuf, |
100 | | - OMPI_ARRAY_NAME_CONVERT(sendcounts), |
101 | | - OMPI_ARRAY_NAME_CONVERT(sdispls), |
102 | | - c_sendtype, |
103 | | - recvbuf, |
104 | | - OMPI_ARRAY_NAME_CONVERT(recvcounts), |
105 | | - OMPI_ARRAY_NAME_CONVERT(rdispls), |
106 | | - c_recvtype, c_comm); |
107 | | - |
| 98 | + OMPI_ARRAY_NAME_CONVERT(sendcounts), |
| 99 | + OMPI_ARRAY_NAME_CONVERT(sdispls), |
| 100 | + c_sendtype, |
| 101 | + recvbuf, |
| 102 | + OMPI_ARRAY_NAME_CONVERT(recvcounts), |
| 103 | + OMPI_ARRAY_NAME_CONVERT(rdispls), |
| 104 | + c_recvtype, c_comm); |
108 | 105 | if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); |
109 | 106 |
|
110 | | - if (MPI_IN_PLACE != sendbuf) { |
111 | | - OMPI_ARRAY_FINT_2_INT_CLEANUP(sendcounts); |
112 | | - OMPI_ARRAY_FINT_2_INT_CLEANUP(sdispls); |
113 | | - } |
| 107 | + OMPI_ARRAY_FINT_2_INT_CLEANUP(sendcounts); |
| 108 | + OMPI_ARRAY_FINT_2_INT_CLEANUP(sdispls); |
114 | 109 | OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts); |
115 | 110 | OMPI_ARRAY_FINT_2_INT_CLEANUP(rdispls); |
116 | 111 | } |
0 commit comments