Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 6450f9a5d5b080528ba8603ca6338d302bca5dc8 1 parent 73e621b
Nathan Hjelm authored March 06, 2013

Showing 188 changed files with 1,437 additions and 4,936 deletions. Show diff stats Hide diff stats

  1. 1  autogen.pl
  2. 19  ompi/mca/allocator/base/allocator_base_frame.c
  3. 10  ompi/mca/allocator/base/base.h
  4. 3  ompi/mca/bcol/base/Makefile.am
  5. 7  ompi/mca/bcol/base/base.h
  6. 37  ompi/mca/bcol/base/bcol_base_close.c
  7. 39  ompi/mca/bcol/base/{bcol_base_open.c → bcol_base_frame.c}
  8. 2  ompi/mca/bcol/basesmuma/bcol_basesmuma_module.c
  9. 3  ompi/mca/bml/base/Makefile.am
  10. 7  ompi/mca/bml/base/base.h
  11. 32  ompi/mca/bml/base/{bml_base_open.c → bml_base_frame.c}
  12. 20  ompi/mca/bml/base/bml_base_init.c
  13. 8  ompi/mca/bml/r2/bml_r2_ft.c
  14. 3  ompi/mca/btl/base/Makefile.am
  15. 6  ompi/mca/btl/base/base.h
  16. 81  ompi/mca/btl/base/btl_base_close.c
  17. 66  ompi/mca/btl/base/{btl_base_open.c → btl_base_frame.c}
  18. 28  ompi/mca/btl/base/btl_base_select.c
  19. 4  ompi/mca/btl/tcp/btl_tcp_component.c
  20. 2  ompi/mca/btl/tcp/btl_tcp_endpoint.c
  21. 3  ompi/mca/coll/base/Makefile.am
  22. 83  ompi/mca/coll/base/base.h
  23. 55  ompi/mca/coll/base/coll_base_close.c
  24. 64  ompi/mca/coll/base/coll_base_comm_select.c
  25. 79  ompi/mca/coll/base/coll_base_find_available.c
  26. 39  ompi/mca/coll/base/{coll_base_open.c → coll_base_frame.c}
  27. 4  ompi/mca/coll/demo/coll_demo_allgather.c
  28. 4  ompi/mca/coll/demo/coll_demo_allgatherv.c
  29. 4  ompi/mca/coll/demo/coll_demo_allreduce.c
  30. 4  ompi/mca/coll/demo/coll_demo_alltoall.c
  31. 4  ompi/mca/coll/demo/coll_demo_alltoallv.c
  32. 4  ompi/mca/coll/demo/coll_demo_alltoallw.c
  33. 4  ompi/mca/coll/demo/coll_demo_barrier.c
  34. 4  ompi/mca/coll/demo/coll_demo_bcast.c
  35. 2  ompi/mca/coll/demo/coll_demo_exscan.c
  36. 4  ompi/mca/coll/demo/coll_demo_gather.c
  37. 4  ompi/mca/coll/demo/coll_demo_gatherv.c
  38. 4  ompi/mca/coll/demo/coll_demo_reduce.c
  39. 4  ompi/mca/coll/demo/coll_demo_reduce_scatter.c
  40. 2  ompi/mca/coll/demo/coll_demo_scan.c
  41. 4  ompi/mca/coll/demo/coll_demo_scatter.c
  42. 4  ompi/mca/coll/demo/coll_demo_scatterv.c
  43. 4  ompi/mca/coll/ml/coll_ml_component.c
  44. 28  ompi/mca/coll/sm/coll_sm_module.c
  45. 3  ompi/mca/crcp/base/Makefile.am
  46. 26  ompi/mca/crcp/base/base.h
  47. 28  ompi/mca/crcp/base/{crcp_base_close.c → crcp_base_frame.c}
  48. 67  ompi/mca/crcp/base/crcp_base_open.c
  49. 8  ompi/mca/crcp/base/crcp_base_select.c
  50. 2  ompi/mca/crcp/bkmrk/crcp_bkmrk_component.c
  51. 3  ompi/mca/dpm/base/Makefile.am
  52. 24  ompi/mca/dpm/base/base.h
  53. 42  ompi/mca/dpm/base/dpm_base_close.c
  54. 30  ompi/mca/dpm/base/{dpm_base_open.c → dpm_base_frame.c}
  55. 4  ompi/mca/dpm/base/dpm_base_select.c
  56. 48  ompi/mca/dpm/orte/dpm_orte.c
  57. 5  ompi/mca/fbtl/base/Makefile.am
  58. 16  ompi/mca/fbtl/base/base.h
  59. 57  ompi/mca/fbtl/base/fbtl_base_close.c
  60. 120  ompi/mca/fbtl/base/fbtl_base_file_select.c
  61. 73  ompi/mca/fbtl/base/fbtl_base_find_available.c
  62. 37  ompi/mca/fbtl/base/{fbtl_base_open.c → fbtl_base_frame.c}
  63. 5  ompi/mca/fcoll/base/Makefile.am
  64. 18  ompi/mca/fcoll/base/base.h
  65. 58  ompi/mca/fcoll/base/fcoll_base_close.c
  66. 135  ompi/mca/fcoll/base/fcoll_base_file_select.c
  67. 75  ompi/mca/fcoll/base/fcoll_base_find_available.c
  68. 39  ompi/mca/fcoll/base/{fcoll_base_open.c → fcoll_base_frame.c}
  69. 5  ompi/mca/fs/base/Makefile.am
  70. 16  ompi/mca/fs/base/base.h
  71. 58  ompi/mca/fs/base/fs_base_close.c
  72. 129  ompi/mca/fs/base/fs_base_file_select.c
  73. 91  ompi/mca/fs/base/fs_base_find_available.c
  74. 28  ompi/mca/{bml/base/bml_base_close.c → fs/base/fs_base_frame.c}
  75. 80  ompi/mca/fs/base/fs_base_open.c
  76. 3  ompi/mca/io/base/Makefile.am
  77. 71  ompi/mca/io/base/base.h
  78. 56  ompi/mca/io/base/io_base_close.c
  79. 117  ompi/mca/io/base/io_base_delete.c
  80. 124  ompi/mca/io/base/io_base_file_select.c
  81. 67  ompi/mca/io/base/io_base_find_available.c
  82. 45  ompi/mca/io/base/io_base_frame.c
  83. 84  ompi/mca/io/base/io_base_open.c
  84. 9  ompi/mca/io/base/io_base_register_datarep.c
  85. 3  ompi/mca/mpool/base/Makefile.am
  86. 9  ompi/mca/mpool/base/base.h
  87. 79  ompi/mca/mpool/base/mpool_base_close.c
  88. 76  ompi/mca/mpool/base/{mpool_base_open.c → mpool_base_frame.c}
  89. 11  ompi/mca/mpool/base/mpool_base_lookup.c
  90. 2  ompi/mca/mpool/base/mpool_base_mem_cb.c
  91. 3  ompi/mca/mpool/base/mpool_base_mem_cb.h
  92. 4  ompi/mca/mpool/sm/mpool_sm_component.c
  93. 2  ompi/mca/mtl/base/Makefile.am
  94. 6  ompi/mca/mtl/base/base.h
  95. 75  ompi/mca/mtl/base/{mtl_base_component.c → mtl_base_frame.c}
  96. 16  ompi/mca/mtl/mx/mtl_mx.c
  97. 2  ompi/mca/mtl/mx/mtl_mx_endpoint.c
  98. 2  ompi/mca/mtl/mx/mtl_mx_probe.c
  99. 4  ompi/mca/mtl/mx/mtl_mx_recv.c
  100. 12  ompi/mca/mtl/mx/mtl_mx_send.c
  101. 12  ompi/mca/mtl/portals4/mtl_portals4.c
  102. 38  ompi/mca/mtl/portals4/mtl_portals4_component.c
  103. 3  ompi/mca/op/base/Makefile.include
  104. 43  ompi/mca/op/base/base.h
  105. 56  ompi/mca/op/base/op_base_close.c
  106. 72  ompi/mca/op/base/op_base_find_available.c
  107. 57  ompi/mca/op/base/{op_base_open.c → op_base_frame.c}
  108. 57  ompi/mca/op/base/op_base_op_select.c
  109. 10  ompi/mca/op/example/op_example_component.c
  110. 10  ompi/mca/op/x86/op_x86_component.c
  111. 3  ompi/mca/osc/base/Makefile.am
  112. 8  ompi/mca/osc/base/base.h
  113. 64  ompi/mca/osc/base/osc_base_close.c
  114. 76  ompi/mca/osc/base/osc_base_frame.c
  115. 6  ompi/mca/osc/base/osc_base_init.c
  116. 103  ompi/mca/osc/base/osc_base_open.c
  117. 2  ompi/mca/osc/pt2pt/osc_pt2pt.c
  118. 6  ompi/mca/osc/pt2pt/osc_pt2pt_component.c
  119. 16  ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c
  120. 32  ompi/mca/osc/pt2pt/osc_pt2pt_sync.c
  121. 2  ompi/mca/osc/rdma/osc_rdma.c
  122. 14  ompi/mca/osc/rdma/osc_rdma_component.c
  123. 24  ompi/mca/osc/rdma/osc_rdma_data_move.c
  124. 24  ompi/mca/osc/rdma/osc_rdma_sync.c
  125. 4  ompi/mca/pml/base/Makefile.am
  126. 19  ompi/mca/pml/base/base.h
  127. 86  ompi/mca/pml/base/pml_base_close.c
  128. 81  ompi/mca/pml/base/{pml_base_open.c → pml_base_frame.c}
  129. 48  ompi/mca/pml/base/pml_base_select.c
  130. 4  ompi/mca/pml/bfo/pml_bfo_component.c
  131. 6  ompi/mca/pml/cm/pml_cm_component.c
  132. 9  ompi/mca/pml/dr/pml_dr_component.c
  133. 4  ompi/mca/pml/ob1/pml_ob1_component.c
  134. 14  ompi/mca/pml/v/pml_v_component.c
  135. 5  ompi/mca/pubsub/base/Makefile.am
  136. 35  ompi/mca/pubsub/base/base.h
  137. 43  ompi/mca/pubsub/base/pubsub_base_close.c
  138. 37  ompi/mca/pubsub/base/{pubsub_base_open.c → pubsub_base_frame.c}
  139. 7  ompi/mca/pubsub/base/pubsub_base_select.c
  140. 10  ompi/mca/pubsub/orte/pubsub_orte.c
  141. 7  ompi/mca/rcache/base/Makefile.am
  142. 16  ompi/mca/rcache/base/base.h
  143. 66  ompi/mca/rcache/base/rcache_base_close.c
  144. 4  ompi/mca/rcache/base/rcache_base_create.c
  145. 52  ompi/mca/rcache/base/{rcache_base_open.c → rcache_base_frame.c}
  146. 5  ompi/mca/rte/base/Makefile.am
  147. 45  ompi/mca/rte/base/base.h
  148. 42  ompi/mca/rte/base/rte_base_close.c
  149. 49  ompi/mca/rte/base/rte_base_frame.c
  150. 88  ompi/mca/rte/base/rte_base_open.c
  151. 20  ompi/mca/rte/pmi/rte_pmi_db.c
  152. 4  ompi/mca/sbgp/base/Makefile.am
  153. 15  ompi/mca/sbgp/base/base.h
  154. 6  ompi/mca/sbgp/base/sbgp_base_close.c
  155. 52  ompi/mca/sbgp/base/{sbgp_base_open.c → sbgp_base_frame.c}
  156. 4  ompi/mca/sharedfp/base/Makefile.am
  157. 23  ompi/mca/sharedfp/base/base.h
  158. 58  ompi/mca/sharedfp/base/sharedfp_base_close.c
  159. 122  ompi/mca/sharedfp/base/sharedfp_base_file_select.c
  160. 75  ompi/mca/sharedfp/base/sharedfp_base_find_available.c
  161. 46  ompi/mca/sharedfp/base/{sharedfp_base_open.c → sharedfp_base_frame.c}
  162. 3  ompi/mca/topo/base/Makefile.am
  163. 22  ompi/mca/topo/base/base.h
  164. 54  ompi/mca/topo/base/topo_base_close.c
  165. 120  ompi/mca/topo/base/topo_base_comm_select.c
  166. 73  ompi/mca/topo/base/topo_base_find_available.c
  167. 38  ompi/mca/topo/base/{topo_base_open.c → topo_base_frame.c}
  168. 15  ompi/mca/vprotocol/base/base.h
  169. 43  ompi/mca/vprotocol/base/vprotocol_base.c
  170. 14  ompi/mca/vprotocol/base/vprotocol_base_select.c
  171. 21  ompi/mpi/c/cart_create.c
  172. 15  ompi/mpi/c/file_delete.c
  173. 12  ompi/mpi/c/file_open.c
  174. 17  ompi/mpi/c/graph_create.c
  175. 12  ompi/mpi/c/register_datarep.c
  176. 30  ompi/runtime/ompi_mpi_finalize.c
  177. 24  ompi/runtime/ompi_mpi_init.c
  178. 356  ompi/tools/ompi_info/components.c
  179. 39  ompi/tools/ompi_info/ompi_info.c
  180. 5  ompi/tools/ompi_info/ompi_info.h
  181. 1  ompi/tools/ompi_info/version.c
  182. 196  opal/runtime/opal_info_support.c
  183. 5  opal/runtime/opal_info_support.h
  184. 241  orte/runtime/orte_info_support.c
  185. 5  orte/runtime/orte_info_support.h
  186. 11  orte/tools/orte-info/components.c
  187. 46  orte/tools/orte-info/orte-info.c
  188. 1  orte/tools/orte-info/version.c
