This source file includes following definitions.
- MPI_Graph_map
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 #include <stdio.h>
27
28 #include "ompi/mpi/c/bindings.h"
29 #include "ompi/runtime/params.h"
30 #include "ompi/communicator/communicator.h"
31 #include "ompi/errhandler/errhandler.h"
32 #include "ompi/mca/topo/topo.h"
33 #include "ompi/memchecker.h"
34
35 #if OMPI_BUILD_MPI_PROFILING
36 #if OPAL_HAVE_WEAK_SYMBOLS
37 #pragma weak MPI_Graph_map = PMPI_Graph_map
38 #endif
39 #define MPI_Graph_map PMPI_Graph_map
40 #endif
41
42 static const char FUNC_NAME[] = "MPI_Graph_map";
43
44
45 int MPI_Graph_map(MPI_Comm comm, int nnodes, const int indx[], const int edges[],
46 int *newrank)
47 {
48 int err = MPI_SUCCESS;
49
50 MEMCHECKER(
51 memchecker_comm(comm);
52 );
53
54
55 if (MPI_PARAM_CHECK) {
56 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
57 if (ompi_comm_invalid(comm)) {
58 return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
59 FUNC_NAME);
60 }
61 if (OMPI_COMM_IS_INTER(comm)) {
62 return OMPI_ERRHANDLER_INVOKE (comm, MPI_ERR_COMM,
63 FUNC_NAME);
64 }
65 if (1 > nnodes || NULL == indx || NULL == edges || NULL == newrank) {
66 return OMPI_ERRHANDLER_INVOKE (comm, MPI_ERR_ARG,
67 FUNC_NAME);
68 }
69 }
70
71 OPAL_CR_ENTER_LIBRARY();
72
73 if(!OMPI_COMM_IS_GRAPH(comm)) {
74
75
76
77 *newrank = ompi_comm_rank(comm);
78 } else {
79 err = comm->c_topo->topo.graph.graph_map(comm, nnodes, indx, edges, newrank);
80 }
81 OPAL_CR_EXIT_LIBRARY();
82
83 OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
84 }