Permalink
Browse files

Update OMPI frameworks to use the MCA framework system.

Notes:
  - This commit also eliminates the need for an available components list. The code
    was not using the priority of the priority component list item so that was
    removed. Also updated the selection code to sort using opal_list_sort instead
    of the O(n^2) implementation that was there before.
  - Cleans up the ompi/orte-info functions. Expose the functions that construct the
    list of params so they can be used elsewhere.
  • Loading branch information...
1 parent 73e621b commit 6450f9a5d5b080528ba8603ca6338d302bca5dc8 @hjelmn committed Mar 6, 2013
Showing with 1,437 additions and 4,936 deletions.
  1. +0 −1 autogen.pl
  2. +4 −15 ompi/mca/allocator/base/allocator_base_frame.c
  3. +2 −8 ompi/mca/allocator/base/base.h
  4. +1 −2 ompi/mca/bcol/base/Makefile.am
  5. +1 −6 ompi/mca/bcol/base/base.h
  6. +0 −37 ompi/mca/bcol/base/bcol_base_close.c
  7. +10 −29 ompi/mca/bcol/base/{bcol_base_open.c → bcol_base_frame.c}
  8. +1 −1 ompi/mca/bcol/basesmuma/bcol_basesmuma_module.c
  9. +1 −2 ompi/mca/bml/base/Makefile.am
  10. +2 −5 ompi/mca/bml/base/base.h
  11. +17 −15 ompi/mca/bml/base/{bml_base_open.c → bml_base_frame.c}
  12. +8 −12 ompi/mca/bml/base/bml_base_init.c
  13. +4 −4 ompi/mca/bml/r2/bml_r2_ft.c
  14. +1 −2 ompi/mca/btl/base/Makefile.am
  15. +2 −4 ompi/mca/btl/base/base.h
  16. +0 −81 ompi/mca/btl/base/btl_base_close.c
  17. +41 −25 ompi/mca/btl/base/{btl_base_open.c → btl_base_frame.c}
  18. +9 −19 ompi/mca/btl/base/btl_base_select.c
  19. +2 −2 ompi/mca/btl/tcp/btl_tcp_component.c
  20. +1 −1 ompi/mca/btl/tcp/btl_tcp_endpoint.c
  21. +1 −2 ompi/mca/coll/base/Makefile.am
  22. +6 −77 ompi/mca/coll/base/base.h
  23. +0 −55 ompi/mca/coll/base/coll_base_close.c
  24. +28 −36 ompi/mca/coll/base/coll_base_comm_select.c
  25. +16 −63 ompi/mca/coll/base/coll_base_find_available.c
  26. +2 −37 ompi/mca/coll/base/{coll_base_open.c → coll_base_frame.c}
  27. +2 −2 ompi/mca/coll/demo/coll_demo_allgather.c
  28. +2 −2 ompi/mca/coll/demo/coll_demo_allgatherv.c
  29. +2 −2 ompi/mca/coll/demo/coll_demo_allreduce.c
  30. +2 −2 ompi/mca/coll/demo/coll_demo_alltoall.c
  31. +2 −2 ompi/mca/coll/demo/coll_demo_alltoallv.c
  32. +2 −2 ompi/mca/coll/demo/coll_demo_alltoallw.c
  33. +2 −2 ompi/mca/coll/demo/coll_demo_barrier.c
  34. +2 −2 ompi/mca/coll/demo/coll_demo_bcast.c
  35. +1 −1 ompi/mca/coll/demo/coll_demo_exscan.c
  36. +2 −2 ompi/mca/coll/demo/coll_demo_gather.c
  37. +2 −2 ompi/mca/coll/demo/coll_demo_gatherv.c
  38. +2 −2 ompi/mca/coll/demo/coll_demo_reduce.c
  39. +2 −2 ompi/mca/coll/demo/coll_demo_reduce_scatter.c
  40. +1 −1 ompi/mca/coll/demo/coll_demo_scan.c
  41. +2 −2 ompi/mca/coll/demo/coll_demo_scatter.c
  42. +2 −2 ompi/mca/coll/demo/coll_demo_scatterv.c
  43. +2 −2 ompi/mca/coll/ml/coll_ml_component.c
  44. +14 −14 ompi/mca/coll/sm/coll_sm_module.c
  45. +1 −2 ompi/mca/crcp/base/Makefile.am
  46. +2 −24 ompi/mca/crcp/base/base.h
  47. +18 −10 ompi/mca/crcp/base/{crcp_base_close.c → crcp_base_frame.c}
  48. +0 −67 ompi/mca/crcp/base/crcp_base_open.c
  49. +4 −4 ompi/mca/crcp/base/crcp_base_select.c
  50. +1 −1 ompi/mca/crcp/bkmrk/crcp_bkmrk_component.c
  51. +1 −2 ompi/mca/dpm/base/Makefile.am
  52. +2 −22 ompi/mca/dpm/base/base.h
  53. +0 −42 ompi/mca/dpm/base/dpm_base_close.c
  54. +10 −20 ompi/mca/dpm/base/{dpm_base_open.c → dpm_base_frame.c}
  55. +2 −2 ompi/mca/dpm/base/dpm_base_select.c
  56. +24 −24 ompi/mca/dpm/orte/dpm_orte.c
  57. +2 −3 ompi/mca/fbtl/base/Makefile.am
  58. +2 −14 ompi/mca/fbtl/base/base.h
  59. +0 −57 ompi/mca/fbtl/base/fbtl_base_close.c
  60. +11 −109 ompi/mca/fbtl/base/fbtl_base_file_select.c
  61. +14 −59 ompi/mca/fbtl/base/fbtl_base_find_available.c
  62. +2 −35 ompi/mca/fbtl/base/{fbtl_base_open.c → fbtl_base_frame.c}
  63. +2 −3 ompi/mca/fcoll/base/Makefile.am
  64. +2 −16 ompi/mca/fcoll/base/base.h
  65. +0 −58 ompi/mca/fcoll/base/fcoll_base_close.c
  66. +12 −123 ompi/mca/fcoll/base/fcoll_base_file_select.c
  67. +15 −60 ompi/mca/fcoll/base/fcoll_base_find_available.c
  68. +2 −37 ompi/mca/fcoll/base/{fcoll_base_open.c → fcoll_base_frame.c}
  69. +2 −3 ompi/mca/fs/base/Makefile.am
  70. +2 −14 ompi/mca/fs/base/base.h
  71. +0 −58 ompi/mca/fs/base/fs_base_close.c
  72. +13 −116 ompi/mca/fs/base/fs_base_file_select.c
  73. +24 −67 ompi/mca/fs/base/fs_base_find_available.c
  74. +14 −14 ompi/mca/{bml/base/bml_base_close.c → fs/base/fs_base_frame.c}
  75. +0 −80 ompi/mca/fs/base/fs_base_open.c
  76. +1 −2 ompi/mca/io/base/Makefile.am
  77. +2 −69 ompi/mca/io/base/base.h
  78. +0 −56 ompi/mca/io/base/io_base_close.c
  79. +34 −83 ompi/mca/io/base/io_base_delete.c
  80. +36 −88 ompi/mca/io/base/io_base_file_select.c
  81. +13 −54 ompi/mca/io/base/io_base_find_available.c
  82. +45 −0 ompi/mca/io/base/io_base_frame.c
  83. +0 −84 ompi/mca/io/base/io_base_open.c
  84. +3 −6 ompi/mca/io/base/io_base_register_datarep.c
  85. +1 −2 ompi/mca/mpool/base/Makefile.am
  86. +3 −6 ompi/mca/mpool/base/base.h
  87. +0 −79 ompi/mca/mpool/base/mpool_base_close.c
  88. +47 −29 ompi/mca/mpool/base/{mpool_base_open.c → mpool_base_frame.c}
  89. +6 −5 ompi/mca/mpool/base/mpool_base_lookup.c
  90. +2 −0 ompi/mca/mpool/base/mpool_base_mem_cb.c
  91. +0 −3 ompi/mca/mpool/base/mpool_base_mem_cb.h
  92. +2 −2 ompi/mca/mpool/sm/mpool_sm_component.c
  93. +1 −1 ompi/mca/mtl/base/Makefile.am
  94. +1 −5 ompi/mca/mtl/base/base.h
  95. +21 −54 ompi/mca/mtl/base/{mtl_base_component.c → mtl_base_frame.c}
  96. +8 −8 ompi/mca/mtl/mx/mtl_mx.c
  97. +1 −1 ompi/mca/mtl/mx/mtl_mx_endpoint.c
  98. +1 −1 ompi/mca/mtl/mx/mtl_mx_probe.c
  99. +2 −2 ompi/mca/mtl/mx/mtl_mx_recv.c
  100. +6 −6 ompi/mca/mtl/mx/mtl_mx_send.c
  101. +6 −6 ompi/mca/mtl/portals4/mtl_portals4.c
  102. +19 −19 ompi/mca/mtl/portals4/mtl_portals4_component.c
  103. +1 −2 ompi/mca/op/base/Makefile.include
  104. +2 −41 ompi/mca/op/base/base.h
  105. +0 −56 ompi/mca/op/base/op_base_close.c
  106. +14 −58 ompi/mca/op/base/op_base_find_available.c
  107. +2 −55 ompi/mca/op/base/{op_base_open.c → op_base_frame.c}
  108. +27 −30 ompi/mca/op/base/op_base_op_select.c
  109. +5 −5 ompi/mca/op/example/op_example_component.c
  110. +5 −5 ompi/mca/op/x86/op_x86_component.c
  111. +1 −2 ompi/mca/osc/base/Makefile.am
  112. +2 −6 ompi/mca/osc/base/base.h
  113. +0 −64 ompi/mca/osc/base/osc_base_close.c
  114. +76 −0 ompi/mca/osc/base/osc_base_frame.c
  115. +3 −3 ompi/mca/osc/base/osc_base_init.c
  116. +0 −103 ompi/mca/osc/base/osc_base_open.c
  117. +1 −1 ompi/mca/osc/pt2pt/osc_pt2pt.c
  118. +3 −3 ompi/mca/osc/pt2pt/osc_pt2pt_component.c
  119. +8 −8 ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c
  120. +16 −16 ompi/mca/osc/pt2pt/osc_pt2pt_sync.c
  121. +1 −1 ompi/mca/osc/rdma/osc_rdma.c
  122. +7 −7 ompi/mca/osc/rdma/osc_rdma_component.c
  123. +12 −12 ompi/mca/osc/rdma/osc_rdma_data_move.c
  124. +12 −12 ompi/mca/osc/rdma/osc_rdma_sync.c
  125. +2 −2 ompi/mca/pml/base/Makefile.am
  126. +12 −7 ompi/mca/pml/base/base.h
  127. +0 −86 ompi/mca/pml/base/pml_base_close.c
  128. +53 −28 ompi/mca/pml/base/{pml_base_open.c → pml_base_frame.c}
  129. +21 −27 ompi/mca/pml/base/pml_base_select.c
  130. +2 −2 ompi/mca/pml/bfo/pml_bfo_component.c
  131. +3 −3 ompi/mca/pml/cm/pml_cm_component.c
  132. +2 −7 ompi/mca/pml/dr/pml_dr_component.c
  133. +2 −2 ompi/mca/pml/ob1/pml_ob1_component.c
  134. +6 −8 ompi/mca/pml/v/pml_v_component.c
  135. +3 −2 ompi/mca/pubsub/base/Makefile.am
  136. +6 −29 ompi/mca/pubsub/base/base.h
  137. +0 −43 ompi/mca/pubsub/base/pubsub_base_close.c
  138. +19 −18 ompi/mca/pubsub/base/{pubsub_base_open.c → pubsub_base_frame.c}
  139. +3 −4 ompi/mca/pubsub/base/pubsub_base_select.c
  140. +5 −5 ompi/mca/pubsub/orte/pubsub_orte.c
  141. +4 −3 ompi/mca/rcache/base/Makefile.am
  142. +5 −11 ompi/mca/rcache/base/base.h
  143. +0 −66 ompi/mca/rcache/base/rcache_base_close.c
  144. +2 −2 ompi/mca/rcache/base/rcache_base_create.c
  145. +37 −15 ompi/mca/rcache/base/{rcache_base_open.c → rcache_base_frame.c}
  146. +2 −3 ompi/mca/rte/base/Makefile.am
  147. +4 −41 ompi/mca/rte/base/base.h
  148. +0 −42 ompi/mca/rte/base/rte_base_close.c
  149. +49 −0 ompi/mca/rte/base/rte_base_frame.c
  150. +0 −88 ompi/mca/rte/base/rte_base_open.c
  151. +10 −10 ompi/mca/rte/pmi/rte_pmi_db.c
  152. +2 −2 ompi/mca/sbgp/base/Makefile.am
  153. +7 −8 ompi/mca/sbgp/base/base.h
  154. +3 −3 ompi/mca/sbgp/base/sbgp_base_close.c
  155. +17 −35 ompi/mca/sbgp/base/{sbgp_base_open.c → sbgp_base_frame.c}
  156. +2 −2 ompi/mca/sharedfp/base/Makefile.am
  157. +8 −15 ompi/mca/sharedfp/base/base.h
  158. +0 −58 ompi/mca/sharedfp/base/sharedfp_base_close.c
  159. +13 −109 ompi/mca/sharedfp/base/sharedfp_base_file_select.c
  160. +23 −52 ompi/mca/sharedfp/base/sharedfp_base_find_available.c
  161. +15 −31 ompi/mca/sharedfp/base/{sharedfp_base_open.c → sharedfp_base_frame.c}
  162. +1 −2 ompi/mca/topo/base/Makefile.am
  163. +6 −16 ompi/mca/topo/base/base.h
  164. +0 −54 ompi/mca/topo/base/topo_base_close.c
  165. +11 −109 ompi/mca/topo/base/topo_base_comm_select.c
  166. +22 −51 ompi/mca/topo/base/topo_base_find_available.c
  167. +11 −27 ompi/mca/topo/base/{topo_base_open.c → topo_base_frame.c}
  168. +12 −3 ompi/mca/vprotocol/base/base.h
  169. +22 −21 ompi/mca/vprotocol/base/vprotocol_base.c
  170. +8 −6 ompi/mca/vprotocol/base/vprotocol_base_select.c
  171. +9 −12 ompi/mpi/c/cart_create.c
  172. +4 −11 ompi/mpi/c/file_delete.c
  173. +2 −10 ompi/mpi/c/file_open.c
  174. +7 −10 ompi/mpi/c/graph_create.c
  175. +2 −10 ompi/mpi/c/register_datarep.c
  176. +15 −15 ompi/runtime/ompi_mpi_finalize.c
  177. +12 −12 ompi/runtime/ompi_mpi_init.c
  178. +30 −326 ompi/tools/ompi_info/components.c
  179. +11 −28 ompi/tools/ompi_info/ompi_info.c
  180. +3 −2 ompi/tools/ompi_info/ompi_info.h
  181. +0 −1 ompi/tools/ompi_info/version.c
  182. +23 −173 opal/runtime/opal_info_support.c
  183. +2 −3 opal/runtime/opal_info_support.h
  184. +25 −216 orte/runtime/orte_info_support.c
  185. +2 −3 orte/runtime/orte_info_support.h
  186. +2 −9 orte/tools/orte-info/components.c
  187. +4 −42 orte/tools/orte-info/orte-info.c
  188. +0 −1 orte/tools/orte-info/version.c