1  autogen.pl
@@ -371,7 +371,6 @@ (\$\@)
371 371
         # There is no common framework object
372 372
         if ($framework ne "common") {
373 373
             my $framework_name = "${project}_${framework}_base_framework";
374  
-
375 374
             $framework_array_output .= "    &$framework_name,\n";
376 375
             $framework_decl_output .= "extern mca_base_framework_t $framework_name;\n";
377 376
         }
19  ompi/mca/allocator/base/allocator_base_frame.c
@@ -39,20 +39,9 @@
39 39
 /*
40 40
  * Global variables
41 41
  */
42  
-opal_list_t mca_allocator_base_components;
43 42
 
44  
-/**
45  
- * Function for finding and opening either all MCA components, or the one
46  
- * that was specifically requested via a MCA parameter.
47  
- */
48  
-int mca_allocator_base_open(void)
49  
-{
50  
-  /* Open up all available components */
51  
-
52  
-  return mca_base_components_open("allocator", 0, 
53  
-                                  mca_allocator_base_static_components, 
54  
-                                  &mca_allocator_base_components, true);
55  
-}
  43
+MCA_BASE_FRAMEWORK_DECLARE(ompi, allocator, NULL, NULL, NULL, NULL,
  44
+                           mca_allocator_base_static_components, 0);
56 45
 
57 46
 /**
58 47
  * 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)
67 56
 {
68 57
     /* Traverse the list of available components; call their init functions. */
69 58
     opal_list_item_t* item;
