This source file includes following definitions.
- ompi_neighbor_alltoallv_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_ALLTOALLV = ompi_neighbor_alltoallv_f
33 #pragma weak pmpi_neighbor_alltoallv = ompi_neighbor_alltoallv_f
34 #pragma weak pmpi_neighbor_alltoallv_ = ompi_neighbor_alltoallv_f
35 #pragma weak pmpi_neighbor_alltoallv__ = ompi_neighbor_alltoallv_f
36
37 #pragma weak PMPI_Neighbor_alltoallv_f = ompi_neighbor_alltoallv_f
38 #pragma weak PMPI_Neighbor_alltoallv_f08 = ompi_neighbor_alltoallv_f
39 #else
40 OMPI_GENERATE_F77_BINDINGS (PMPI_NEIGHBOR_ALLTOALLV,
41 pmpi_neighbor_alltoallv,
42 pmpi_neighbor_alltoallv_,
43 pmpi_neighbor_alltoallv__,
44 pompi_neighbor_alltoallv_f,
45 (char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *sdispls, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *rdispls, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr),
46 (sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm, ierr) )
47 #endif
48 #endif
49
50 #if OPAL_HAVE_WEAK_SYMBOLS
51 #pragma weak MPI_NEIGHBOR_ALLTOALLV = ompi_neighbor_alltoallv_f
52 #pragma weak mpi_neighbor_alltoallv = ompi_neighbor_alltoallv_f
53 #pragma weak mpi_neighbor_alltoallv_ = ompi_neighbor_alltoallv_f
54 #pragma weak mpi_neighbor_alltoallv__ = ompi_neighbor_alltoallv_f
55
56 #pragma weak MPI_Neighbor_alltoallv_f = ompi_neighbor_alltoallv_f
57 #pragma weak MPI_Neighbor_alltoallv_f08 = ompi_neighbor_alltoallv_f
58 #else
59 #if ! OMPI_BUILD_MPI_PROFILING
60 OMPI_GENERATE_F77_BINDINGS (MPI_NEIGHBOR_ALLTOALLV,
61 mpi_neighbor_alltoallv,
62 mpi_neighbor_alltoallv_,
63 mpi_neighbor_alltoallv__,
64 ompi_neighbor_alltoallv_f,
65 (char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *sdispls, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *rdispls, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *ierr),
66 (sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm, ierr) )
67 #else
68 #define ompi_neighbor_alltoallv_f pompi_neighbor_alltoallv_f
69 #endif
70 #endif
71
72
73 void ompi_neighbor_alltoallv_f(char *sendbuf, MPI_Fint *sendcounts, MPI_Fint *sdispls,
74 MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts,
75 MPI_Fint *rdispls, MPI_Fint *recvtype,
76 MPI_Fint *comm, MPI_Fint *ierr)
77 {
78 MPI_Comm c_comm;
79 MPI_Datatype c_sendtype, c_recvtype;
80 int size, c_ierr;
81 OMPI_ARRAY_NAME_DECL(sendcounts);
82 OMPI_ARRAY_NAME_DECL(sdispls);
83 OMPI_ARRAY_NAME_DECL(recvcounts);
84 OMPI_ARRAY_NAME_DECL(rdispls);
85
86 c_comm = PMPI_Comm_f2c(*comm);
87 c_sendtype = PMPI_Type_f2c(*sendtype);
88 c_recvtype = PMPI_Type_f2c(*recvtype);
89
90 PMPI_Comm_size(c_comm, &size);
91 OMPI_ARRAY_FINT_2_INT(sendcounts, size);
92 OMPI_ARRAY_FINT_2_INT(sdispls, size);
93 OMPI_ARRAY_FINT_2_INT(recvcounts, size);
94 OMPI_ARRAY_FINT_2_INT(rdispls, size);
95
96 sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
97 sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
98 recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
99
100 c_ierr = PMPI_Neighbor_alltoallv(sendbuf,
101 OMPI_ARRAY_NAME_CONVERT(sendcounts),
102 OMPI_ARRAY_NAME_CONVERT(sdispls),
103 c_sendtype,
104 recvbuf,
105 OMPI_ARRAY_NAME_CONVERT(recvcounts),
106 OMPI_ARRAY_NAME_CONVERT(rdispls),
107 c_recvtype, c_comm);
108 if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
109
110 OMPI_ARRAY_FINT_2_INT_CLEANUP(sendcounts);
111 OMPI_ARRAY_FINT_2_INT_CLEANUP(sdispls);
112 OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts);
113 OMPI_ARRAY_FINT_2_INT_CLEANUP(rdispls);
114 }