View
@@ -371,7 +371,6 @@ (\$\@)
# There is no common framework object
if ($framework ne "common") {
my $framework_name = "${project}_${framework}_base_framework";
-
$framework_array_output .= " &$framework_name,\n";
$framework_decl_output .= "extern mca_base_framework_t $framework_name;\n";
}
@@ -39,20 +39,9 @@
/*
* Global variables
*/
-opal_list_t mca_allocator_base_components;
-/**
- * Function for finding and opening either all MCA components, or the one
- * that was specifically requested via a MCA parameter.
- */
-int mca_allocator_base_open(void)
-{
- /* Open up all available components */
-
- return mca_base_components_open("allocator", 0,
- mca_allocator_base_static_components,
- &mca_allocator_base_components, true);
-}
+MCA_BASE_FRAMEWORK_DECLARE(ompi, allocator, NULL, NULL, NULL, NULL,
+ mca_allocator_base_static_components, 0);
/**
* Traverses through the list of available components, calling their init
@@ -67,8 +56,8 @@ mca_allocator_base_component_t* mca_allocator_component_lookup(const char* name)
{
/* Traverse the list of available components; call their init functions. */
opal_list_item_t* item;
- for (item = opal_list_get_first(&mca_allocator_base_components);
- item != opal_list_get_end(&mca_allocator_base_components);
+ for (item = opal_list_get_first(&ompi_allocator_base_framework.framework_components);
+ item != opal_list_get_end(&ompi_allocator_base_framework.framework_components);
item = opal_list_get_next(item)) {
mca_base_component_list_item_t *cli = (mca_base_component_list_item_t *) item;
mca_allocator_base_component_t* component = (mca_allocator_base_component_t *) cli->cli_component;
@@ -50,22 +50,16 @@ typedef struct mca_allocator_base_selected_module_t mca_allocator_base_selected_
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_allocator_base_selected_module_t);
-/*
- * Global functions for MCA: overall allocator open and close
- */
-
-OMPI_DECLSPEC int mca_allocator_base_open(void);
-OMPI_DECLSPEC int mca_allocator_base_close(void);
OMPI_DECLSPEC mca_allocator_base_component_t* mca_allocator_component_lookup(const char* name);
/*
* Globals
*/
/**
- * The list of all the selected components.
+ * The allocator framework
*/
-OMPI_DECLSPEC extern opal_list_t mca_allocator_base_components;
+OMPI_DECLSPEC extern mca_base_framework_t ompi_allocator_base_framework;
END_C_DECLS
@@ -12,6 +12,5 @@
headers += \
base/base.h
libmca_bcol_la_SOURCES += \
- base/bcol_base_close.c \
- base/bcol_base_open.c \
+ base/bcol_base_frame.c \
base/bcol_base_init.c
@@ -24,15 +24,10 @@
BEGIN_C_DECLS
-OMPI_DECLSPEC extern opal_list_t mca_bcol_base_components_opened;
OMPI_DECLSPEC extern opal_list_t mca_bcol_base_components_in_use;
-OMPI_DECLSPEC extern int mca_bcol_base_output;
OMPI_DECLSPEC extern char *ompi_bcol_bcols_string;
-
-OMPI_DECLSPEC int mca_bcol_base_open(void);
-
-OMPI_DECLSPEC int mca_bcol_base_close(void);
+OMPI_DECLSPEC extern mca_base_framework_t ompi_bcol_base_framework;
OMPI_DECLSPEC int mca_bcol_base_init(bool enable_progress_threads, bool enable_mpi_threads);
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
- * Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
- * $COPYRIGHT$
- *
- * Additional copyrights may follow
- *
- * $HEADER$
- */
-
-
-#include "ompi_config.h"
-
-#include <stdio.h>
-
-#include "ompi/constants.h"
-#include "opal/mca/mca.h"
-#include "opal/mca/base/base.h"
-#include "ompi/mca/bcol/bcol.h"
-#include "ompi/mca/bcol/base/base.h"
-#include "ompi/include/ompi/constants.h"
-
-
-int mca_bcol_base_close(void)
-{
- /* Close all remaining available modules */
- mca_base_components_close(mca_bcol_base_output,
- &mca_bcol_base_components_opened, NULL);
-
- /* Close the framework output */
- opal_output_close (mca_bcol_base_output);
- mca_bcol_base_output = -1;
-
- /* All done */
- return OMPI_SUCCESS;
-}
-
@@ -34,13 +34,14 @@
#include "ompi/mca/bcol/base/static-components.h"
+static int mca_bcol_base_open(mca_base_open_flag_t flags);
+static int mca_bcol_base_register(mca_base_register_flag_t flags);
+
/*
** * Global variables
** */
-int mca_bcol_base_output = 0;
-opal_list_t mca_bcol_base_components_opened;
-
-static int mca_bcol_base_verbose = 0;
+MCA_BASE_FRAMEWORK_DECLARE(ompi, bcol, NULL, mca_bcol_base_register, mca_bcol_base_open, NULL,
+ mca_bcol_base_static_components, 0);
OMPI_DECLSPEC opal_list_t mca_bcol_base_components_in_use;
OMPI_DECLSPEC char *ompi_bcol_bcols_string;
@@ -202,17 +203,8 @@ static int mca_bcol_base_set_components_to_use(opal_list_t *bcol_components_avai
return OMPI_SUCCESS;
}
-static int mca_bcol_base_register(int flags)
+static int mca_bcol_base_register(mca_base_register_flag_t flags)
{
- /* Debugging/Verbose output */
- (void) mca_base_var_register("ompi", "bcol", "base", "verbose",
- "Verbosity level of BCOL framework",
- MCA_BASE_VAR_TYPE_INT, NULL, 0,
- MCA_BASE_VAR_FLAG_SETTABLE,
- OPAL_INFO_LVL_9,
- MCA_BASE_VAR_SCOPE_LOCAL,
- &mca_bcol_base_verbose);
-
/* figure out which bcol and sbgp components will actually be used */
/* get list of sub-grouping functions to use */
ompi_bcol_bcols_string = "basesmuma,basesmuma,iboffload,ptpcoll,ugni";
@@ -230,28 +222,17 @@ static int mca_bcol_base_register(int flags)
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
-int mca_bcol_base_open(void)
+static int mca_bcol_base_open(mca_base_open_flag_t flags)
{
int ret;
- /*_bcol_base_components_available
- * Register some MCA parameters
- */
- (void) mca_bcol_base_register(0);
-
- /* get framework id */
- mca_bcol_base_output = opal_output_open(NULL);
- opal_output_set_verbosity(mca_bcol_base_output, mca_bcol_base_verbose);
-
/* Open up all available components */
if (OMPI_SUCCESS !=
- mca_base_components_open("bcol", mca_bcol_base_output, mca_bcol_base_static_components,
- &mca_bcol_base_components_opened,
- true)) {
- return OMPI_ERROR;
+ (ret = mca_base_framework_components_open(&ompi_bcol_base_framework, flags))) {
+ return ret;
}
- ret = mca_bcol_base_set_components_to_use(&mca_bcol_base_components_opened,
+ ret = mca_bcol_base_set_components_to_use(&ompi_bcol_base_framework.framework_components,
&mca_bcol_base_components_in_use);
/* memory registration compatibilities */
@@ -565,7 +565,7 @@ basesmuma_module_enable(mca_bcol_base_module_t *module,
memset(&output_buffer[0],0,sizeof(output_buffer));
snprintf(output_buffer,sizeof(output_buffer),"%s (cid %d)", comm->c_name,
comm->c_contextid);
- opal_output_verbose(10, mca_bcol_base_output,
+ opal_output_verbose(10, ompi_bcol_base_framework.framework_output,
"bcol:basesmuma:enable: new communicator: %s", output_buffer);
/* All done */
@@ -26,6 +26,5 @@ libmca_bml_la_SOURCES += \
base/bml_base_btl.h \
base/bml_base_endpoint.c \
base/bml_base_init.c \
- base/bml_base_close.c \
- base/bml_base_open.c \
+ base/bml_base_frame.c \
base/bml_base_ft.c
View
@@ -23,6 +23,7 @@
#include "ompi_config.h"
#include "opal/mca/mca.h"
+#include "opal/mca/base/mca_base_framework.h"
#include "ompi/mca/bml/bml.h"
@@ -46,10 +47,8 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_bml_base_selected_module_t);
* Global functions for MCA: overall BTL open and close
*/
-OMPI_DECLSPEC int mca_bml_base_open(void);
OMPI_DECLSPEC int mca_bml_base_init(bool enable_progress_threads,
bool enable_mpi_threads);
-OMPI_DECLSPEC int mca_bml_base_close(void);
OMPI_DECLSPEC bool mca_bml_base_inited(void);
OMPI_DECLSPEC int mca_bml_base_ft_event(int state);
@@ -58,11 +57,9 @@ OMPI_DECLSPEC int mca_bml_base_ft_event(int state);
/*
* Globals
*/
-extern int mca_bml_base_already_opened;
-OMPI_DECLSPEC extern int mca_bml_base_output;
OMPI_DECLSPEC extern mca_bml_base_component_t mca_bml_component;
-OMPI_DECLSPEC extern opal_list_t mca_bml_base_components_available;
OMPI_DECLSPEC extern mca_bml_base_module_t mca_bml;
+OMPI_DECLSPEC extern mca_base_framework_t ompi_bml_base_framework;
END_C_DECLS
#endif /* MCA_BML_BASE_H */
@@ -28,8 +28,13 @@
#include "ompi/mca/bml/base/static-components.h"
#include "opal/mca/base/base.h"
-int mca_bml_base_already_opened = 0;
-opal_list_t mca_bml_base_components_available = {{0}};
+static int mca_bml_base_register(mca_base_register_flag_t flags);
+static int mca_bml_base_open(mca_base_open_flag_t flags);
+static int mca_bml_base_close(void);
+
+MCA_BASE_FRAMEWORK_DECLARE(ompi, bml, "BTL Multiplexing Layer", mca_bml_base_register,
+ mca_bml_base_open, mca_bml_base_close, mca_bml_base_static_components,
+ 0);
#if OPAL_ENABLE_DEBUG_RELIABILITY
int mca_bml_base_error_rate_floor;
@@ -38,7 +43,7 @@ int mca_bml_base_error_count;
static bool mca_bml_base_srand;
#endif
-int mca_bml_base_register(int flags)
+static int mca_bml_base_register(mca_base_register_flag_t flags)
{
#if OPAL_ENABLE_DEBUG_RELIABILITY
do {
@@ -77,20 +82,13 @@ int mca_bml_base_register(int flags)
return OMPI_SUCCESS;
}
-int mca_bml_base_open(void)
+static int mca_bml_base_open(mca_base_open_flag_t flags)
{
- /* See if we've already been here */
- if (++mca_bml_base_already_opened > 1) {
- return OMPI_SUCCESS;
- }
-
- (void) mca_bml_base_register(0);
+ int ret;
if(OMPI_SUCCESS !=
- mca_base_components_open("bml", 0, mca_bml_base_static_components,
- &mca_bml_base_components_available,
- true)) {
- return OMPI_ERROR;
+ (ret = mca_base_framework_components_open(&ompi_bml_base_framework, flags))) {
+ return ret;
}
#if OPAL_ENABLE_DEBUG_RELIABILITY
@@ -108,6 +106,10 @@ int mca_bml_base_open(void)
}
#endif
- return mca_btl_base_open();
+ return mca_base_framework_open(&ompi_btl_base_framework, 0);
}
+static int mca_bml_base_close( void )
+{
+ return mca_base_framework_close(&ompi_btl_base_framework);
+}
@@ -23,8 +23,6 @@
#include "opal/mca/mca.h"
#include "opal/runtime/opal.h"
-int mca_bml_base_output = -1;
-
mca_bml_base_module_t mca_bml = {
NULL, /* bml_component */
NULL, /* bml_add_procs */
@@ -57,13 +55,13 @@ int mca_bml_base_init( bool enable_progress_threads,
init_called = true;
- for (item = opal_list_get_first(&mca_bml_base_components_available);
- opal_list_get_end(&mca_bml_base_components_available) != item;
+ for (item = opal_list_get_first(&ompi_bml_base_framework.framework_components);
+ opal_list_get_end(&ompi_bml_base_framework.framework_components) != item;
item = opal_list_get_next(item)) {
cli = (mca_base_component_list_item_t*) item;
component = (mca_bml_base_component_t*) cli->cli_component;
if(NULL == component->bml_init) {
- opal_output_verbose( 10, mca_bml_base_output,
+ opal_output_verbose( 10, ompi_bml_base_framework.framework_output,
"select: no init function; ignoring component %s",
component->bml_version.mca_component_name );
continue;
@@ -85,11 +83,9 @@ int mca_bml_base_init( bool enable_progress_threads,
if(NULL == best_module) {
return OMPI_SUCCESS;
}
- else {
- mca_bml_component = *best_component;
- mca_bml = *best_module;
- return mca_base_components_close(mca_bml_base_output,
- &mca_bml_base_components_available,
- (mca_base_component_t*) best_component);
- }
+
+ mca_bml_component = *best_component;
+ mca_bml = *best_module;
+ return mca_base_framework_components_close(&ompi_bml_base_framework,
+ (mca_base_component_t*) best_component);
}
@@ -144,7 +144,7 @@ int mca_bml_r2_ft_event(int state)
opal_output(0, "bml:r2: ft_event(Restart): Failed to finalize BML framework\n");
return ret;
}
- if( OMPI_SUCCESS != (ret = mca_btl_base_close()) ) {
+ if( OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_btl_base_framework)) ) {
opal_output(0, "bml:r2: ft_event(Restart): Failed to close BTL framework\n");
return ret;
}
@@ -168,7 +168,7 @@ int mca_bml_r2_ft_event(int state)
/*
* Re-open the BTL framework to get the full list of components.
*/
- if( OMPI_SUCCESS != (ret = mca_btl_base_open()) ) {
+ if( OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_btl_base_framework, 0)) ) {
opal_output(0, "bml:r2: ft_event(Restart): Failed to open BTL framework\n");
return ret;
}
@@ -222,7 +222,7 @@ int mca_bml_r2_ft_event(int state)
opal_output(0, "bml:r2: ft_event(Restart): Failed to finalize BML framework\n");
return ret;
}
- if( OMPI_SUCCESS != (ret = mca_btl_base_close()) ) {
+ if( OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_btl_base_framework)) ) {
opal_output(0, "bml:r2: ft_event(Restart): Failed to close BTL framework\n");
return ret;
}
@@ -253,7 +253,7 @@ int mca_bml_r2_ft_event(int state)
opal_output_verbose(11, ompi_cr_output,
"Restart (Previous BTL MCA): <%s>\n", btl_list ? btl_list[0] : "");
- if( OMPI_SUCCESS != (ret = mca_btl_base_open()) ) {
+ if( OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_btl_base_framework, 0)) ) {
opal_output(0, "bml:r2: ft_event(Restart): Failed to open BTL framework\n");
return ret;
}
Oops, something went wrong.

0 comments on commit 6450f9a

Please sign in to comment.