2004-03-07 01:40:26 +03:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "ompi_config.h"
|
2004-03-07 01:40:26 +03:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2004-07-21 02:32:45 +04:00
|
|
|
#include "util/output.h"
|
|
|
|
#include "class/ompi_list.h"
|
2004-03-07 01:40:26 +03:00
|
|
|
#include "mca/mca.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mca/base/base.h"
|
|
|
|
#include "mca/topo/base/base.h"
|
2004-03-07 01:40:26 +03:00
|
|
|
|
|
|
|
/*
|
2004-08-02 04:24:22 +04:00
|
|
|
* The static-component.h is generated by the configure script. It contains
|
|
|
|
* statements and the definition of an array of pointers to each component's
|
|
|
|
* public mca_base_component_t struct.
|
2004-03-07 01:40:26 +03:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
#include "mca/topo/base/static-components.h"
|
2004-03-07 01:40:26 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Global variables
|
|
|
|
*/
|
|
|
|
int mca_topo_base_output = -1;
|
2004-07-21 02:32:45 +04:00
|
|
|
int mca_topo_base_param = -1;
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
ompi_list_t mca_topo_base_components_available;
|
|
|
|
ompi_list_t mca_topo_base_components_opened;
|
2004-07-21 02:32:45 +04:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_topo_base_component_t mca_topo_base_selected_component;
|
|
|
|
mca_topo_base_module_t mca_topo;
|
|
|
|
|
|
|
|
bool mca_topo_base_components_available_valid = false;
|
|
|
|
bool mca_topo_base_components_opened_valid = false;
|
2004-03-07 01:40:26 +03:00
|
|
|
|
2004-07-21 02:32:45 +04:00
|
|
|
|
2004-03-07 01:40:26 +03:00
|
|
|
/**
|
2004-08-02 04:24:22 +04:00
|
|
|
* Function for finding and opening either all the MCA topo components, or
|
2004-03-07 01:40:26 +03:00
|
|
|
* the one that specifically requested via a MCA parameter.
|
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
int mca_topo_base_open(void)
|
|
|
|
{
|
2004-07-21 02:32:45 +04:00
|
|
|
/* Open the topo framework output stream */
|
|
|
|
mca_topo_base_output = ompi_output_open(NULL);
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
/* Open up all available components */
|
2004-07-21 02:32:45 +04:00
|
|
|
if (OMPI_SUCCESS !=
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_base_components_open("topo", mca_topo_base_output,
|
|
|
|
mca_topo_base_static_components,
|
|
|
|
&mca_topo_base_components_opened)) {
|
2004-06-07 19:33:53 +04:00
|
|
|
return OMPI_ERROR;
|
2004-03-07 01:40:26 +03:00
|
|
|
}
|
2004-07-21 02:32:45 +04:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_topo_base_components_opened_valid = true;
|
2004-07-21 02:32:45 +04:00
|
|
|
|
|
|
|
/* Find the index of the "topo" param for selection */
|
|
|
|
mca_topo_base_param = mca_base_param_find("topo", "base", NULL);
|
|
|
|
|
|
|
|
/* All done */
|
2004-03-07 01:40:26 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
return OMPI_SUCCESS;
|
2004-03-07 01:40:26 +03:00
|
|
|
}
|