This source file includes following definitions.
- init_query
- comm_query
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include "ompi_config.h"
25 #include "ompi/mca/topo/example/topo_example.h"
26
27
28
29
30 const char *mca_topo_example_component_version_string =
31 "Open MPI example topology MCA component version" OMPI_VERSION;
32
33
34
35
36 static int init_query(bool enable_progress_threads, bool enable_mpi_threads);
37 static struct mca_topo_base_module_t *
38 comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type);
39
40
41
42
43 mca_topo_base_component_2_2_0_t mca_topo_example_component =
44 {
45 .topoc_version = {
46 MCA_TOPO_BASE_VERSION_2_2_0,
47
48 .mca_component_name = "example",
49 MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
50 OMPI_RELEASE_VERSION),
51
52 },
53
54 .topoc_data = {
55
56 MCA_BASE_METADATA_PARAM_CHECKPOINT
57 },
58
59 .topoc_init_query = init_query,
60 .topoc_comm_query = comm_query,
61 };
62
63
64 static int init_query(bool enable_progress_threads, bool enable_mpi_threads)
65 {
66
67
68 return OMPI_SUCCESS;
69 }
70
71
72 static struct mca_topo_base_module_t *
73 comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type)
74 {
75 mca_topo_example_module_t *example = OBJ_NEW(mca_topo_example_module_t);
76 if (NULL == example) {
77 return NULL;
78 }
79 if( OMPI_COMM_CART == type ) {
80 example->super.topo.cart.cart_map = mca_topo_example_cart_map;
81 } else if( OMPI_COMM_GRAPH == type ) {
82 example->super.topo.graph.graph_map = mca_topo_example_graph_map;
83 }
84
85
86 *priority = 0;
87 example->super.type = type;
88 return &(example->super);
89 }
90
91