From 3f09d5f2a4cebf1aa46b1fede57b3fad63ceee81 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Thu, 28 Jul 2005 16:31:29 +0000 Subject: [PATCH] * make btl open be safe to call multiple times (btl close already was) * add btl back into ompi_info. Since it now directly calls the open/close, the missing symbol problems Ralph was seeing when ob1 is ignored will not occur. This commit was SVN r6652. --- ompi/mca/btl/base/btl_base_open.c | 4 ++++ ompi/tools/ompi_info/components.cc | 8 ++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ompi/mca/btl/base/btl_base_open.c b/ompi/mca/btl/base/btl_base_open.c index f190cf7048..62c13964f7 100644 --- a/ompi/mca/btl/base/btl_base_open.c +++ b/ompi/mca/btl/base/btl_base_open.c @@ -69,6 +69,7 @@ char* mca_btl_base_exclude = NULL; opal_list_t mca_btl_base_components_opened; opal_list_t mca_btl_base_modules_initialized; +static bool already_opened = false; /** * Function for finding and opening either all MCA components, or the one @@ -76,6 +77,9 @@ opal_list_t mca_btl_base_modules_initialized; */ int mca_btl_base_open(void) { + if (already_opened) return OMPI_SUCCESS; + already_opened = true; + /* Open up all available components */ if (OMPI_SUCCESS != diff --git a/ompi/tools/ompi_info/components.cc b/ompi/tools/ompi_info/components.cc index e3b7844850..0cb058c2dd 100644 --- a/ompi/tools/ompi_info/components.cc +++ b/ompi/tools/ompi_info/components.cc @@ -200,12 +200,8 @@ void ompi_info::open_components() */ component_map["ptl"] = &mca_ptl_base_components_opened; -#if 0 - /* mca_btl_base_open() should not be called directly. This call is performed - * in the PML base open. - */ + mca_btl_base_open(); component_map["btl"] = &mca_btl_base_components_opened; -#endif mca_topo_base_open(); component_map["topo"] = &mca_topo_base_components_opened; @@ -227,7 +223,7 @@ void ompi_info::close_components() mca_topo_base_close(); // the PML has to call the base PTL close function. - // the PML has to call the base BTL close function. + mca_btl_base_close(); mca_pml_base_close(); mca_mpool_base_close(); mca_io_base_close();