OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

carto.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2005 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
13 * $COPYRIGHT$
14 *
15 * Additional copyrights may follow
16 *
17 * $HEADER$
18 */
19 /**
20 * @file
21 *
22 * The carto framework suplies an information of the the host structure and connection between the
23 * host components i.e memory nodes,CPUs, Ethernet port and inifiniband ports.
24 */
25
26 #ifndef OPAL_CARTO_H
27 #define OPAL_CARTO_H
28
29 #include "opal_config.h"
30
31 #include "opal/mca/mca.h"
32 #include "opal/mca/base/base.h"
33 #include "opal/class/opal_graph.h"
34
35 /**
36 * type for carto graph
37 */
38 typedef opal_graph_t opal_carto_graph_t;
39
40 /* A structure of carto node */
41 struct opal_carto_base_node_t {
42 opal_graph_vertex_t *vertex; /* the parent of a node is a graph vertex */
43 char *node_name;
44 char *node_type; /* the type of the node */
45 bool is_cpu;
46 };
47
48 /**
49 * A definition of carto node type.
50 */
51 typedef struct opal_carto_base_node_t opal_carto_base_node_t;
52
53
54 /**
55 * A structure of node distance from some other node
56 */
57 struct opal_carto_node_distance_t {
58 opal_carto_base_node_t *node; /* The node */
59 uint32_t node_distance; /* and the distance */
60 };
61
62 /**
63 * A definition of node distance type.
64 */
65 typedef struct opal_carto_node_distance_t opal_carto_node_distance_t;
66
67
68
69 /**
70 * Module initialization function. Should return OPAL_SUCCESS.
71 */
72 typedef int (*opal_carto_base_module_init_1_0_0_fn_t)(void);
73
74 /**
75 * Get the local host graph. you can reduce the graph for only
76 * the nodes that interst you using the node type.
77 */
78 typedef int (*opal_carto_base_get_host_graph_fn_t)
79 (opal_carto_graph_t **graph, const char *graph_type);
80
81 /**
82 * Frre a graph
83 */
84 typedef void (*opal_carto_base_free_graph_fn_t)
85 (opal_carto_graph_t *graph);
86
87 /**
88 * Get the distance (weight) from a start node to all other
89 * nodes. you can reduce the list to the list to the node types
90 * that intersts you.
91 */
92 typedef int (*opal_carto_base_get_nodes_distance_fn_t)
93 (opal_carto_graph_t *graph, opal_carto_base_node_t *start, const char *node_type, opal_value_array_t *distance_);
94
95 /**
96 * find the distance between two nodes.
97 */
98 typedef uint32_t (*opal_carto_base_spf_fn_t)
99 (opal_carto_graph_t *graph,opal_carto_base_node_t *start, opal_carto_base_node_t *end);
100
101 /**
102 * Find a node in the graph
103 */
104 typedef opal_carto_base_node_t *(*opal_carto_base_find_node_fn_t)
105 (opal_carto_graph_t *graph, const char *node_name);
106
107
108 /**
109 * Module finalize function. Invoked by the base on the selected
110 * module when the carto framework is being shut down.
111 */
112 typedef int (*opal_carto_base_module_finalize_fn_t)(void);
113
114
115 /**
116 * Structure for carto components.
117 */
118 struct opal_carto_base_component_2_0_0_t {
119 /** MCA base component */
120 mca_base_component_t base_version;
121 /** MCA base data */
122 mca_base_component_data_t base_data;
123 };
124 /**
125 * Convenience typedef
126 */
127 typedef struct opal_carto_base_component_2_0_0_t opal_carto_base_component_2_0_0_t;
128 typedef struct opal_carto_base_component_2_0_0_t opal_carto_base_component_t;
129
130
131 /**
132 * Structure for carto modules
133 */
134 struct opal_carto_base_module_1_0_0_t {
135 /** Module initialization function */
136 opal_carto_base_module_init_1_0_0_fn_t carto_module_init;
137 /** Get host graph */
138 opal_carto_base_get_host_graph_fn_t get_host_graph;
139 /** free graph */
140 opal_carto_base_free_graph_fn_t free_graph;
141 /** Get the distance from one node to all other nodes */
142 opal_carto_base_get_nodes_distance_fn_t get_nodes_distance;
143 /** Find the distance between two nodes */
144 opal_carto_base_spf_fn_t spf;
145 /** Find a node in the graph */
146 opal_carto_base_find_node_fn_t find_node;
147 /** Shut down this module */
148 opal_carto_base_module_finalize_fn_t carto_module_finalize;
149 };
150 /**
151 * Convenience typedef
152 */
153 typedef struct opal_carto_base_module_1_0_0_t opal_carto_base_module_1_0_0_t;
154 typedef struct opal_carto_base_module_1_0_0_t opal_carto_base_module_t;
155
156
157 /*
158 * Macro for use in components that are of type carto
159 */
160 #define OPAL_CARTO_BASE_VERSION_2_0_0 \
161 MCA_BASE_VERSION_2_0_0, \
162 "carto", 2, 0, 0
163
164 #endif /* OPAL_CARTO_H */
opal_carto_base_module_finalize_fn_t
int(* opal_carto_base_module_finalize_fn_t)(void)
Module finalize function.
Definition: carto.h:112
opal_carto_base_component_2_0_0_t::base_version
mca_base_component_t base_version
MCA base component.
Definition: carto.h:120
opal_carto_base_get_host_graph_fn_t
int(* opal_carto_base_get_host_graph_fn_t)(opal_carto_graph_t **graph, const char *graph_type)
Get the local host graph.
Definition: carto.h:79
mca_base_component_2_0_0_t
Common type for all MCA components.
Definition: mca.h:250
opal_carto_base_find_node_fn_t
opal_carto_base_node_t *(* opal_carto_base_find_node_fn_t)(opal_carto_graph_t *graph, const char *node_name)
Find a node in the graph.
Definition: carto.h:105
opal_carto_base_module_1_0_0_t::carto_module_finalize
opal_carto_base_module_finalize_fn_t carto_module_finalize
Shut down this module.
Definition: carto.h:148
opal_carto_base_module_1_0_0_t::free_graph
opal_carto_base_free_graph_fn_t free_graph
free graph
Definition: carto.h:140
opal_carto_base_free_graph_fn_t
void(* opal_carto_base_free_graph_fn_t)(opal_carto_graph_t *graph)
Frre a graph.
Definition: carto.h:85
opal_carto_base_module_1_0_0_t::get_nodes_distance
opal_carto_base_get_nodes_distance_fn_t get_nodes_distance
Get the distance from one node to all other nodes.
Definition: carto.h:142
opal_carto_base_module_init_1_0_0_fn_t
int(* opal_carto_base_module_init_1_0_0_fn_t)(void)
Module initialization function.
Definition: carto.h:72
opal_carto_base_component_2_0_0_t
Structure for carto components.
Definition: carto.h:118
mca.h
Top-level interface for all MCA components.
opal_graph_vertex_t
A vertex class.
Definition: opal_graph.h:104
opal_carto_base_module_1_0_0_t::get_host_graph
opal_carto_base_get_host_graph_fn_t get_host_graph
Get host graph.
Definition: carto.h:138
opal_carto_graph_t
opal_graph_t opal_carto_graph_t
type for carto graph
Definition: carto.h:38
opal_carto_base_module_1_0_0_t::find_node
opal_carto_base_find_node_fn_t find_node
Find a node in the graph.
Definition: carto.h:146
opal_graph_t
A graph class.
Definition: opal_graph.h:165
mca_base_component_data_2_0_0_t
Meta data for MCA v2.0.0 components.
Definition: mca.h:309
opal_carto_node_distance_t
A structure of node distance from some other node.
Definition: carto.h:57
opal_graph.h
The opal_graph interface is used to provide a generic graph infrastructure to Open-MPI.
opal_carto_base_node_t
Definition: carto.h:41
opal_carto_base_get_nodes_distance_fn_t
int(* opal_carto_base_get_nodes_distance_fn_t)(opal_carto_graph_t *graph, opal_carto_base_node_t *start, const char *node_type, opal_value_array_t *distance_)
Get the distance (weight) from a start node to all other nodes.
Definition: carto.h:93
opal_value_array_t
Definition: opal_value_array.h:38
opal_carto_base_module_1_0_0_t::carto_module_init
opal_carto_base_module_init_1_0_0_fn_t carto_module_init
Module initialization function.
Definition: carto.h:136
opal_carto_base_module_1_0_0_t::spf
opal_carto_base_spf_fn_t spf
Find the distance between two nodes.
Definition: carto.h:144
opal_carto_base_component_2_0_0_t::base_data
mca_base_component_data_t base_data
MCA base data.
Definition: carto.h:122
opal_carto_base_module_1_0_0_t
Structure for carto modules.
Definition: carto.h:134
opal_carto_base_spf_fn_t
uint32_t(* opal_carto_base_spf_fn_t)(opal_carto_graph_t *graph, opal_carto_base_node_t *start, opal_carto_base_node_t *end)
find the distance between two nodes.
Definition: carto.h:99