This source file includes following definitions.
- ompix_allgatherv_init_f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #include "ompi_config.h"
23
24 #include "ompi/mpi/fortran/mpif-h/bindings.h"
25 #include "ompi/mpi/fortran/base/constants.h"
26 #include "ompi/mpiext/pcollreq/mpif-h/mpiext_pcollreq_prototypes.h"
27
28 #if OMPI_BUILD_MPI_PROFILING
29 #if OPAL_HAVE_WEAK_SYMBOLS
30 #pragma weak PMPIX_ALLGATHERV_INIT = ompix_allgatherv_init_f
31 #pragma weak pmpix_allgatherv_init = ompix_allgatherv_init_f
32 #pragma weak pmpix_allgatherv_init_ = ompix_allgatherv_init_f
33 #pragma weak pmpix_allgatherv_init__ = ompix_allgatherv_init_f
34
35 #pragma weak PMPIX_Allgatherv_init_f = ompix_allgatherv_init_f
36 #pragma weak PMPIX_Allgatherv_init_f08 = ompix_allgatherv_init_f
37 #else
38 OMPI_GENERATE_F77_BINDINGS (PMPIX_ALLGATHERV_INIT,
39 pmpix_allgatherv_init,
40 pmpix_allgatherv_init_,
41 pmpix_allgatherv_init__,
42 pompix_allgatherv_init_f,
43 (char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
44 (sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, info, request, ierr) )
45 #endif
46 #endif
47
48 #if OPAL_HAVE_WEAK_SYMBOLS
49 #pragma weak MPIX_ALLGATHERV_INIT = ompix_allgatherv_init_f
50 #pragma weak mpix_allgatherv_init = ompix_allgatherv_init_f
51 #pragma weak mpix_allgatherv_init_ = ompix_allgatherv_init_f
52 #pragma weak mpix_allgatherv_init__ = ompix_allgatherv_init_f
53
54 #pragma weak MPIX_Allgatherv_init_f = ompix_allgatherv_init_f
55 #pragma weak MPIX_Allgatherv_init_f08 = ompix_allgatherv_init_f
56 #else
57 #if ! OMPI_BUILD_MPI_PROFILING
58 OMPI_GENERATE_F77_BINDINGS (MPIX_ALLGATHERV_INIT,
59 mpix_allgatherv_init,
60 mpix_allgatherv_init_,
61 mpix_allgatherv_init__,
62 ompix_allgatherv_init_f,
63 (char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype, char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs, MPI_Fint *recvtype, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr),
64 (sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, info, request, ierr) )
65 #else
66 #define ompix_allgatherv_init_f pompix_allgatherv_init_f
67 #endif
68 #endif
69
70
71 void ompix_allgatherv_init_f(char *sendbuf, MPI_Fint *sendcount, MPI_Fint *sendtype,
72 char *recvbuf, MPI_Fint *recvcounts, MPI_Fint *displs,
73 MPI_Fint *recvtype, MPI_Fint *comm,
74 MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr)
75 {
76 MPI_Comm c_comm;
77 MPI_Datatype c_sendtype, c_recvtype;
78 MPI_Request c_request;
79 MPI_Info c_info;
80 int size, ierr_c;
81 OMPI_ARRAY_NAME_DECL(recvcounts);
82 OMPI_ARRAY_NAME_DECL(displs);
83
84 c_comm = PMPI_Comm_f2c(*comm);
85 c_sendtype = PMPI_Type_f2c(*sendtype);
86 c_recvtype = PMPI_Type_f2c(*recvtype);
87 c_info = PMPI_Info_f2c(*info);
88
89 PMPI_Comm_size(c_comm, &size);
90 OMPI_ARRAY_FINT_2_INT(recvcounts, size);
91 OMPI_ARRAY_FINT_2_INT(displs, size);
92
93 sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
94 sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
95 recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
96
97 ierr_c = PMPIX_Allgatherv_init(sendbuf,
98 OMPI_FINT_2_INT(*sendcount),
99 c_sendtype,
100 recvbuf,
101 OMPI_ARRAY_NAME_CONVERT(recvcounts),
102 OMPI_ARRAY_NAME_CONVERT(displs),
103 c_recvtype, c_comm, c_info, &c_request);
104
105 if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
106 if (MPI_SUCCESS == ierr_c) *request = PMPI_Request_c2f(c_request);
107
108 OMPI_ARRAY_FINT_2_INT_CLEANUP(recvcounts);
109 OMPI_ARRAY_FINT_2_INT_CLEANUP(displs);
110 }