70  
-    for (item = opal_list_get_first(&mca_allocator_base_components);
71  
-         item != opal_list_get_end(&mca_allocator_base_components);
  59
+    for (item = opal_list_get_first(&ompi_allocator_base_framework.framework_components);
  60
+         item != opal_list_get_end(&ompi_allocator_base_framework.framework_components);
72 61
          item = opal_list_get_next(item)) {
73 62
          mca_base_component_list_item_t *cli = (mca_base_component_list_item_t *) item;
74 63
          mca_allocator_base_component_t* component = (mca_allocator_base_component_t *) cli->cli_component;
10  ompi/mca/allocator/base/base.h
@@ -50,12 +50,6 @@ typedef struct mca_allocator_base_selected_module_t mca_allocator_base_selected_
50 50
 OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_allocator_base_selected_module_t);
51 51
                                                                                                      
52 52
 
53  
-/*
54  
- * Global functions for MCA: overall allocator open and close
55  
- */
56  
-
57  
-OMPI_DECLSPEC int mca_allocator_base_open(void);
58  
-OMPI_DECLSPEC int mca_allocator_base_close(void);
59 53
 OMPI_DECLSPEC mca_allocator_base_component_t* mca_allocator_component_lookup(const char* name);
60 54
 
61 55
 
@@ -63,9 +57,9 @@ OMPI_DECLSPEC mca_allocator_base_component_t* mca_allocator_component_lookup(con
63 57
  * Globals
64 58
  */
65 59
 /**
66  
- * The list of all the selected components.
  60
+ * The allocator framework
67 61
  */
68  
-OMPI_DECLSPEC extern opal_list_t mca_allocator_base_components;
  62
+OMPI_DECLSPEC extern mca_base_framework_t ompi_allocator_base_framework;
69 63
 
70 64
 END_C_DECLS
71 65
 
3  ompi/mca/bcol/base/Makefile.am
@@ -12,6 +12,5 @@
12 12
 headers += \
13 13
         base/base.h
14 14
 libmca_bcol_la_SOURCES += \
15  
-        base/bcol_base_close.c \
16  
-        base/bcol_base_open.c  \
  15
+        base/bcol_base_frame.c \
17 16
         base/bcol_base_init.c
7  ompi/mca/bcol/base/base.h
@@ -24,15 +24,10 @@
24 24
 
25 25
 BEGIN_C_DECLS
26 26
 
27  
-OMPI_DECLSPEC extern opal_list_t mca_bcol_base_components_opened;
28 27
 OMPI_DECLSPEC extern opal_list_t mca_bcol_base_components_in_use;
29  
-OMPI_DECLSPEC extern int mca_bcol_base_output;
30 28
 OMPI_DECLSPEC extern char *ompi_bcol_bcols_string;
31 29
 
32  
-
33  
-OMPI_DECLSPEC int mca_bcol_base_open(void);
34  
-
35  
-OMPI_DECLSPEC int mca_bcol_base_close(void);
  30
+OMPI_DECLSPEC extern mca_base_framework_t ompi_bcol_base_framework;
36 31
 
37 32
 OMPI_DECLSPEC int mca_bcol_base_init(bool enable_progress_threads, bool enable_mpi_threads);
38 33
 
37  ompi/mca/bcol/base/bcol_base_close.c
... ...
@@ -1,37 +0,0 @@
1  
-/*
2  
- * Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
3  
- * Copyright (c) 2009-2012 Mellanox Technologies.  All rights reserved.
4  
- * $COPYRIGHT$
5  
- *
6  
- * Additional copyrights may follow
7  
- *
8  
- * $HEADER$
9  
- */
10  
-
11  
-
12  
-#include "ompi_config.h"
13  
-
14  
-#include <stdio.h>
15  
-
16  
-#include "ompi/constants.h"
17  
-#include "opal/mca/mca.h"
18  
-#include "opal/mca/base/base.h"
19  
-#include "ompi/mca/bcol/bcol.h"
20  
-#include "ompi/mca/bcol/base/base.h"
21  
-#include "ompi/include/ompi/constants.h"
22  
-
23  
-
24  
-int mca_bcol_base_close(void)
25  
-{
26  
-    /* Close all remaining available modules */
27  
-    mca_base_components_close(mca_bcol_base_output,
28  
-                              &mca_bcol_base_components_opened, NULL);
29  
-
30  
-    /* Close the framework output */
31  
-    opal_output_close (mca_bcol_base_output);
32  
-    mca_bcol_base_output = -1;
33  
-
34  
-    /* All done */
35  
-    return OMPI_SUCCESS;
36  
-}
37  
-
39  ompi/mca/bcol/base/bcol_base_open.c → ompi/mca/bcol/base/bcol_base_frame.c
@@ -34,13 +34,14 @@
34 34
 
35 35
 #include "ompi/mca/bcol/base/static-components.h"
36 36
 
  37
+static int mca_bcol_base_open(mca_base_open_flag_t flags);
  38
+static int mca_bcol_base_register(mca_base_register_flag_t flags);
  39
+
37 40
 /*
38 41
 **  * Global variables
39 42
 **   */
40  
-int mca_bcol_base_output = 0;
41  
-opal_list_t mca_bcol_base_components_opened;
42  
-
43  
-static int mca_bcol_base_verbose = 0;
  43
+MCA_BASE_FRAMEWORK_DECLARE(ompi, bcol, NULL, mca_bcol_base_register, mca_bcol_base_open, NULL,
  44
+                           mca_bcol_base_static_components, 0);
44 45
 
45 46
 OMPI_DECLSPEC opal_list_t mca_bcol_base_components_in_use;
46 47
 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
202 203
     return OMPI_SUCCESS;
203 204
 }
204 205
 
205  
-static int mca_bcol_base_register(int flags)
  206
+static int mca_bcol_base_register(mca_base_register_flag_t flags)
206 207
 {
207  
-    /* Debugging/Verbose output */
208  
-    (void) mca_base_var_register("ompi", "bcol", "base", "verbose",
209  
-                                 "Verbosity level of BCOL framework",
210  
-                                 MCA_BASE_VAR_TYPE_INT, NULL, 0,
211  
-                                 MCA_BASE_VAR_FLAG_SETTABLE,
212  
-                                 OPAL_INFO_LVL_9,
213  
-                                 MCA_BASE_VAR_SCOPE_LOCAL,
214  
-                                 &mca_bcol_base_verbose);
215  
-
216 208
     /* figure out which bcol and sbgp components will actually be used */
217 209
     /* get list of sub-grouping functions to use */
218 210
     ompi_bcol_bcols_string = "basesmuma,basesmuma,iboffload,ptpcoll,ugni";
@@ -230,28 +222,17 @@ static int mca_bcol_base_register(int flags)
230 222
  * Function for finding and opening either all MCA components, or the one
231 223
  * that was specifically requested via a MCA parameter.
232 224
  */
233  
-int mca_bcol_base_open(void)
  225
+static int mca_bcol_base_open(mca_base_open_flag_t flags)
234 226
 {
235 227
     int ret;
236 228
 
237  
-    /*_bcol_base_components_available
238  
-     * Register some MCA parameters
239  
-     */
240  
-    (void) mca_bcol_base_register(0);
241  
-
242  
-     /* get framework id    */
243  
-     mca_bcol_base_output = opal_output_open(NULL);
244  
-     opal_output_set_verbosity(mca_bcol_base_output, mca_bcol_base_verbose);
245  
-
246 229
     /* Open up all available components */
247 230
     if (OMPI_SUCCESS !=
248  
-        mca_base_components_open("bcol", mca_bcol_base_output, mca_bcol_base_static_components,
249  
-                                 &mca_bcol_base_components_opened,
250  
-                                 true)) {
251  
-        return OMPI_ERROR;
  231
+        (ret = mca_base_framework_components_open(&ompi_bcol_base_framework, flags))) {
  232
+        return ret;
252 233
     }
253 234
 
254  
-    ret = mca_bcol_base_set_components_to_use(&mca_bcol_base_components_opened,
  235
+    ret = mca_bcol_base_set_components_to_use(&ompi_bcol_base_framework.framework_components,
255 236
                                               &mca_bcol_base_components_in_use);
256 237
 
257 238
     /* memory registration compatibilities */
2  ompi/mca/bcol/basesmuma/bcol_basesmuma_module.c
@@ -565,7 +565,7 @@ basesmuma_module_enable(mca_bcol_base_module_t *module,
565 565
     memset(&output_buffer[0],0,sizeof(output_buffer));
566 566
     snprintf(output_buffer,sizeof(output_buffer),"%s (cid %d)", comm->c_name,
567 567
                        comm->c_contextid);
568  
-    opal_output_verbose(10, mca_bcol_base_output,
  568
+    opal_output_verbose(10, ompi_bcol_base_framework.framework_output,
569 569
             "bcol:basesmuma:enable: new communicator: %s", output_buffer);
570 570
 
571 571
     /* All done */
3  ompi/mca/bml/base/Makefile.am
@@ -26,6 +26,5 @@ libmca_bml_la_SOURCES += \
26 26
 	base/bml_base_btl.h \
27 27
 	base/bml_base_endpoint.c \
28 28
 	base/bml_base_init.c \
29  
-	base/bml_base_close.c \
30  
-	base/bml_base_open.c \
  29
+	base/bml_base_frame.c \
31 30
 	base/bml_base_ft.c
7  ompi/mca/bml/base/base.h
@@ -23,6 +23,7 @@
23 23
 #include "ompi_config.h"
24 24
 
25 25
 #include "opal/mca/mca.h"
  26
+#include "opal/mca/base/mca_base_framework.h"
26 27
 #include "ompi/mca/bml/bml.h"
27 28
 
28 29
 
@@ -46,10 +47,8 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_bml_base_selected_module_t);
46 47
  * Global functions for MCA: overall BTL open and close
47 48
  */
48 49
 
49  
-OMPI_DECLSPEC  int mca_bml_base_open(void);
50 50
 OMPI_DECLSPEC  int mca_bml_base_init(bool enable_progress_threads, 
51 51
                                      bool enable_mpi_threads);
52  
-OMPI_DECLSPEC  int mca_bml_base_close(void);
53 52
 OMPI_DECLSPEC  bool mca_bml_base_inited(void);
54 53
 
55 54
 OMPI_DECLSPEC  int mca_bml_base_ft_event(int state);
@@ -58,11 +57,9 @@ OMPI_DECLSPEC  int mca_bml_base_ft_event(int state);
58 57
 /*
59 58
  * Globals
60 59
  */
61  
-extern int mca_bml_base_already_opened;
62  
-OMPI_DECLSPEC extern int mca_bml_base_output;
63 60
 OMPI_DECLSPEC extern mca_bml_base_component_t mca_bml_component;
64  
-OMPI_DECLSPEC extern opal_list_t mca_bml_base_components_available; 
65 61
 OMPI_DECLSPEC extern mca_bml_base_module_t mca_bml; 
  62
+OMPI_DECLSPEC extern mca_base_framework_t ompi_bml_base_framework;
66 63
 
67 64
 END_C_DECLS
68 65
 #endif /* MCA_BML_BASE_H */
32  ompi/mca/bml/base/bml_base_open.c → ompi/mca/bml/base/bml_base_frame.c
@@ -28,8 +28,13 @@
28 28
 #include "ompi/mca/bml/base/static-components.h"
29 29
 #include "opal/mca/base/base.h"
30 30
 
31  
-int mca_bml_base_already_opened = 0;
32  
-opal_list_t mca_bml_base_components_available = {{0}};
  31
+static int mca_bml_base_register(mca_base_register_flag_t flags);
  32
+static int mca_bml_base_open(mca_base_open_flag_t flags);
  33
+static int mca_bml_base_close(void);
  34
+
  35
+MCA_BASE_FRAMEWORK_DECLARE(ompi, bml, "BTL Multiplexing Layer", mca_bml_base_register,
  36
+                           mca_bml_base_open, mca_bml_base_close, mca_bml_base_static_components,
  37
+                           0);
33 38
 
34 39
 #if OPAL_ENABLE_DEBUG_RELIABILITY
35 40
 int mca_bml_base_error_rate_floor;
@@ -38,7 +43,7 @@ int mca_bml_base_error_count;
38 43
 static bool mca_bml_base_srand;
39 44
 #endif
40 45
 
41  
-int mca_bml_base_register(int flags)
  46
+static int mca_bml_base_register(mca_base_register_flag_t flags)
42 47
 {
43 48
 #if OPAL_ENABLE_DEBUG_RELIABILITY
44 49
     do {
@@ -77,20 +82,13 @@ int mca_bml_base_register(int flags)
77 82
     return OMPI_SUCCESS;
78 83
 }
79 84
 
80  
-int mca_bml_base_open(void) 
  85
+static int mca_bml_base_open(mca_base_open_flag_t flags) 
81 86
 {
82  
-    /* See if we've already been here */
83  
-    if (++mca_bml_base_already_opened > 1) {
84  
-        return OMPI_SUCCESS;
85  
-    }
86  
-
87  
-    (void) mca_bml_base_register(0);
  87
+    int ret;
88 88
 
89 89
     if(OMPI_SUCCESS !=
90  
-       mca_base_components_open("bml", 0, mca_bml_base_static_components, 
91  
-                                &mca_bml_base_components_available, 
92  
-                                true)) {  
93  
-        return OMPI_ERROR; 
  90
+       (ret = mca_base_framework_components_open(&ompi_bml_base_framework, flags))) {
  91
+        return ret;
94 92
     }
95 93
 
96 94
 #if OPAL_ENABLE_DEBUG_RELIABILITY
@@ -108,6 +106,10 @@ int mca_bml_base_open(void)
108 106
     }
109 107
 #endif
110 108
 
111  
-    return mca_btl_base_open(); 
  109
+    return mca_base_framework_open(&ompi_btl_base_framework, 0);
112 110
 }
113 111
 
  112
+static int mca_bml_base_close( void )
  113
+{
  114
+  return mca_base_framework_close(&ompi_btl_base_framework);
  115
+}
20  ompi/mca/bml/base/bml_base_init.c
@@ -23,8 +23,6 @@
23 23
 #include "opal/mca/mca.h"
24 24
 #include "opal/runtime/opal.h"
25 25
 
26  
-int mca_bml_base_output = -1;
27  
-
28 26
 mca_bml_base_module_t mca_bml = {
29 27
     NULL,                    /* bml_component */
30 28
     NULL,                    /* bml_add_procs */ 
@@ -57,13 +55,13 @@ int mca_bml_base_init( bool enable_progress_threads,
57 55
 
58 56
     init_called = true;
59 57
 
60  
-    for (item = opal_list_get_first(&mca_bml_base_components_available); 
61  
-         opal_list_get_end(&mca_bml_base_components_available) != item; 
  58
+    for (item = opal_list_get_first(&ompi_bml_base_framework.framework_components); 
  59
+         opal_list_get_end(&ompi_bml_base_framework.framework_components) != item; 
62 60
          item = opal_list_get_next(item)) { 
63 61
         cli = (mca_base_component_list_item_t*) item; 
64 62
         component = (mca_bml_base_component_t*) cli->cli_component; 
65 63
         if(NULL == component->bml_init) {
66  
-            opal_output_verbose( 10, mca_bml_base_output, 
  64
+            opal_output_verbose( 10, ompi_bml_base_framework.framework_output, 
67 65
                                  "select: no init function; ignoring component %s", 
68 66
                                  component->bml_version.mca_component_name ); 
69 67
             continue; 
@@ -85,11 +83,9 @@ int mca_bml_base_init( bool enable_progress_threads,
85 83
     if(NULL == best_module) { 
86 84
         return OMPI_SUCCESS; 
87 85
     }
88  
-    else { 
89  
-        mca_bml_component = *best_component; 
90  
-        mca_bml = *best_module; 
91  
-        return mca_base_components_close(mca_bml_base_output, 
92  
-                                         &mca_bml_base_components_available, 
93  
-                                         (mca_base_component_t*) best_component); 
94  
-    }
  86
+
  87
+    mca_bml_component = *best_component; 
  88
+    mca_bml = *best_module; 
  89
+    return mca_base_framework_components_close(&ompi_bml_base_framework,
  90
+                                               (mca_base_component_t*) best_component);
95 91
 }
8  ompi/mca/bml/r2/bml_r2_ft.c
@@ -144,7 +144,7 @@ int mca_bml_r2_ft_event(int state)
144 144
                 opal_output(0, "bml:r2: ft_event(Restart): Failed to finalize BML framework\n");
145 145
                 return ret;
146 146
             }
147  
-            if( OMPI_SUCCESS != (ret = mca_btl_base_close()) ) {
  147
+            if( OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_btl_base_framework)) ) {
148 148
                 opal_output(0, "bml:r2: ft_event(Restart): Failed to close BTL framework\n");
149 149
                 return ret;
150 150
             }
@@ -168,7 +168,7 @@ int mca_bml_r2_ft_event(int state)
168 168
             /*
169 169
              * Re-open the BTL framework to get the full list of components.
170 170
              */
171  
-            if( OMPI_SUCCESS != (ret = mca_btl_base_open()) ) {
  171
+            if( OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_btl_base_framework, 0)) ) {
172 172
                 opal_output(0, "bml:r2: ft_event(Restart): Failed to open BTL framework\n");
173 173
                 return ret;
174 174
             }
@@ -222,7 +222,7 @@ int mca_bml_r2_ft_event(int state)
222 222
             opal_output(0, "bml:r2: ft_event(Restart): Failed to finalize BML framework\n");
223 223
             return ret;
224 224
         }
225  
-        if( OMPI_SUCCESS != (ret = mca_btl_base_close()) ) {
  225
+        if( OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_btl_base_framework)) ) {
226 226
             opal_output(0, "bml:r2: ft_event(Restart): Failed to close BTL framework\n");
227 227
             return ret;
228 228
         }
@@ -253,7 +253,7 @@ int mca_bml_r2_ft_event(int state)
253 253
         opal_output_verbose(11, ompi_cr_output,
254 254
                             "Restart (Previous BTL MCA): <%s>\n", btl_list ? btl_list[0] : "");
255 255
 
256  
-        if( OMPI_SUCCESS != (ret = mca_btl_base_open()) ) {
  256
+        if( OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_btl_base_framework, 0)) ) {
257 257
             opal_output(0, "bml:r2: ft_event(Restart): Failed to open BTL framework\n");
258 258
             return ret;
259 259
         }
3  ompi/mca/btl/base/Makefile.am
@@ -23,8 +23,7 @@ headers += \
23 23
         base/btl_base_error.h
24 24
 
25 25
 libmca_btl_la_SOURCES += \
26  
-        base/btl_base_close.c \
  26
+        base/btl_base_frame.c \
27 27
         base/btl_base_error.c \
28  
-        base/btl_base_open.c \
29 28
         base/btl_base_select.c \
30 29
         base/btl_base_mca.c
6  ompi/mca/btl/base/base.h
@@ -54,9 +54,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_btl_base_selected_module_t);
54 54
  * Global functions for MCA: overall BTL open and close
55 55
  */
56 56
 
57  
-OMPI_DECLSPEC  int mca_btl_base_open(void);
58 57
 OMPI_DECLSPEC  int mca_btl_base_select(bool enable_progress_threads, bool enable_mpi_threads);
59  
-OMPI_DECLSPEC  int mca_btl_base_close(void);
60 58
 OMPI_DECLSPEC  void mca_btl_base_dump(
61 59
     struct mca_btl_base_module_t*,
62 60
     struct mca_btl_base_endpoint_t*,
@@ -68,15 +66,15 @@ OMPI_DECLSPEC  int mca_btl_base_param_verify(mca_btl_base_module_t *module);
68 66
 /*
69 67
  * Globals
70 68
  */
71  
-OMPI_DECLSPEC extern int mca_btl_base_output;
72 69
 extern char* mca_btl_base_include;
73 70
 extern char* mca_btl_base_exclude;
74 71
 extern int mca_btl_base_warn_component_unused;
75 72
 extern int mca_btl_base_already_opened;
76  
-OMPI_DECLSPEC extern opal_list_t mca_btl_base_components_opened;
77 73
 OMPI_DECLSPEC extern opal_list_t mca_btl_base_modules_initialized;
78 74
 OMPI_DECLSPEC extern bool mca_btl_base_thread_multiple_override;
79 75
 
  76
+OMPI_DECLSPEC extern mca_base_framework_t ompi_btl_base_framework;
  77
+
80 78
 END_C_DECLS
81 79
     
82 80
 #endif /* MCA_BTL_BASE_H */
81  ompi/mca/btl/base/btl_base_close.c
... ...
@@ -1,81 +0,0 @@
1  
-/*
2  
- * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
3  
- *                         University Research and Technology
4  
- *                         Corporation.  All rights reserved.
5  
- * Copyright (c) 2004-2007 The University of Tennessee and The University
6  
- *                         of Tennessee Research Foundation.  All rights
7  
- *                         reserved.
8  
- * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
9  
- *                         University of Stuttgart.  All rights reserved.
10  
- * Copyright (c) 2004-2005 The Regents of the University of California.
11  
- *                         All rights reserved.
12  
- * Copyright (c) 2008-2009 Cisco Systems, Inc.  All rights reserved.
13  
- * $COPYRIGHT$
14  
- * 
15  
- * Additional copyrights may follow
16  
- * 
17  
- * $HEADER$
18  
- */
19  
-
20  
-#include "ompi_config.h"
21  
-
22  
-#include <stdio.h>
23  
-
24  
-#include "ompi/constants.h"
25  
-#include "opal/mca/event/event.h"
26  
-#include "opal/mca/mca.h"
27  
-#include "opal/mca/base/base.h"
28  
-#include "ompi/mca/btl/base/base.h"
29  
-
30  
-int mca_btl_base_close(void)
31  
-{
32  
-    opal_list_item_t *item;
33  
-    mca_btl_base_selected_module_t *sm;
34  
-
35  
-    if( mca_btl_base_already_opened <= 0 ) {
36  
-        return OMPI_ERROR;
37  
-    } else if (--mca_btl_base_already_opened > 0) {
38  
-        return OMPI_SUCCESS;
39  
-    }
40  
-#if 0
41  
-    /* disable event processing while cleaning up btls */
42  
-    opal_event_disable();
43  
-#endif
44  
-    /* Finalize all the btl components and free their list items */
45  
-
46  
-    for (item = opal_list_remove_first(&mca_btl_base_modules_initialized);
47  
-         NULL != item; 
48  
-         item = opal_list_remove_first(&mca_btl_base_modules_initialized)) {
49  
-        sm = (mca_btl_base_selected_module_t *) item;
50  
-
51  
-        /* Blatebtly ignore the return code (what would we do to recover,
52  
-           anyway?  This component is going away, so errors don't matter
53  
-           anymore) */
54  
-
55  
-        sm->btl_module->btl_finalize(sm->btl_module);
56  
-        free(sm);
57  
-    }
58  
-
59  
-    /* Close all remaining opened components (may be one if this is a
60  
-       OMPI RTE program, or [possibly] multiple if this is ompi_info) */
61  
-
62  
-    mca_base_components_close(mca_btl_base_output,
63  
-                              &mca_btl_base_components_opened, NULL);
64  
-
65  
-    /* Close the framework output */
66  
-    opal_output_close (mca_btl_base_output);
67  
-    mca_btl_base_output = -1;
68  
-
69  
-    /* cleanup */
70  
-    if(NULL != mca_btl_base_include)
71  
-        free(mca_btl_base_include);
72  
-    if(NULL != mca_btl_base_exclude)
73  
-        free(mca_btl_base_exclude);
74  
-
75  
-#if 0
76  
-    /* restore event processing */
77  
-    opal_event_enable();
78  
-#endif
79  
-    /* All done */
80  
-    return OMPI_SUCCESS;
81  
-}
66  ompi/mca/btl/base/btl_base_open.c → ompi/mca/btl/base/btl_base_frame.c
@@ -70,26 +70,14 @@ OBJ_CLASS_INSTANCE(
70 70
 /*
71 71
  * Global variables
72 72
  */
73  
-int mca_btl_base_output = -1;
74 73
 char* mca_btl_base_include = NULL;
75 74
 char* mca_btl_base_exclude = NULL;
76 75
 int mca_btl_base_warn_component_unused = 1;
77  
-opal_list_t mca_btl_base_components_opened;
78 76
 opal_list_t mca_btl_base_modules_initialized;
79  
-int mca_btl_base_already_opened = 0;
80 77
 bool mca_btl_base_thread_multiple_override = false;
81 78
 
82  
-static int mca_btl_base_register(int flags)
  79
+static int mca_btl_base_register(mca_base_register_flag_t flags)
83 80
 {
84  
-    mca_btl_base_verbose = 0;
85  
-    (void) mca_base_var_register("ompi", "btl", "base", "verbose",
86  
-                                 "Verbosity level of the BTL framework",
87  
-                                 MCA_BASE_VAR_TYPE_INT, NULL, 0,
88  
-                                 MCA_BASE_VAR_FLAG_SETTABLE,
89  
-                                 OPAL_INFO_LVL_9,
90  
-                                 MCA_BASE_VAR_SCOPE_LOCAL,
91  
-                                 &mca_btl_base_verbose);
92  
-
93 81
     /* Override the per-BTL "don't run if THREAD_MULTIPLE selected"
94 82
        embargo? */
95 83
     mca_btl_base_thread_multiple_override = false;
@@ -125,23 +113,15 @@ static int mca_btl_base_register(int flags)
125 113
  * Function for finding and opening either all MCA components, or the one
126 114
  * that was specifically requested via a MCA parameter.
127 115
  */
128  
-int mca_btl_base_open(void)
  116
+static int mca_btl_base_open(mca_base_open_flag_t flags)
129 117
 {
130  
-    int i;
131  
-    if( ++mca_btl_base_already_opened > 1 ) return OMPI_SUCCESS;
132  
-
133  
-    (void) mca_btl_base_register(0);
134  
-
135  
-    /* Verbose output */
136  
-    mca_btl_base_output = opal_output_open(NULL);
137  
-    opal_output_set_verbosity(mca_btl_base_output, mca_btl_base_verbose);
  118
+    int ret;
138 119
 
139 120
     /* Open up all available components */
140 121
     
141 122
     if (OMPI_SUCCESS != 
142  
-        mca_base_components_open("btl", mca_btl_base_output, mca_btl_base_static_components,
143  
-                                 &mca_btl_base_components_opened, true)) {
144  
-        return OMPI_ERROR;
  123
+        (ret = mca_base_framework_components_open(&ompi_btl_base_framework, flags))) {
  124
+        return ret;
145 125
     }
146 126
 
147 127
   /* Initialize the list so that in mca_btl_base_close(), we can
@@ -153,3 +133,39 @@ int mca_btl_base_open(void)
153 133
   /* All done */
154 134
   return OMPI_SUCCESS;
155 135
 }
  136
+
  137
+static int mca_btl_base_close(void)
  138
+{
  139
+    mca_btl_base_selected_module_t *sm;
  140
+
  141
+#if 0
  142
+    /* disable event processing while cleaning up btls */
  143
+    opal_event_disable();
  144
+#endif
  145
+    /* Finalize all the btl components and free their list items */
  146
+
  147
+    OPAL_LIST_FOREACH(sm, &mca_btl_base_modules_initialized, mca_btl_base_selected_module_t) {
  148
+        /* Blatently ignore the return code (what would we do to recover,
  149
+           anyway?  This component is going away, so errors don't matter
  150
+           anymore) */
  151
+
  152
+        sm->btl_module->btl_finalize(sm->btl_module);
  153
+        free(sm);
  154
+    }
  155
+
  156
+    /* Close all remaining opened components (may be one if this is a
  157
+       OMPI RTE program, or [possibly] multiple if this is ompi_info) */
  158
+
  159
+    (void) mca_base_framework_components_close(&ompi_btl_base_framework, NULL);
  160
+
  161
+#if 0
  162
+    /* restore event processing */
  163
+    opal_event_enable();
  164
+#endif
  165
+    /* All done */
  166
+    return OMPI_SUCCESS;
  167
+}
  168
+
  169
+MCA_BASE_FRAMEWORK_DECLARE(ompi, btl, "Byte Transport Layer", mca_btl_base_register,
  170
+                           mca_btl_base_open, mca_btl_base_close, mca_btl_base_static_components,
  171
+                           0);
28  ompi/mca/btl/base/btl_base_select.c
@@ -53,8 +53,7 @@ int mca_btl_base_select(bool enable_progress_threads,
53 53
                         bool enable_mpi_threads)
54 54
 {
55 55
     int i, num_btls;
56  
-    opal_list_item_t *item;
57  
-    mca_base_component_list_item_t *cli;
  56
+    mca_base_component_list_item_t *cli, *next;
58 57
     mca_btl_base_component_t *component;
59 58
     mca_btl_base_module_t **modules;
60 59
     mca_btl_base_selected_module_t *sm;
@@ -65,11 +64,7 @@ int mca_btl_base_select(bool enable_progress_threads,
65 64
     /* Traverse the list of opened modules; call their init
66 65
        functions. */
67 66
 
68  
-    item  = opal_list_get_first(&mca_btl_base_components_opened);
69  
-    while(item != opal_list_get_end(&mca_btl_base_components_opened)) {
70  
-        opal_list_item_t *next = opal_list_get_next(item);
71  
-        cli = (mca_base_component_list_item_t *) item;
72  
-
  67
+    OPAL_LIST_FOREACH_SAFE(cli, next, &ompi_btl_base_framework.framework_components, mca_base_component_list_item_t) {
73 68
         component = (mca_btl_base_component_t *) cli->cli_component;
74 69
 
75 70
         /* if there is an include list - item must be in the list to be included */
@@ -84,7 +79,6 @@ int mca_btl_base_select(bool enable_progress_threads,
84 79
                 argv++;
85 80
             }
86 81
             if(found == false) {
87  
-                item = next;
88 82
                 continue;
89 83
             }
90 84
 
@@ -100,17 +94,16 @@ int mca_btl_base_select(bool enable_progress_threads,
100 94
                 argv++;
101 95
             }
102 96
             if(found == true) {
103  
-                item = next;
104 97
                 continue;
105 98
             }
106 99
         }
107 100
 
108  
-        opal_output_verbose(10, mca_btl_base_output, 
  101
+        opal_output_verbose(10, ompi_btl_base_framework.framework_output, 
109 102
                             "select: initializing %s component %s",
110 103
                             component->btl_version.mca_type_name,
111 104
                             component->btl_version.mca_component_name);
112 105
         if (NULL == component->btl_init) {
113  
-            opal_output_verbose(10, mca_btl_base_output,
  106
+            opal_output_verbose(10, ompi_btl_base_framework.framework_output,
114 107
                                 "select: no init function; ignoring component %s",
115 108
                                 component->btl_version.mca_component_name);
116 109
         } else {
@@ -121,21 +114,19 @@ int mca_btl_base_select(bool enable_progress_threads,
121 114
                list and remove it from the component repository */
122 115
 
123 116
             if (NULL == modules) {
124  
-                opal_output_verbose(10, mca_btl_base_output,
  117
+                opal_output_verbose(10, ompi_btl_base_framework.framework_output,
125 118
                                     "select: init of component %s returned failure",
126 119
                                     component->btl_version.mca_component_name);
127  
-                opal_output_verbose(10, mca_btl_base_output,
128  
-                                    "select: module %s unloaded",
129  
-                                    component->btl_version.mca_component_name);
130 120
 
131  
-                mca_base_component_repository_release((mca_base_component_t *) component);
132  
-                opal_list_remove_item(&mca_btl_base_components_opened, item);
  121
+                opal_list_remove_item(&ompi_btl_base_framework.framework_components, &cli->super);
  122
+                mca_base_component_close((mca_base_component_t *) component,
  123
+                                         ompi_btl_base_framework.framework_output);
133 124
             } 
134 125
 
135 126
             /* Otherwise, if it initialized properly, save it. */
136 127
 
137 128
             else {
138  
-                opal_output_verbose(10, mca_btl_base_output,
  129
+                opal_output_verbose(10, ompi_btl_base_framework.framework_output,
139 130
                                     "select: init of component %s returned success",
140 131
                                     component->btl_version.mca_component_name);
141 132
 
@@ -158,7 +149,6 @@ int mca_btl_base_select(bool enable_progress_threads,
158 149
                 free(modules);
159 150
             }
160 151
         }
161  
-        item = next;
162 152
     }
163 153
 
164 154
     /* Finished querying all components.  Check for the bozo case. */
4  ompi/mca/btl/tcp/btl_tcp_component.c
@@ -544,7 +544,7 @@ static char **split_and_resolve(char **orig_str, char *name)
544 544
             free(tmp);
545 545
             continue;
546 546
         }
547  
-        opal_output_verbose(20, mca_btl_base_output, 
  547
+        opal_output_verbose(20, ompi_btl_base_framework.framework_output, 
548 548
                             "btl: tcp: Searching for %s address+prefix: %s / %u",
549 549
                             name,
550 550
                             opal_net_get_hostname((struct sockaddr*) &argv_inaddr),
@@ -575,7 +575,7 @@ static char **split_and_resolve(char **orig_str, char *name)
575 575
         /* We found a match; get the name and replace it in the
576 576
            argv */
577 577
         opal_ifindextoname(if_index, if_name, sizeof(if_name));
578  
-        opal_output_verbose(20, mca_btl_base_output, 
  578
+        opal_output_verbose(20, ompi_btl_base_framework.framework_output, 
579 579
                             "btl: tcp: Found match: %s (%s)",
580 580
                             opal_net_get_hostname((struct sockaddr*) &if_inaddr),
581 581
                             if_name);
2  ompi/mca/btl/tcp/btl_tcp_endpoint.c
@@ -605,7 +605,7 @@ static int mca_btl_tcp_endpoint_start_connect(mca_btl_base_endpoint_t* btl_endpo
605 605
     /* start the connect - will likely fail with EINPROGRESS */
606 606
     mca_btl_tcp_proc_tosocks(btl_endpoint->endpoint_addr, &endpoint_addr);
607 607
 
608  
-    opal_output_verbose(20, mca_btl_base_output, 
  608
+    opal_output_verbose(20, ompi_btl_base_framework.framework_output, 
609 609
                         "btl: tcp: attempting to connect() to %s address %s on port %d",
610 610
                         OMPI_NAME_PRINT(&btl_endpoint->endpoint_proc->proc_ompi->proc_name),
611 611
                         opal_net_get_hostname((struct sockaddr*) &endpoint_addr),
3  ompi/mca/coll/base/Makefile.am
@@ -23,8 +23,7 @@ headers += \
23 23
         base/coll_tags.h
24 24
 
25 25
 libmca_coll_la_SOURCES += \
26  
-        base/coll_base_close.c \
27 26
         base/coll_base_comm_select.c \
28 27
         base/coll_base_comm_unselect.c \
29 28
         base/coll_base_find_available.c \
30  
-        base/coll_base_open.c
  29
+        base/coll_base_frame.c
83  ompi/mca/coll/base/base.h
@@ -35,34 +35,13 @@
35 35
 
36 36
 #include "mpi.h"
37 37
 #include "opal/class/opal_list.h"
38  
-
  38
+#include "opal/mca/base/base.h"
39 39
 
40 40
 /*
41 41
  * Global functions for MCA overall collective open and close
42 42
  */
43 43
 
44 44
 BEGIN_C_DECLS
45  
-/**
46  
- * Initialize the coll MCA framework
47  
- *
48  
- * @retval OMPI_SUCCESS Upon success
49  
- * @retval OMPI_ERROR Upon failure
50  
- *
51  
- * This must be the first function invoked in the coll MCA
52  
- * framework.  It initializes the coll MCA framework, finds and
53  
- * opens coll components, etc.
54  
- *
55  
- * This function is invoked during ompi_mpi_init() and during the
56  
- * initialization of the special case of the laminfo command.
57  
- * 
58  
- * This function fills in the internal global variable
59  
- * mca_coll_base_components_opened, which is a list of all coll components
60  
- * that were successfully opened.  This variable should \em only be
61  
- * used by other coll base functions -- it is not considered a
62  
- * public interface member -- and is only mentioned here for
63  
- * completeness.
64  
- */
65  
-OMPI_DECLSPEC int mca_coll_base_open(void);
66 45
 
67 46
 /**
68 47
  * Create list of available coll components.
@@ -79,15 +58,10 @@ OMPI_DECLSPEC int mca_coll_base_open(void);
79 58
  * successfully opened coll components and create a list of all
80 59
  * available coll components.
81 60
  *
82  
- * This function traverses the (internal global variable)
83  
- * mca_coll_base_components_opened list and queries each component to see
84  
- * if it ever might want to run during this MPI process.  It creates
85  
- * another internal global variable list named
86  
- * mca_coll_base_components_available, consisting of a list of components
87  
- * that are available for selection when communicators are created.
88  
- * This variable should \em only be used by other coll base
89  
- * functions -- it is not considered a public interface member --
90  
- * and is only mentioned here for completeness.
  61
+ * This function traverses the (internal global variable) framework components
  62
+ * list and queries each component to see if it ever might want to run during
  63
+ * this MPI process.  If a component does not want to run it is closed and
  64
+ * removed from the framework components list.
91 65
  */
92 66
 int mca_coll_base_find_available(bool enable_progress_threads,
93 67
                                  bool enable_mpi_threads);
@@ -147,55 +121,10 @@ int mca_coll_base_comm_select(struct ompi_communicator_t *comm);
147 121
  */
148 122
 int mca_coll_base_comm_unselect(struct ompi_communicator_t *comm);
149 123
 
150  
-/**
151  
- * Shut down the coll MCA framework.
152  
- *
153  
- * @retval OMPI_SUCCESS Always
154  
- *
155  
- * This function shuts down everything in the coll MCA framework,
156  
- * and is called during ompi_mpi_finalize() and the special case of
157  
- * the laminfo command.
158  
- *
159  
- * It must be the last function invoked on the coll MCA framework.
160  
- */
161  
-OMPI_DECLSPEC int mca_coll_base_close(void);
162  
-
163  
-
164 124
 /*
165 125
  * Globals
166 126
  */
167  
-
168  
-/**
169  
- * Coll framework debugging stream ID used with opal_output() and
170  
- * opal_output_verbose().
171  
- */
172  
-OMPI_DECLSPEC extern int mca_coll_base_output;
173  
-
174  
-/**
175  
- * Indicator as to whether the list of opened coll components is valid or
176  
- * not.
177  
- */
178  
-extern bool mca_coll_base_components_opened_valid;
179  
-
180  
-/**
181  
- * List of all opened components; created when the coll framework is
182  
- * initialized and destroyed when we reduce the list to all available
183  
- * coll components.
184  
- */
185  
-OMPI_DECLSPEC extern opal_list_t mca_coll_base_components_opened;
186  
-
187  
-/**
188  
- * Indicator as to whether the list of available coll components is valid
189  
- * or not.
190  
- */
191  
-extern bool mca_coll_base_components_available_valid;
192  
-
193  
-/**
194  
- * List of all available components; created by reducing the list of open
195  
- * components to all those who indicate that they may run during this
196  
- * process.
197  
- */
198  
-extern opal_list_t mca_coll_base_components_available;
  127
+OMPI_DECLSPEC extern mca_base_framework_t ompi_coll_base_framework;
199 128
 
200 129
 END_C_DECLS
201 130
 #endif /* MCA_BASE_COLL_H */
55  ompi/mca/coll/base/coll_base_close.c
... ...
@@ -1,55 +0,0 @@
1  
-/*
2  
- * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3  
- *                         University Research and Technology
4  
- *                         Corporation.  All rights reserved.
5  
- * Copyright (c) 2004-2005 The University of Tennessee and The University
6  
- *                         of Tennessee Research Foundation.  All rights
7  
- *                         reserved.
8  
- * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
9  
- *                         University of Stuttgart.  All rights reserved.
10  
- * Copyright (c) 2004-2005 The Regents of the University of California.
11  
- *                         All rights reserved.
12  
- * $COPYRIGHT$
13  
- * 
14  
- * Additional copyrights may follow
15  
- * 
16  
- * $HEADER$
17  
- */
18  
-
19  
-#include "ompi_config.h"
20  
-
21  
-#include <stdio.h>
22  
-
23  
-#include "ompi/constants.h"
24  
-#include "opal/mca/mca.h"
25  
-#include "opal/mca/base/base.h"
26  
-#include "ompi/mca/coll/base/base.h"
27  
-#include "opal/util/output.h"
28  
-
29  
-int mca_coll_base_close(void)
30  
-{
31  
-    /* Close all components that are still open.  This may be the opened
32  
-     * list (if we're in ompi_info), or it may be the available list (if
33  
-     * we're anywhere else). */
34  
-
35  
-    if (mca_coll_base_components_opened_valid) {
36  
-        mca_base_components_close(mca_coll_base_output,
37  
-                                  &mca_coll_base_components_opened, NULL);
38  
-        OBJ_DESTRUCT(&mca_coll_base_components_opened);
39  
-        mca_coll_base_components_opened_valid = false;
40  
-    } else if (mca_coll_base_components_available_valid) {
41  
-        mca_base_components_close(mca_coll_base_output,
42  
-                                  &mca_coll_base_components_available,
43  
-                                  NULL);
44  
-        OBJ_DESTRUCT(&mca_coll_base_components_available);
45  
-        mca_coll_base_components_available_valid = false;
46  
-    }
47  
-
48  
-    /* Close the framework output */
49  
-    opal_output_close (mca_coll_base_output);
50  
-    mca_coll_base_output = -1;
51  
-
52  
-    /* All done */
53  
-
54  
-    return OMPI_SUCCESS;
55  
-}
64  ompi/mca/coll/base/coll_base_comm_select.c
@@ -101,7 +101,7 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
101 101
     int ret;
102 102
 
103 103
     /* Announce */
104  
-    opal_output_verbose(10, mca_coll_base_output,
  104
+    opal_output_verbose(10, ompi_coll_base_framework.framework_output,
105 105
                         "coll:base:comm_select: new communicator: %s (cid %d)",
106 106
                         comm->c_name, comm->c_contextid);
107 107
 
@@ -109,9 +109,9 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
109 109
      * sentinel values */
110 110
     memset(&comm->c_coll, 0, sizeof(mca_coll_base_comm_coll_t));
111 111
 
112  
-    opal_output_verbose(10, mca_coll_base_output,
  112
+    opal_output_verbose(10, ompi_coll_base_framework.framework_output,
113 113
                         "coll:base:comm_select: Checking all available modules");
114  
-    selectable = check_components(&mca_coll_base_components_available, comm);
  114
+    selectable = check_components(&ompi_coll_base_framework.framework_components, comm);
115 115
 
116 116
     /* Upon return from the above, the modules list will contain the
117 117
        list of modules that returned (priority >= 0).  If we have no
@@ -225,6 +225,19 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
225 225
     return OMPI_SUCCESS;
226 226
 }
227 227
 
  228
+static int avail_coll_compare (opal_list_item_t **a,
  229
+                               opal_list_item_t **b) {
  230
+    avail_coll_t *acoll = (avail_coll_t *) *a;
  231
+    avail_coll_t *bcoll = (avail_coll_t *) *b;
  232
+
  233
+    if (acoll->ac_priority > bcoll->ac_priority) {
  234
+        return 1;
  235
+    } else if (acoll->ac_priority < bcoll->ac_priority) {
  236
+        return -1;
  237
+    }
  238
+
  239
+    return 0;
  240
+}
228 241
 
229 242
 /*
230 243
  * For each module in the list, check and see if it wants to run, and
@@ -237,53 +250,29 @@ static opal_list_t *check_components(opal_list_t * components,
237 250
 {
238 251
     int priority;
239 252
     const mca_base_component_t *component;
240  
-    opal_list_item_t *item, *item2;
  253
+    mca_base_component_list_item_t *cli;
241 254
     mca_coll_base_module_2_0_0_t *module;
242 255
     opal_list_t *selectable;
243  
-    avail_coll_t *avail, *avail2;
  256
+    avail_coll_t *avail;
244 257
 
245 258
     /* Make a list of the components that query successfully */
246 259
     selectable = OBJ_NEW(opal_list_t);
247 260
 
248  
-    /* Scan through the list of components.  This nested loop is
249  
-       O(N^2), but we should never have too many components, so this
250  
-       *hopefully* shouldn't matter... */
251  
-
252  
-    for (item = opal_list_get_first(components);
253  
-         item != opal_list_get_end(components);
254  
-         item = opal_list_get_next(item)) {
255  
-        component = ((mca_base_component_priority_list_item_t *)
256  
-                     item)->super.cli_component;
  261
+    /* Scan through the list of components */
  262
+    OPAL_LIST_FOREACH(cli, &ompi_coll_base_framework.framework_components, mca_base_component_list_item_t) {
  263
+        component = cli->cli_component;
257 264
 
258 265
         priority = check_one_component(comm, component, &module);
259 266
         if (priority >= 0) {
260  
-
261 267
             /* We have a component that indicated that it wants to run
262 268
                by giving us a module */
263 269
             avail = OBJ_NEW(avail_coll_t);
264 270
             avail->ac_priority = priority;
265 271
             avail->ac_module = module;
266 272
 
267  
-            /* Put this item on the list in priority order (lowest
268  
-               priority first).  Should it go first? */
269  
-            for (item2 = opal_list_get_first(selectable);
270  
-                 item2 != opal_list_get_end(selectable);
271  
-                 item2 = opal_list_get_next(item2)) {
272  
-                avail2 = (avail_coll_t *) item2;
273  
-                if (avail->ac_priority < avail2->ac_priority) {
274  
-                    opal_list_insert_pos(selectable,
275  
-                                         item2,
276  
-                                         (opal_list_item_t *) avail);
277  
-                    break;
278  
-                }
279  
-            }