This source file includes following definitions.
- ompi_neighbor_alltoallw_f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 #include "ompi_config.h"
26
27 #include "ompi/mpi/fortran/mpif-h/bindings.h"
28 #include "ompi/mpi/fortran/base/constants.h"
29
30 #if OMPI_BUILD_MPI_PROFILING
31 #if OPAL_HAVE_WEAK_SYMBOLS
32 #pragma weak PMPI_NEIGHBOR_ALLTOALLW = ompi_neighbor_alltoallw_f
33 #pragma weak pmpi_neighbor_alltoallw = ompi_neighbor_alltoallw_f
34 #pragma weak pmpi_neighbor_alltoallw_ = ompi_neighbor_alltoallw_f
35 #pragma weak pmpi_neighbor_alltoallw__ = ompi_neighbor_alltoallw_f
36
37 #pragma weak PMPI_Neighbor_alltoallw_f = ompi_neighbor_alltoallw_f
38 #pragma weak PMPI_Neighbor_alltoallw_f08 = ompi_neighbor_alltoallw_f
39 #else
40 OMPI_GENERATE_F77_BINDINGS (PMPI_NEIGHBOR_ALLTOALLW,
41 pmpi_neighbor_alltoallw,
42 pmpi_neighbor_alltoallw_,
43 pmpi_neighbor_alltoallw__,
44 pompi_neighbor_alltoallw_f,
45 (char *sendbuf, MPI_Fint *sendcounts, MPI_Aint *sdispls, MPI_Fint *sendtypes, char *recvbuf, MPI_Fint *recvcounts, MPI_Aint *rdispls, MPI_Fint *recvtypes, MPI_Fint *comm, MPI_Fint *ierr),
46 (sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, ierr) )
47 #endif
48 #endif
49
50 #if OPAL_HAVE_WEAK_SYMBOLS
51 #pragma weak MPI_NEIGHBOR_ALLTOALLW = ompi_neighbor_alltoallw_f
52 #pragma weak mpi_neighbor_alltoallw = ompi_neighbor_alltoallw_f
53 #pragma weak mpi_neighbor_alltoallw_ = ompi_neighbor_alltoallw_f
54 #pragma weak mpi_neighbor_alltoallw__ = ompi_neighbor_alltoallw_f
55
56 #pragma weak MPI_Neighbor_alltoallw_f = ompi_neighbor_alltoallw_f
57 #pragma weak MPI_Neighbor_alltoallw_f08 = ompi_neighbor_alltoallw_f
58 #else
59 #if ! OMPI_BUILD_MPI_PROFILING
60 OMPI_GENERATE_F77_BINDINGS (MPI_NEIGHBOR_ALLTOALLW,
61 mpi_neighbor_alltoallw,
62 mpi_neighbor_alltoallw_,
63 mpi_neighbor_alltoallw__,
64 ompi_neighbor_alltoallw_f,
65 (char *sendbuf, MPI_Fint *sendcounts, MPI_Aint *sdispls, MPI_Fint *sendtypes, char *recvbuf, MPI_Fint *recvcounts, MPI_Aint *rdispls, MPI_Fint *recvtypes, MPI_Fint *comm, MPI_Fint *ierr),
66 (sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, ierr) )
67 #else
68 #define ompi_neighbor_alltoallw_f pompi_neighbor_alltoallw_f
69 #endif
70 #endif
71
72
73 void ompi_neighbor_alltoallw_f(char *sendbuf, MPI_Fint *sendcounts,
74 MPI_Aint *sdispls, MPI_Fint *sendtypes,
75 char *recvbuf, MPI_Fint *recvcounts,
76 MPI_Aint *rdispls, MPI_Fint *recvtypes,
77 MPI_Fint *comm, MPI_Fint *ierr)
78 {
79 MPI_Comm c_comm;
80 MPI_Datatype *c_sendtypes, *c_recvtypes;
81 int size, c_ierr;
82 OMPI_ARRAY_NAME_DECL(sendcounts);
83 OMPI_ARRAY_NAME_DECL(recvcounts);
84
85 c_comm = PMPI_Comm_f2c(*comm);
86 PMPI_Comm_size(c_comm, &size);
87
88 c_sendtypes = (MPI_Datatype *) malloc(size * sizeof(MPI_Datatype));
89 c_recvtypes = (MPI_Datatype *) malloc(size * sizeof(MPI_Datatype));
90
91 OMPI_ARRAY_FINT_2_INT(sendcounts, size);
92 OMPI_ARRAY_FINT_2_INT(recvcounts, size);
93
94 while (size > 0) {
95 c_sendtypes[size - 1] = PMPI_Type_f2c(sendtypes[size - 1]);
96 c_recvtypes[size - 1] = PMPI_Type_f2c(recvtypes[size - 1]);
97 --size;
98 }
99
100
101 sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
102 recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
103
104 c_ierr = PMPI_Neighbor_alltoallw(sendbuf,
105 OMPI_ARRAY_NAME_CONVERT(sendcounts),
106 sdispls,
107 c_sendtypes,
108 recvbuf,
109 OMPI_ARRAY_NAME_CONVERT(recvcounts),
110 rdispls,
111 c_recvtypes, c_comm);
112 if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
113
114 OMPI_ARRAY_FINT_2_INT_CLEANUP(sendcounts);
115 OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts);
116 free(c_sendtypes);
117 free(c_recvtypes);
118 }