1
1

Oops, this commit went to the wrong branch ...

This commit was SVN r1789.
Этот коммит содержится в:
Prabhanjan Kambadur 2004-07-20 22:35:54 +00:00
родитель a9b4d1ec62
Коммит ec7d5509e3
2 изменённых файлов: 61 добавлений и 42 удалений

Просмотреть файл

@ -11,6 +11,13 @@ DIST_SUBDIRS = base $(MCA_topo_ALL_SUBDIRS)
headers = topo.h headers = topo.h
noinst_LTLIBRARIES = libmca_topo.la
libmca_topo_la_SOURCES =
libmca_topo_la_LIBADD = \
base/libmca_topo_base.la \
$(MCA_topo_STATIC_LTLIBS)
libmca_topo_la_DEPENDENCIES = $(libmca_topo_la_LIBADD)
# Conditionally install the header files # Conditionally install the header files
if WANT_INSTALL_HEADERS if WANT_INSTALL_HEADERS

Просмотреть файл

@ -49,12 +49,17 @@
* *********** These functions go in the module struct ********** * *********** These functions go in the module struct **********
* **************** module struct ******************************* * **************** module struct *******************************
*/ */
typedef struct mca_topo_1_0_0_t * typedef int (*mca_topo_base_init_query_1_0_0_fn_t)
(*mca_topo_base_comm_query_1_0_0_fn_t)(int *priority, (bool *allow_multi_user_threads,
bool *allow_multi_user_threads,
bool *have_hidden_threads); bool *have_hidden_threads);
typedef int (*mca_topo_base_comm_finalize_1_0_0_fn_t) (void); typedef struct mca_topo_1_0_0_t*
(*mca_topo_base_comm_query_1_0_0_fn_t) (int *priority);
typedef int (*mca_topo_base_comm_unquery_1_0_0_fn_t)
(struct ompi_communicator_t *comm);
/* /*
* ****************** module struct ****************************** * ****************** module struct ******************************
* Structure for topo v1.0.0 modules.This is chained to MCA v1.0.0 * Structure for topo v1.0.0 modules.This is chained to MCA v1.0.0
@ -63,8 +68,9 @@ typedef int (*mca_topo_base_comm_finalize_1_0_0_fn_t) (void);
struct mca_topo_base_module_1_0_0_t { struct mca_topo_base_module_1_0_0_t {
mca_base_module_t topom_version; mca_base_module_t topom_version;
mca_base_module_data_1_0_0_t topom_data; mca_base_module_data_1_0_0_t topom_data;
mca_topo_base_comm_query_1_0_0_fn_t topom_query; mca_topo_base_init_query_1_0_0_fn_t topom_init_query;
mca_topo_base_comm_finalize_1_0_0_fn_t topom_finalize; mca_topo_base_comm_query_1_0_0_fn_t topom_comm_query;
mca_topo_base_comm_unquery_1_0_0_fn_t topom_comm_unquery;
}; };
typedef struct mca_topo_base_module_1_0_0_t mca_topo_base_module_1_0_0_t; typedef struct mca_topo_base_module_1_0_0_t mca_topo_base_module_1_0_0_t;
typedef mca_topo_base_module_1_0_0_t mca_topo_base_module_t; typedef mca_topo_base_module_1_0_0_t mca_topo_base_module_t;
@ -77,17 +83,34 @@ typedef mca_topo_base_module_1_0_0_t mca_topo_base_module_t;
/* /*
* ****************************************************************** * ******************************************************************
* *********************** information structure ****************** * *********************** information structure ******************
* Note for module authors:
* If you find that this is not the most convinient form of representing
* your topology, then please feel free to define your own structure in
* which this structure is the first element. That way, type casting can
* used to communicate between 2 different topo modules. Note that this
* representation must be filled up no matter what the actual topo
* structure might be
* ****************************************************************** * ******************************************************************
*/ */
struct mca_topo_comm_1_0_0_t { struct mca_topo_comm_1_0_0_t {
int mtc_type; /**< Topology type */
int mtc_nprocs; /**< Number of processes */ /* The first section represents data which is passed on to the
int mtc_ndims; /**< Number of cart dimensions */ * structure by the user when creating the topology. This info
int mtc_nedges; /**< Graph edges */ * is cached on so that if required another module can create the
int *mtc_dims; /**< Cart dimensions */ * topology again when comm_dup fails to pick the same module */
int *mtc_coords; /**< Cart coordinates */
int *mtc_index; /**< Graph indices */ int mtc_ndims_or_nnodes; /**< Number of cart dimensions */
int *mtc_edges; /**< Graph edges */ int *mtc_dims_or_index; /**< Cart dimensions */
int *mtc_periods_or_edges; /**< whether this was a periodic cart */
bool mtc_reorder; /**< Whether the re-ordering is allowed */
/* The second section is used by the unity module since it does not
* hang its own structure off the communicator. Any module which wishes
* to use the base/topo_base* functions to fill in their unimplemented
* functions should and must fill this portion up */
int *mtc_coords; /**< Cart coordinates */
}; };
typedef struct mca_topo_comm_1_0_0_t mca_topo_comm_1_0_0_t; typedef struct mca_topo_comm_1_0_0_t mca_topo_comm_1_0_0_t;
typedef mca_topo_comm_1_0_0_t mca_topo_comm_t; typedef mca_topo_comm_1_0_0_t mca_topo_comm_t;
@ -105,10 +128,11 @@ typedef mca_topo_comm_1_0_0_t mca_topo_comm_t;
* backend functions which will be used by the various topology modules * backend functions which will be used by the various topology modules
* *********************************************************************** * ***********************************************************************
*/ */
typedef int
typedef int (*mca_topo_base_init_1_0_0_fn_t) (*mca_topo_base_module_init_1_0_0_fn_t)(struct ompi_communicator_t *comm);
(MPI_Comm comm,
const struct mca_topo_1_0_0_t **new_topo); typedef int
(*mca_topo_base_module_finalize_1_0_0_fn_t)(struct ompi_communicator_t *comm);
typedef int (*mca_topo_base_cart_coords_fn_t) typedef int (*mca_topo_base_cart_coords_fn_t)
(MPI_Comm comm, (MPI_Comm comm,
@ -117,12 +141,14 @@ typedef int (*mca_topo_base_cart_coords_fn_t)
int *coords); int *coords);
typedef int (*mca_topo_base_cart_create_fn_t) typedef int (*mca_topo_base_cart_create_fn_t)
(MPI_Comm old_comm, (mca_topo_comm_t *topo_data,
int *proc_count,
ompi_proc_t **proc_pointers,
int *new_rank,
int ndims, int ndims,
int *dims, int *dims,
int *periods, int *periods,
int redorder, bool redorder);
MPI_Comm* comm_cart);
typedef int (*mca_topo_base_cart_get_fn_t) typedef int (*mca_topo_base_cart_get_fn_t)
(MPI_Comm comm, (MPI_Comm comm,
@ -160,12 +186,14 @@ typedef int (*mca_topo_base_cart_sub_fn_t)
MPI_Comm* new_comm); MPI_Comm* new_comm);
typedef int (*mca_topo_base_graph_create_fn_t) typedef int (*mca_topo_base_graph_create_fn_t)
(MPI_Comm comm_old, (mca_topo_comm_t *topo_data,
int *proc_count,
ompi_proc_t **proc_pointers,
int *new_rank,
int nnodes, int nnodes,
int *index, int *index,
int *edges, int *edges,
int reorder, bool reorder);
MPI_Comm* comm_graph);
typedef int (*mca_topo_base_graph_get_fn_t) typedef int (*mca_topo_base_graph_get_fn_t)
(MPI_Comm comm, (MPI_Comm comm,
@ -214,7 +242,8 @@ struct mca_topo_1_0_0_t {
* on the module which is selected. The finalize corresponding to * on the module which is selected. The finalize corresponding to
* this function is present on the module struct above * this function is present on the module struct above
*/ */
mca_topo_base_init_1_0_0_fn_t topo_init; mca_topo_base_module_init_1_0_0_fn_t topo_module_init;
mca_topo_base_module_finalize_1_0_0_fn_t topo_module_finalize;
/* Graph related functions */ /* Graph related functions */
mca_topo_base_cart_coords_fn_t topo_cart_coords; mca_topo_base_cart_coords_fn_t topo_cart_coords;
@ -241,21 +270,4 @@ typedef mca_topo_1_0_0_t mca_topo_t;
*/ */
/*
* This function is technically part of the unity module, but since it
* ships with OMPI, and other modules may use the unity module for
* query/init functionality, prototype this function here.
*/
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
const mca_topo_1_0_0_t *
mca_topo_unity_comm_query(int *priority,
bool *allow_multi_user_threads,
bool *have_hidden_threads);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* MCA_TOPO_H */ #endif /* MCA_TOPO_H */