2004-01-19 17:43:50 +00:00
|
|
|
//
|
|
|
|
// $HEADER$
|
|
|
|
//
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#include "ompi_config.h"
|
2004-01-19 17:43:50 +00:00
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2004-03-17 18:45:16 +00:00
|
|
|
#include "mca/base/base.h"
|
2004-07-11 04:35:31 +00:00
|
|
|
#include "mca/allocator/allocator.h"
|
|
|
|
#include "mca/allocator/base/base.h"
|
|
|
|
#include "mca/mpool/mpool.h"
|
|
|
|
#include "mca/mpool/base/base.h"
|
2004-08-08 13:03:32 +00:00
|
|
|
#include "mca/llm/llm.h"
|
|
|
|
#include "mca/llm/base/base.h"
|
2004-03-17 18:45:16 +00:00
|
|
|
#include "mca/pcm/pcm.h"
|
|
|
|
#include "mca/pcm/base/base.h"
|
|
|
|
#include "mca/oob/oob.h"
|
|
|
|
#include "mca/oob/base/base.h"
|
|
|
|
#include "mca/pml/pml.h"
|
|
|
|
#include "mca/pml/base/base.h"
|
|
|
|
#include "mca/ptl/ptl.h"
|
|
|
|
#include "mca/ptl/base/base.h"
|
|
|
|
#include "mca/coll/coll.h"
|
|
|
|
#include "mca/coll/base/base.h"
|
2004-07-11 04:35:31 +00:00
|
|
|
#include "mca/ns/ns.h"
|
|
|
|
#include "mca/ns/base/base.h"
|
2004-07-26 13:04:32 +00:00
|
|
|
#include "mca/topo/topo.h"
|
|
|
|
#include "mca/topo/base/base.h"
|
2004-06-07 15:33:53 +00:00
|
|
|
#include "tools/ompi_info/ompi_info.h"
|
2004-01-19 17:43:50 +00:00
|
|
|
|
|
|
|
using namespace std;
|
2004-06-07 15:33:53 +00:00
|
|
|
using namespace ompi_info;
|
2004-01-19 17:43:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Public variables
|
|
|
|
//
|
|
|
|
|
2004-07-13 20:25:12 +00:00
|
|
|
ompi_info::component_map_t ompi_info::component_map;
|
2004-01-19 17:43:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Private variables
|
|
|
|
//
|
|
|
|
|
2004-07-13 20:25:12 +00:00
|
|
|
static bool opened_components = false;
|
2004-01-19 17:43:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
//
|
2004-07-13 20:25:12 +00:00
|
|
|
// Open all MCA components so that they can register their MCA
|
2004-01-19 17:43:50 +00:00
|
|
|
// parameters. Take a shotgun approach here and indiscriminately open
|
2004-07-13 20:25:12 +00:00
|
|
|
// all components -- don't be selective. To this end, we need to clear
|
2004-06-07 15:33:53 +00:00
|
|
|
// out the environment of all OMPI_MPI_mca_<type> variables to ensure
|
2004-07-13 20:25:12 +00:00
|
|
|
// that the open algorithms don't try to only open one component.
|
2004-01-19 17:43:50 +00:00
|
|
|
//
|
2004-07-13 20:25:12 +00:00
|
|
|
void ompi_info::open_components()
|
2004-01-19 17:43:50 +00:00
|
|
|
{
|
2004-06-07 15:33:53 +00:00
|
|
|
ompi_info::type_vector_t::size_type i;
|
2004-01-19 17:43:50 +00:00
|
|
|
string env;
|
|
|
|
char *target;
|
|
|
|
|
2004-07-13 20:25:12 +00:00
|
|
|
if (opened_components)
|
2004-01-19 17:43:50 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
// Clear out the environment. Use strdup() to orphan the resulting
|
|
|
|
// strings because items are placed in the environment by reference,
|
|
|
|
// not by value.
|
|
|
|
|
|
|
|
for (i = 0; i < mca_types.size(); ++i) {
|
2004-06-07 15:33:53 +00:00
|
|
|
env = "OMPI_MPI_MCA_" + mca_types[i];
|
2004-01-19 17:43:50 +00:00
|
|
|
if (NULL != getenv(env.c_str())) {
|
|
|
|
env += "=";
|
|
|
|
target = strdup(env.c_str());
|
|
|
|
putenv(target);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-11 04:35:31 +00:00
|
|
|
// Find / open all components
|
2004-01-19 17:43:50 +00:00
|
|
|
|
|
|
|
mca_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["base"] = NULL;
|
2004-01-19 17:43:50 +00:00
|
|
|
|
2004-07-11 04:35:31 +00:00
|
|
|
mca_allocator_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["allocator"] = &mca_allocator_base_components;
|
2004-01-19 17:43:50 +00:00
|
|
|
|
2004-01-29 02:51:20 +00:00
|
|
|
mca_coll_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["coll"] = &mca_coll_base_components_opened;
|
2004-01-19 17:43:50 +00:00
|
|
|
|
2004-07-11 04:35:31 +00:00
|
|
|
#if 0
|
|
|
|
// common component framework not implemented yet
|
|
|
|
mca_common_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["common"] = &mca_common_base_components_opened;
|
2004-07-11 04:35:31 +00:00
|
|
|
#else
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["common"] = NULL;
|
2004-07-11 04:35:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
// waiting for gpr to be implemented
|
|
|
|
mca_gpr_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["gpr"] = &mca_ns_base_components_available;
|
2004-07-11 04:35:31 +00:00
|
|
|
#else
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["gpr"] = NULL;
|
2004-07-11 04:35:31 +00:00
|
|
|
#endif
|
|
|
|
|
2004-08-08 13:03:32 +00:00
|
|
|
mca_llm_base_open();
|
|
|
|
component_map["llm"] = &mca_llm_base_components_available;
|
|
|
|
|
2004-01-19 17:43:50 +00:00
|
|
|
#if 0
|
2004-07-13 20:25:12 +00:00
|
|
|
// io component opening not implemented yet
|
2004-01-29 02:51:20 +00:00
|
|
|
mca_io_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["io"] = &mca_io_base_components_available;
|
2004-02-13 22:17:42 +00:00
|
|
|
#else
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["io"] = NULL;
|
2004-01-19 17:43:50 +00:00
|
|
|
#endif
|
|
|
|
|
2004-07-11 04:35:31 +00:00
|
|
|
mca_ns_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["ns"] = &mca_ns_base_components_available;
|
2004-07-11 04:35:31 +00:00
|
|
|
|
|
|
|
mca_mpool_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["mpool"] = &mca_mpool_base_components;
|
2004-07-11 04:35:31 +00:00
|
|
|
|
2004-01-19 17:43:50 +00:00
|
|
|
#if 0
|
2004-07-13 20:25:12 +00:00
|
|
|
// one component opening not implemented yet
|
2004-01-29 02:51:20 +00:00
|
|
|
mca_one_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["one"] = &mca_one_base_components_available;
|
2004-02-13 22:17:42 +00:00
|
|
|
#else
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["one"] = NULL;
|
2004-01-19 17:43:50 +00:00
|
|
|
#endif
|
|
|
|
|
2004-07-11 04:35:31 +00:00
|
|
|
mca_oob_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["oob"] = &mca_oob_base_components;
|
2004-07-11 04:35:31 +00:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
// op component framework not yet implemented
|
|
|
|
mca_op_base_open();
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["op"] = &mca_oob_base_components;
|
2004-07-11 04:35:31 +00:00
|
|
|
#else
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map["op"] = NULL;
|
2004-07-11 04:35:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
mca_pcm_base_open();
|
2004-08-02 00:24:22 +00:00
|
|
|
component_map["pcm"] = &mca_pcm_base_components_available;
|
2004-07-11 04:35:31 +00:00
|
|
|
|
2004-01-29 02:51:20 +00:00
|
|
|
mca_pml_base_open();
|
2004-08-02 00:24:22 +00:00
|
|
|
component_map["pml"] = &mca_pml_base_components_available;
|
2004-01-19 17:43:50 +00:00
|
|
|
|
2004-01-29 02:51:20 +00:00
|
|
|
mca_ptl_base_open();
|
2004-08-02 00:24:22 +00:00
|
|
|
component_map["ptl"] = &mca_ptl_base_components_available;
|
2004-01-19 17:43:50 +00:00
|
|
|
|
2004-01-29 02:51:20 +00:00
|
|
|
mca_topo_base_open();
|
2004-08-02 00:24:22 +00:00
|
|
|
component_map["topo"] = &mca_topo_base_components_opened;
|
2004-01-19 17:43:50 +00:00
|
|
|
|
|
|
|
// All done
|
|
|
|
|
2004-07-13 20:25:12 +00:00
|
|
|
opened_components = true;
|
2004-01-19 17:43:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-07-13 20:25:12 +00:00
|
|
|
void ompi_info::close_components()
|
2004-01-19 17:43:50 +00:00
|
|
|
{
|
2004-07-13 20:25:12 +00:00
|
|
|
if (opened_components) {
|
2004-01-22 00:38:29 +00:00
|
|
|
mca_pcm_base_close();
|
2004-01-31 21:48:58 +00:00
|
|
|
mca_oob_base_close();
|
2004-07-11 04:35:31 +00:00
|
|
|
mca_ns_base_close();
|
2004-01-30 03:59:17 +00:00
|
|
|
mca_coll_base_close();
|
2004-01-19 17:43:50 +00:00
|
|
|
mca_pml_base_close();
|
2004-01-31 21:48:58 +00:00
|
|
|
mca_ptl_base_close();
|
2004-08-08 13:07:20 +00:00
|
|
|
mca_topo_base_close();
|
|
|
|
mca_mpool_base_close();
|
|
|
|
mca_llm_base_close();
|
|
|
|
mca_allocator_base_close();
|
2004-01-31 21:48:58 +00:00
|
|
|
mca_base_close();
|
2004-08-08 13:07:20 +00:00
|
|
|
|
2004-07-13 20:25:12 +00:00
|
|
|
component_map.clear();
|
2004-01-19 17:43:50 +00:00
|
|
|
}
|
|
|
|
|
2004-07-13 20:25:12 +00:00
|
|
|
opened_components = false;
|
2004-01-19 17:43:50 +00:00
|
|
|
}
|