This source file includes following definitions.
- MPIX_Neighbor_allgather_init
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
26
27 #include "ompi_config.h"
28 #include <stdio.h>
29
30 #include "ompi/mpi/c/bindings.h"
31 #include "ompi/runtime/params.h"
32 #include "ompi/communicator/communicator.h"
33 #include "ompi/errhandler/errhandler.h"
34 #include "ompi/datatype/ompi_datatype.h"
35 #include "ompi/memchecker.h"
36 #include "ompi/mca/topo/topo.h"
37 #include "ompi/mca/topo/base/base.h"
38 #include "ompi/runtime/ompi_spc.h"
39 #include "ompi/mpiext/pcollreq/c/mpiext_pcollreq_c.h"
40
41 #if OMPI_BUILD_MPI_PROFILING
42 #if OPAL_HAVE_WEAK_SYMBOLS
43 #pragma weak MPIX_Neighbor_allgather_init = PMPIX_Neighbor_allgather_init
44 #endif
45 #define MPIX_Neighbor_allgather_init PMPIX_Neighbor_allgather_init
46 #endif
47
48 static const char FUNC_NAME[] = "MPIX_Neighbor_allgather_init";
49
50
51 int MPIX_Neighbor_allgather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
52 void *recvbuf, int recvcount, MPI_Datatype recvtype,
53 MPI_Comm comm, MPI_Info info, MPI_Request *request)
54 {
55 int err;
56
57 SPC_RECORD(OMPI_SPC_NEIGHBOR_ALLGATHER_INIT, 1);
58
59 MEMCHECKER(
60 int rank;
61 ptrdiff_t ext;
62
63 rank = ompi_comm_rank(comm);
64 ompi_datatype_type_extent(recvtype, &ext);
65
66 memchecker_datatype(recvtype);
67 memchecker_comm(comm);
68
69 if (MPI_IN_PLACE != sendbuf) {
70 memchecker_datatype(sendtype);
71 memchecker_call(&opal_memchecker_base_isdefined, sendbuf, sendcount, sendtype);
72 }
73
74 memchecker_call(&opal_memchecker_base_isaddressable, recvbuf, recvcount, recvtype);
75 );
76
77 if (MPI_PARAM_CHECK) {
78
79
80
81
82 err = MPI_SUCCESS;
83 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
84 if (ompi_comm_invalid(comm) || OMPI_COMM_IS_INTER(comm)) {
85 OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
86 } else if (! OMPI_COMM_IS_TOPO(comm)) {
87 OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, FUNC_NAME);
88 } else if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
89 err = MPI_ERR_TYPE;
90 } else if (recvcount < 0) {
91 err = MPI_ERR_COUNT;
92 } else if (MPI_IN_PLACE == sendbuf || MPI_IN_PLACE == recvbuf) {
93 return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
94 } else {
95 OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
96 }
97 OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
98
99 if( OMPI_COMM_IS_CART(comm) ) {
100 const mca_topo_base_comm_cart_2_2_0_t *cart = comm->c_topo->mtc.cart;
101 if( 0 > cart->ndims ) {
102 return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
103 }
104 }
105 else if( OMPI_COMM_IS_GRAPH(comm) ) {
106 int degree;
107 mca_topo_base_graph_neighbors_count(comm, ompi_comm_rank(comm), °ree);
108 if( 0 > degree ) {
109 return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
110 }
111 }
112 else if( OMPI_COMM_IS_DIST_GRAPH(comm) ) {
113 const mca_topo_base_comm_dist_graph_2_2_0_t *dist_graph = comm->c_topo->mtc.dist_graph;
114 int indegree = dist_graph->indegree;
115 int outdegree = dist_graph->outdegree;
116 if( indegree < 0 || outdegree < 0 ) {
117 return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
118 }
119 }
120 }
121
122 OPAL_CR_ENTER_LIBRARY();
123
124
125 err = comm->c_coll->coll_neighbor_allgather_init(sendbuf, sendcount, sendtype, recvbuf,
126 recvcount, recvtype, comm, info, request,
127 comm->c_coll->coll_neighbor_allgather_init_module);
128
129 OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
130 }