|
15 | 15 | * reserved. |
16 | 16 | * Copyright (c) 2014-2015 Research Organization for Information Science |
17 | 17 | * and Technology (RIST). All rights reserved. |
| 18 | + * Copyright (c) 2017 IBM Corporation. All rights reserved. |
18 | 19 | * $COPYRIGHT$ |
19 | 20 | * |
20 | 21 | * Additional copyrights may follow |
|
32 | 33 | #include "ompi/errhandler/errhandler.h" |
33 | 34 | #include "ompi/datatype/ompi_datatype.h" |
34 | 35 | #include "ompi/memchecker.h" |
| 36 | +#include "ompi/mca/topo/topo.h" |
| 37 | +#include "ompi/mca/topo/base/base.h" |
35 | 38 |
|
36 | 39 | #if OMPI_BUILD_MPI_PROFILING |
37 | 40 | #if OPAL_HAVE_WEAK_SYMBOLS |
@@ -110,6 +113,28 @@ int MPI_Ineighbor_alltoallw(const void *sendbuf, const int sendcounts[], const M |
110 | 113 | OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtypes[i], recvcounts[i]); |
111 | 114 | OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME); |
112 | 115 | } |
| 116 | + |
| 117 | + if( OMPI_COMM_IS_CART(comm) ) { |
| 118 | + const mca_topo_base_comm_cart_2_2_0_t *cart = comm->c_topo->mtc.cart; |
| 119 | + if( 0 > cart->ndims ) { |
| 120 | + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); |
| 121 | + } |
| 122 | + } |
| 123 | + else if( OMPI_COMM_IS_GRAPH(comm) ) { |
| 124 | + int degree; |
| 125 | + mca_topo_base_graph_neighbors_count(comm, ompi_comm_rank(comm), °ree); |
| 126 | + if( 0 > degree ) { |
| 127 | + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); |
| 128 | + } |
| 129 | + } |
| 130 | + else if( OMPI_COMM_IS_DIST_GRAPH(comm) ) { |
| 131 | + const mca_topo_base_comm_dist_graph_2_2_0_t *dist_graph = comm->c_topo->mtc.dist_graph; |
| 132 | + indegree = dist_graph->indegree; |
| 133 | + outdegree = dist_graph->outdegree; |
| 134 | + if( indegree < 0 || outdegree < 0 ) { |
| 135 | + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); |
| 136 | + } |
| 137 | + } |
113 | 138 | } |
114 | 139 |
|
115 | 140 | /* Invoke the coll component to perform the back-end operation */ |
|
0 commit comments