OpenMPI  0.1.1
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  */
39 
40 /* A structure of carto node */
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  */
52 
53 
54 /**
55  * A structure of node distance from some other node
56  */
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  */
66 
67 
68 
69 /**
70  * Module initialization function. Should return OPAL_SUCCESS.
71  */
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  */
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)
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  */
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)
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  */
113 
114 
115 /**
116  * Structure for carto components.
117  */
119  /** MCA base component */
121  /** MCA base data */
123 };
124 /**
125  * Convenience typedef
126  */
129 
130 
131 /**
132  * Structure for carto modules
133  */
135  /** Module initialization function */
137  /** Get host graph */
139  /** free graph */
141  /** Get the distance from one node to all other nodes */
143  /** Find the distance between two nodes */
145  /** Find a node in the graph */
147  /** Shut down this module */
149 };
150 /**
151  * Convenience typedef
152  */
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 */
int(* opal_carto_base_module_finalize_fn_t)(void)
Module finalize function.
Definition: carto.h:112
mca_base_component_t base_version
MCA base component.
Definition: carto.h:120
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
Common type for all MCA components.
Definition: mca.h:250
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_finalize_fn_t carto_module_finalize
Shut down this module.
Definition: carto.h:148
opal_carto_base_free_graph_fn_t free_graph
free graph
Definition: carto.h:140
void(* opal_carto_base_free_graph_fn_t)(opal_carto_graph_t *graph)
Frre a graph.
Definition: carto.h:85
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
int(* opal_carto_base_module_init_1_0_0_fn_t)(void)
Module initialization function.
Definition: carto.h:72
Structure for carto components.
Definition: carto.h:118
Top-level interface for all MCA components.
A vertex class.
Definition: opal_graph.h:104
opal_carto_base_get_host_graph_fn_t get_host_graph
Get host graph.
Definition: carto.h:138
opal_graph_t opal_carto_graph_t
type for carto graph
Definition: carto.h:38
opal_carto_base_find_node_fn_t find_node
Find a node in the graph.
Definition: carto.h:146
A graph class.
Definition: opal_graph.h:165
Meta data for MCA v2.0.0 components.
Definition: mca.h:309
A structure of node distance from some other node.
Definition: carto.h:57
The opal_graph interface is used to provide a generic graph infrastructure to Open-MPI.
Definition: carto.h:41
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
Definition: opal_value_array.h:38
opal_carto_base_module_init_1_0_0_fn_t carto_module_init
Module initialization function.
Definition: carto.h:136
opal_carto_base_spf_fn_t spf
Find the distance between two nodes.
Definition: carto.h:144
mca_base_component_data_t base_data
MCA base data.
Definition: carto.h:122
Structure for carto modules.
Definition: carto.h:134
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