2008-01-23 12:20:34 +03:00
|
|
|
/*
|
2008-05-06 22:08:45 +04:00
|
|
|
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
2008-01-23 12:20:34 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* The carto framework suplies an information of the the host structure and connection between the
|
|
|
|
* host components i.e memory nodes,CPUs, Ethernet port and inifiniband ports.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OPAL_CARTO_H
|
|
|
|
#define OPAL_CARTO_H
|
|
|
|
|
|
|
|
#include "opal_config.h"
|
|
|
|
|
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
|
|
|
#include "opal/class/opal_graph.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* type for carto graph
|
|
|
|
*/
|
|
|
|
typedef opal_graph_t opal_carto_graph_t;
|
|
|
|
|
|
|
|
/* A structure of carto node */
|
|
|
|
struct opal_carto_base_node_t {
|
|
|
|
opal_graph_vertex_t *vertex; /* the parent of a node is a graph vertex */
|
|
|
|
char *node_name;
|
|
|
|
char *node_type; /* the type of the node */
|
|
|
|
bool is_cpu;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A definition of carto node type.
|
|
|
|
*/
|
|
|
|
typedef struct opal_carto_base_node_t opal_carto_base_node_t;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A structure of node distance from some other node
|
|
|
|
*/
|
|
|
|
struct opal_carto_node_distance_t {
|
|
|
|
opal_carto_base_node_t *node; /* The node */
|
|
|
|
uint32_t node_distance; /* and the distance */
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A definition of node distance type.
|
|
|
|
*/
|
|
|
|
typedef struct opal_carto_node_distance_t opal_carto_node_distance_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Module initialization function. Should return OPAL_SUCCESS.
|
|
|
|
*/
|
|
|
|
typedef int (*opal_carto_base_module_init_1_0_0_fn_t)(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the local host graph. you can reduce the graph for only
|
|
|
|
* the nodes that interst you using the node type.
|
|
|
|
*/
|
|
|
|
typedef int (*opal_carto_base_get_host_graph_fn_t)
|
2008-02-05 22:29:16 +03:00
|
|
|
(opal_carto_graph_t **graph, const char *graph_type);
|
2008-01-23 12:20:34 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Frre a graph
|
|
|
|
*/
|
|
|
|
typedef void (*opal_carto_base_free_graph_fn_t)
|
|
|
|
(opal_carto_graph_t *graph);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the distance (weight) from a start node to all other
|
|
|
|
* nodes. you can reduce the list to the list to the node types
|
|
|
|
* that intersts you.
|
|
|
|
*/
|
|
|
|
typedef int (*opal_carto_base_get_nodes_distance_fn_t)
|
2008-02-05 22:29:16 +03:00
|
|
|
(opal_carto_graph_t *graph, opal_carto_base_node_t *start, const char *node_type, opal_value_array_t *distance_);
|
2008-01-23 12:20:34 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* find the distance between two nodes.
|
|
|
|
*/
|
|
|
|
typedef 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);
|
|
|
|
|
2008-02-05 22:29:16 +03:00
|
|
|
/**
|
|
|
|
* Find a node in the graph
|
|
|
|
*/
|
2008-05-07 23:33:49 +04:00
|
|
|
typedef opal_carto_base_node_t *(*opal_carto_base_find_node_fn_t)
|
2008-02-05 22:29:16 +03:00
|
|
|
(opal_carto_graph_t *graph, const char *node_name);
|
|
|
|
|
2008-01-23 12:20:34 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Module finalize function. Invoked by the base on the selected
|
|
|
|
* module when the carto framework is being shut down.
|
|
|
|
*/
|
|
|
|
typedef int (*opal_carto_base_module_finalize_fn_t)(void);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2008-07-29 02:40:57 +04:00
|
|
|
* Structure for carto components.
|
2008-01-23 12:20:34 +03:00
|
|
|
*/
|
2008-07-29 02:40:57 +04:00
|
|
|
struct opal_carto_base_component_2_0_0_t {
|
2008-01-23 12:20:34 +03:00
|
|
|
/** MCA base component */
|
2008-05-06 22:08:45 +04:00
|
|
|
mca_base_component_t base_version;
|
2008-01-23 12:20:34 +03:00
|
|
|
/** MCA base data */
|
2008-07-29 02:40:57 +04:00
|
|
|
mca_base_component_data_t base_data;
|
2008-01-23 12:20:34 +03:00
|
|
|
};
|
|
|
|
/**
|
|
|
|
* Convenience typedef
|
|
|
|
*/
|
2008-07-29 02:40:57 +04:00
|
|
|
typedef struct opal_carto_base_component_2_0_0_t opal_carto_base_component_2_0_0_t;
|
|
|
|
typedef struct opal_carto_base_component_2_0_0_t opal_carto_base_component_t;
|
2008-01-23 12:20:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2008-07-29 02:40:57 +04:00
|
|
|
* Structure for carto modules
|
2008-01-23 12:20:34 +03:00
|
|
|
*/
|
|
|
|
struct opal_carto_base_module_1_0_0_t {
|
|
|
|
/** Module initialization function */
|
2008-05-07 23:33:49 +04:00
|
|
|
opal_carto_base_module_init_1_0_0_fn_t carto_module_init;
|
2008-01-23 12:20:34 +03:00
|
|
|
/** Get host graph */
|
2008-05-07 23:33:49 +04:00
|
|
|
opal_carto_base_get_host_graph_fn_t get_host_graph;
|
2008-01-23 12:20:34 +03:00
|
|
|
/** free graph */
|
2008-05-07 23:33:49 +04:00
|
|
|
opal_carto_base_free_graph_fn_t free_graph;
|
2008-01-23 12:20:34 +03:00
|
|
|
/** Get the distance from one node to all other nodes */
|
2008-05-07 23:33:49 +04:00
|
|
|
opal_carto_base_get_nodes_distance_fn_t get_nodes_distance;
|
2008-01-23 12:20:34 +03:00
|
|
|
/** Find the distance between two nodes */
|
2008-05-07 23:33:49 +04:00
|
|
|
opal_carto_base_spf_fn_t spf;
|
2008-02-05 22:29:16 +03:00
|
|
|
/** Find a node in the graph */
|
2008-05-07 23:33:49 +04:00
|
|
|
opal_carto_base_find_node_fn_t find_node;
|
2008-01-23 12:20:34 +03:00
|
|
|
/** Shut down this module */
|
2008-05-07 23:33:49 +04:00
|
|
|
opal_carto_base_module_finalize_fn_t carto_module_finalize;
|
2008-01-23 12:20:34 +03:00
|
|
|
};
|
|
|
|
/**
|
|
|
|
* Convenience typedef
|
|
|
|
*/
|
|
|
|
typedef struct opal_carto_base_module_1_0_0_t opal_carto_base_module_1_0_0_t;
|
2008-05-06 22:08:45 +04:00
|
|
|
typedef struct opal_carto_base_module_1_0_0_t opal_carto_base_module_t;
|
2008-01-23 12:20:34 +03:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
2008-07-29 02:40:57 +04:00
|
|
|
* Macro for use in components that are of type carto
|
2008-01-23 12:20:34 +03:00
|
|
|
*/
|
2008-07-29 02:40:57 +04:00
|
|
|
#define OPAL_CARTO_BASE_VERSION_2_0_0 \
|
|
|
|
MCA_BASE_VERSION_2_0_0, \
|
|
|
|
"carto", 2, 0, 0
|
2008-01-23 12:20:34 +03:00
|
|
|
|
|
|
|
#endif /* OPAL_CARTO_H */
|