This source file includes following definitions.
- MPI_Dist_graph_neighbors
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include "ompi_config.h"
19
20 #include "ompi/mpi/c/bindings.h"
21 #include "ompi/runtime/params.h"
22 #include "ompi/communicator/communicator.h"
23 #include "ompi/errhandler/errhandler.h"
24 #include "ompi/memchecker.h"
25 #include "ompi/mca/topo/topo.h"
26 #include "ompi/mca/topo/base/base.h"
27
28 #if OMPI_BUILD_MPI_PROFILING
29 #if OPAL_HAVE_WEAK_SYMBOLS
30 #pragma weak MPI_Dist_graph_neighbors = PMPI_Dist_graph_neighbors
31 #endif
32 #define MPI_Dist_graph_neighbors PMPI_Dist_graph_neighbors
33 #endif
34
35 static const char FUNC_NAME[] = "MPI_Dist_graph_neighbors";
36
37
38 int MPI_Dist_graph_neighbors(MPI_Comm comm, int maxindegree,
39 int sources[], int sourceweights[],
40 int maxoutdegree, int destinations[],
41 int destweights[])
42 {
43 int err;
44
45 MEMCHECKER(
46 memchecker_comm(comm);
47 );
48
49 if (MPI_PARAM_CHECK) {
50 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
51 if (ompi_comm_invalid(comm)) {
52 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
53 FUNC_NAME);
54 } else if (maxindegree < 0 || maxoutdegree < 0 ||
55 (maxindegree > 0 &&
56 (NULL == sources || NULL == sourceweights)) ||
57 (maxoutdegree > 0 &&
58 (NULL == destinations || NULL == destweights))) {
59 return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
60 }
61 }
62
63 if (!OMPI_COMM_IS_DIST_GRAPH(comm)) {
64 return OMPI_ERRHANDLER_INVOKE (comm, MPI_ERR_TOPOLOGY,
65 FUNC_NAME);
66 }
67
68 err = comm->c_topo->topo.dist_graph.dist_graph_neighbors(comm, maxindegree,
69 sources, sourceweights, maxoutdegree,
70 destinations, destweights);
71 OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
72 }
73