Skip to content
Browse files

Update OPAL frameworks to use the MCA framework system.

  • Loading branch information...
1 parent 8577ab4 commit e44d6aaa4709883c8644a02e8379a56f0b637850 @hjelmn committed Mar 5, 2013
Showing with 518 additions and 1,599 deletions.
  1. +5 −36 opal/mca/backtrace/base/backtrace_component.c
  2. +3 −38 opal/mca/backtrace/base/base.h
  3. +4 −3 opal/mca/compress/base/base.h
  4. +2 −10 opal/mca/compress/base/compress_base_close.c
  5. +17 −45 opal/mca/compress/base/compress_base_open.c
  6. +3 −3 opal/mca/compress/base/compress_base_select.c
  7. +1 −1 opal/mca/compress/bzip/compress_bzip_component.c
  8. +1 −1 opal/mca/compress/gzip/compress_gzip_component.c
  9. +3 −3 opal/mca/crs/base/base.h
  10. +3 −10 opal/mca/crs/base/crs_base_close.c
  11. +7 −7 opal/mca/crs/base/crs_base_fns.c
  12. +22 −58 opal/mca/crs/base/crs_base_open.c
  13. +6 −6 opal/mca/crs/base/crs_base_select.c
  14. +1 −1 opal/mca/crs/blcr/crs_blcr_component.c
  15. +2 −2 opal/mca/crs/blcr/crs_blcr_module.c
  16. +1 −1 opal/mca/crs/dmtcp/crs_dmtcp_component.c
  17. +6 −6 opal/mca/crs/none/crs_none_module.c
  18. +1 −1 opal/mca/crs/self/crs_self_component.c
  19. +2 −11 opal/mca/db/base/base.h
  20. +4 −10 opal/mca/db/base/db_base_close.c
  21. +8 −12 opal/mca/db/base/db_base_open.c
  22. +6 −6 opal/mca/db/base/db_base_select.c
  23. +9 −9 opal/mca/db/hash/db_hash.c
  24. +9 −9 opal/mca/db/pmi/db_pmi.c
  25. +1 −1 opal/mca/db/print/db_print.c
  26. +1 −1 opal/mca/db/sqlite/db_sqlite.c
  27. +0 −1 opal/mca/event/base/Makefile.am
  28. +3 −73 opal/mca/event/base/base.h
  29. +3 −18 opal/mca/event/base/event_base_close.c
  30. +30 −45 opal/mca/event/base/event_base_open.c
  31. +1 −1 opal/mca/event/libevent2019/libevent2019_module.c
  32. +3 −35 opal/mca/hwloc/base/base.h
  33. +6 −10 opal/mca/hwloc/base/hwloc_base_close.c
  34. +1 −1 opal/mca/hwloc/base/hwloc_base_dt.c
  35. +12 −27 opal/mca/hwloc/base/hwloc_base_open.c
  36. +27 −27 opal/mca/hwloc/base/hwloc_base_util.c
  37. +4 −9 opal/mca/if/base/base.h
  38. +25 −95 opal/mca/if/base/if_base_components.c
  39. +6 −10 opal/mca/installdirs/base/base.h
  40. +22 −38 opal/mca/installdirs/base/installdirs_base_components.c
  41. +0 −1 opal/mca/memchecker/base/Makefile.am
  42. +3 −45 opal/mca/memchecker/base/base.h
  43. +0 −34 opal/mca/memchecker/base/memchecker_base_close.c
  44. +3 −57 opal/mca/memchecker/base/memchecker_base_open.c
  45. +2 −2 opal/mca/memchecker/base/memchecker_base_select.c
  46. +0 −1 opal/mca/memcpy/base/Makefile.am
  47. +5 −38 opal/mca/memcpy/base/base.h
  48. +0 −30 opal/mca/memcpy/base/memcpy_base_close.c
  49. +3 −22 opal/mca/memcpy/base/memcpy_base_open.c
  50. +0 −1 opal/mca/memory/base/Makefile.am
  51. +5 −42 opal/mca/memory/base/base.h
  52. +0 −37 opal/mca/memory/base/memory_base_close.c
  53. +16 −10 opal/mca/memory/base/memory_base_open.c
  54. +0 −1 opal/mca/pstat/base/Makefile.am
  55. +3 −27 opal/mca/pstat/base/base.h
  56. +0 −45 opal/mca/pstat/base/pstat_base_close.c
  57. +3 −26 opal/mca/pstat/base/pstat_base_open.c
  58. +2 −2 opal/mca/pstat/base/pstat_base_select.c
  59. +5 −46 opal/mca/shmem/base/base.h
  60. +2 −17 opal/mca/shmem/base/shmem_base_close.c
  61. +20 −71 opal/mca/shmem/base/shmem_base_open.c
  62. +15 −25 opal/mca/shmem/base/shmem_base_select.c
  63. +9 −9 opal/mca/shmem/mmap/shmem_mmap_module.c
  64. +1 −1 opal/mca/shmem/posix/shmem_posix_common_utils.c
  65. +2 −2 opal/mca/shmem/posix/shmem_posix_component.c
  66. +6 −6 opal/mca/shmem/posix/shmem_posix_module.c
  67. +2 −2 opal/mca/shmem/sysv/shmem_sysv_component.c
  68. +6 −6 opal/mca/shmem/sysv/shmem_sysv_module.c
  69. +0 −1 opal/mca/timer/base/Makefile.am
  70. +6 −39 opal/mca/timer/base/base.h
  71. +0 −37 opal/mca/timer/base/timer_base_close.c
  72. +3 −26 opal/mca/timer/base/timer_base_open.c
  73. +3 −3 opal/runtime/opal_cr.c
  74. +19 −14 opal/runtime/opal_finalize.c
  75. +70 −153 opal/runtime/opal_info_support.c
  76. +12 −12 opal/runtime/opal_init.c
  77. +0 −6 opal/runtime/opal_params.c
  78. +15 −15 opal/util/if.c
  79. +2 −2 orte/mca/ess/base/ess_base_std_app.c
  80. +2 −2 orte/mca/ess/base/ess_base_std_orted.c
  81. +2 −2 orte/mca/ess/hnp/ess_hnp_module.c
View
41 opal/mca/backtrace/base/backtrace_component.c
@@ -9,6 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
+ * Copyright (c) 2013 Los Alamos National Security, LLC. All rights
+ * reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@@ -19,13 +21,8 @@
#include "opal_config.h"
-#include "opal/constants.h"
-#include "opal/mca/mca.h"
-#include "opal/mca/base/base.h"
-#include "opal/mca/backtrace/backtrace.h"
#include "opal/mca/backtrace/base/base.h"
-
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
@@ -37,35 +34,7 @@
/*
* Globals
*/
-opal_list_t opal_backtrace_base_components_opened;
-
-
-int
-opal_backtrace_base_open(void)
-{
- /* Open up all available components */
- if (OPAL_SUCCESS !=
- mca_base_components_open("backtrace", 0,
- mca_backtrace_base_static_components,
- &opal_backtrace_base_components_opened,
- true)) {
- return OPAL_ERROR;
- }
-
- /* All done */
- return OPAL_SUCCESS;
-}
-
-
-int
-opal_backtrace_base_close(void)
-{
- /* Close all components that are still open */
- mca_base_components_close(0,
- &opal_backtrace_base_components_opened,
- NULL);
- OBJ_DESTRUCT(&opal_backtrace_base_components_opened);
- /* All done */
- return OPAL_SUCCESS;
-}
+/* Uses default register/open/close functions */
+MCA_BASE_FRAMEWORK_DECLARE(opal, backtrace, NULL, NULL, NULL, NULL,
+ mca_backtrace_base_static_components, 0);
View
41 opal/mca/backtrace/base/base.h
@@ -22,52 +22,17 @@
#include "opal_config.h"
-#include "opal/mca/backtrace/backtrace.h"
+#include "opal/mca/base/mca_base_framework.h"
+#include "opal/mca/backtrace/backtrace.h"
/*
* Global functions for MCA overall backtrace open and close
*/
BEGIN_C_DECLS
- /**
- * Initialize the backtrace MCA framework
- *
- * @retval OPAL_SUCCESS Upon success
- * @retval OPAL_ERROR Upon failure
- *
- * This must be the first function invoked in the backtrace MCA
- * framework. It initializes the backtrace MCA framework, finds
- * and opens backtrace components, etc.
- *
- * This function is invoked during opal_init() and during the
- * initialization of the special case of the laminfo command.
- *
- * This function fills in the internal global variable
- * opal_backtrace_base_components_opened, which is a list of all
- * backtrace components that were successfully opened. This
- * variable should \em only be used by other backtrace base
- * functions -- it is not considered a public interface member --
- * and is only mentioned here for completeness.
- */
- OPAL_DECLSPEC int opal_backtrace_base_open(void);
-
-
- /**
- * Shut down the backtrace MCA framework.
- *
- * @retval OPAL_SUCCESS Always
- *
- * This function shuts down everything in the backtrace MCA
- * framework, and is called during opal_finalize() and the
- * special case of the laminfo command.
- *
- * It must be the last function invoked on the backtrace MCA framework.
- */
- OPAL_DECLSPEC int opal_backtrace_base_close(void);
+OPAL_DECLSPEC extern mca_base_framework_t opal_backtrace_base_framework;
- OPAL_DECLSPEC extern opal_list_t opal_backtrace_base_components_opened;
-
END_C_DECLS
#endif /* OPAL_BASE_BACKTRACE_H */
View
7 opal/mca/compress/base/base.h
@@ -17,6 +17,8 @@
#include "opal/util/opal_environ.h"
#include "opal/runtime/opal_cr.h"
+#include "opal/mca/base/base.h"
+
/*
* Global functions for MCA overall COMPRESS
*/
@@ -33,7 +35,7 @@ extern "C" {
*
* This function is invoked during opal_init();
*/
- OPAL_DECLSPEC int opal_compress_base_open(void);
+ OPAL_DECLSPEC int opal_compress_base_open(mca_base_open_flag_t flags);
/**
* Select an available component.
@@ -58,8 +60,7 @@ extern "C" {
/**
* Globals
*/
- OPAL_DECLSPEC extern int opal_compress_base_output;
- OPAL_DECLSPEC extern opal_list_t opal_compress_base_components_available;
+ OPAL_DECLSPEC extern mca_base_framework_t opal_compress_base_framework;
OPAL_DECLSPEC extern opal_compress_base_component_t opal_compress_base_selected_component;
OPAL_DECLSPEC extern opal_compress_base_module_t opal_compress;
View
12 opal/mca/compress/base/compress_base_close.c
@@ -21,7 +21,7 @@ int opal_compress_base_close(void)
{
/* Compression currently only used with C/R */
if( !opal_cr_is_enabled ) {
- opal_output_verbose(10, opal_compress_base_output,
+ opal_output_verbose(10, opal_compress_base_framework.framework_output,
"compress:open: FT is not enabled, skipping!");
return OPAL_SUCCESS;
}
@@ -32,13 +32,5 @@ int opal_compress_base_close(void)
}
/* Close all available modules that are open */
- mca_base_components_close(opal_compress_base_output,
- &opal_compress_base_components_available,
- NULL);
-
- /* Close the framework output */
- opal_output_close (opal_compress_base_output);
- opal_compress_base_output = -1;
-
- return OPAL_SUCCESS;
+ return mca_base_framework_components_close (&opal_compress_base_framework, NULL);
}
View
62 opal/mca/compress/base/compress_base_open.c
@@ -1,8 +1,9 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
*
- * Copyright (c) 2011-2012 Los Alamos National Security, LLC.
+ * Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* $COPYRIGHT$
*
@@ -26,7 +27,6 @@
/*
* Globals
*/
-int opal_compress_base_output = -1;
opal_compress_base_module_t opal_compress = {
NULL, /* init */
NULL, /* finalize */
@@ -35,21 +35,22 @@ opal_compress_base_module_t opal_compress = {
NULL, /* decompress */
NULL /* decompress_nb */
};
-opal_list_t opal_compress_base_components_available;
+
opal_compress_base_component_t opal_compress_base_selected_component;
-static int opal_compress_base_verbose = 0;
+static int opal_compress_base_register (mca_base_register_flag_t flags);
+
+MCA_BASE_FRAMEWORK_DECLARE(opal, compress, NULL, opal_compress_base_register, opal_compress_base_open,
+ opal_compress_base_close, mca_compress_base_static_components, 0);
-static int opal_compress_base_register(int flags)
+static int opal_compress_base_register (mca_base_register_flag_t flags)
{
- /* Debugging/Verbose output */
- opal_compress_base_verbose = 0;
- (void) mca_base_var_register("opal", "compress", "base", "verbose",
- "Verbosity level of the COMPRESS framework",
- MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
- OPAL_INFO_LVL_9,
- MCA_BASE_VAR_SCOPE_READONLY,
- &opal_compress_base_verbose);
+ /* Compression currently only used with C/R */
+ if( !opal_cr_is_enabled ) {
+ opal_output_verbose(10, opal_compress_base_framework.framework_output,
+ "compress:open: FT is not enabled, skipping!");
+ return OPAL_ERR_NOT_AVAILABLE;
+ }
return OPAL_SUCCESS;
}
@@ -58,44 +59,15 @@ static int opal_compress_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 opal_compress_base_open(void)
+int opal_compress_base_open(mca_base_open_flag_t flags)
{
- int ret, exit_status = OPAL_SUCCESS;
-
- (void) opal_compress_base_register(0);
-
- if(0 != opal_compress_base_verbose) {
- opal_compress_base_output = opal_output_open(NULL);
- } else {
- opal_compress_base_output = -1;
- }
- opal_output_set_verbosity(opal_compress_base_output, opal_compress_base_verbose);
-
/* Compression currently only used with C/R */
if( !opal_cr_is_enabled ) {
- opal_output_verbose(10, opal_compress_base_output,
+ opal_output_verbose(10, opal_compress_base_framework.framework_output,
"compress:open: FT is not enabled, skipping!");
return OPAL_SUCCESS;
}
/* Open up all available components */
- if (OPAL_SUCCESS != (ret = mca_base_components_open("compress",
- opal_compress_base_output,
- mca_compress_base_static_components,
- &opal_compress_base_components_available,
- true)) ) {
- exit_status = OPAL_ERROR;
- if( OPAL_ERR_NOT_FOUND == ret) {
- const char **str_value = NULL;
-
- ret = mca_base_var_find("opal", "compress", NULL, NULL);
- mca_base_var_get_value(ret, &str_value, NULL, NULL);
- if (NULL != str_value && NULL != str_value[0] &&
- 0 == strncmp(str_value[0], "none", strlen("none"))) {
- exit_status = OPAL_SUCCESS;
- }
- }
- }
-
- return exit_status;
+ return mca_base_framework_components_open (&opal_compress_base_framework, flags);
}
View
6 opal/mca/compress/base/compress_base_select.c
@@ -30,16 +30,16 @@ int opal_compress_base_select(void)
/* Compression currently only used with C/R */
if( !opal_cr_is_enabled ) {
- opal_output_verbose(10, opal_compress_base_output,
+ opal_output_verbose(10, opal_compress_base_framework.framework_output,
"compress:open: FT is not enabled, skipping!");
return OPAL_SUCCESS;
}
/*
* Select the best component
*/
- if( OPAL_SUCCESS != mca_base_select("compress", opal_compress_base_output,
- &opal_compress_base_components_available,
+ if( OPAL_SUCCESS != mca_base_select("compress", opal_compress_base_framework.framework_output,
+ &opal_compress_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
/* This will only happen if no component was selected */
View
2 opal/mca/compress/bzip/compress_bzip_component.c
@@ -117,7 +117,7 @@ static int compress_bzip_open(void)
opal_output_set_verbosity(mca_compress_bzip_component.super.output_handle,
mca_compress_bzip_component.super.verbose);
} else {
- mca_compress_bzip_component.super.output_handle = opal_compress_base_output;
+ mca_compress_bzip_component.super.output_handle = opal_compress_base_framework.framework_output;
}
/*
View
2 opal/mca/compress/gzip/compress_gzip_component.c
@@ -118,7 +118,7 @@ static int compress_gzip_open(void)
opal_output_set_verbosity(mca_compress_gzip_component.super.output_handle,
mca_compress_gzip_component.super.verbose);
} else {
- mca_compress_gzip_component.super.output_handle = opal_compress_base_output;
+ mca_compress_gzip_component.super.output_handle = opal_compress_base_framework.framework_output;
}
/*
View
6 opal/mca/crs/base/base.h
@@ -21,6 +21,7 @@
#define OPAL_CRS_BASE_H
#include "opal_config.h"
+#include "opal/mca/base/base.h"
#include "opal/mca/crs/crs.h"
#include "opal/util/opal_environ.h"
#include "opal/runtime/opal_cr.h"
@@ -47,7 +48,7 @@ BEGIN_C_DECLS
*
* This function is invoked during opal_init();
*/
- OPAL_DECLSPEC int opal_crs_base_open(void);
+ OPAL_DECLSPEC int opal_crs_base_open(mca_base_open_flag_t flags);
/**
* Select an available component.
@@ -72,8 +73,7 @@ BEGIN_C_DECLS
/**
* Globals
*/
- OPAL_DECLSPEC extern int opal_crs_base_output;
- OPAL_DECLSPEC extern opal_list_t opal_crs_base_components_available;
+ OPAL_DECLSPEC extern mca_base_framework_t opal_crs_base_framework;
OPAL_DECLSPEC extern opal_crs_base_component_t opal_crs_base_selected_component;
OPAL_DECLSPEC extern opal_crs_base_module_t opal_crs;
View
13 opal/mca/crs/base/crs_base_close.c
@@ -25,7 +25,7 @@
int opal_crs_base_close(void)
{
if( !opal_cr_is_enabled ) {
- opal_output_verbose(10, opal_crs_base_output,
+ opal_output_verbose(10, opal_crs_base_framework.framework_output,
"crs:close: FT is not enabled, skipping!");
return OPAL_SUCCESS;
}
@@ -36,13 +36,6 @@ int opal_crs_base_close(void)
}
/* Close all available modules that are open */
- mca_base_components_close(opal_crs_base_output,
- &opal_crs_base_components_available,
- NULL);
-
- /* Close the framework output */
- opal_output_close (opal_crs_base_output);
- opal_crs_base_output = -1;
-
- return OPAL_SUCCESS;
+ return mca_base_framework_components_close (&opal_crs_base_framework,
+ NULL);
}
View
14 opal/mca/crs/base/crs_base_fns.c
@@ -197,12 +197,12 @@ int opal_crs_base_cleanup_append(char* filename, bool is_dir)
}
if( is_dir ) {
- opal_output_verbose(15, opal_crs_base_output,
+ opal_output_verbose(15, opal_crs_base_framework.framework_output,
"opal:crs: cleanup_append: Append Dir <%s>\n",
filename);
opal_argv_append_nosize(&cleanup_dir_argv, filename);
} else {
- opal_output_verbose(15, opal_crs_base_output,
+ opal_output_verbose(15, opal_crs_base_framework.framework_output,
"opal:crs: cleanup_append: Append File <%s>\n",
filename);
opal_argv_append_nosize(&cleanup_file_argv, filename);
@@ -221,7 +221,7 @@ int opal_crs_base_cleanup_flush(void)
if( NULL != cleanup_file_argv ) {
argc = opal_argv_count(cleanup_file_argv);
for( i = 0; i < argc; ++i) {
- opal_output_verbose(15, opal_crs_base_output,
+ opal_output_verbose(15, opal_crs_base_framework.framework_output,
"opal:crs: cleanup_flush: Remove File <%s>\n", cleanup_file_argv[i]);
unlink(cleanup_file_argv[i]);
}
@@ -236,7 +236,7 @@ int opal_crs_base_cleanup_flush(void)
if( NULL != cleanup_dir_argv ) {
argc = opal_argv_count(cleanup_dir_argv);
for( i = 0; i < argc; ++i) {
- opal_output_verbose(15, opal_crs_base_output,
+ opal_output_verbose(15, opal_crs_base_framework.framework_output,
"opal:crs: cleanup_flush: Remove Dir <%s>\n", cleanup_dir_argv[i]);
opal_os_dirpath_destroy(cleanup_dir_argv[i], true, NULL);
}
@@ -283,13 +283,13 @@ int opal_crs_base_copy_options(opal_crs_base_ckpt_options_t *from,
opal_crs_base_ckpt_options_t *to)
{
if( NULL == from ) {
- opal_output(opal_crs_base_output,
+ opal_output(opal_crs_base_framework.framework_output,
"opal:crs:base: copy_options: Error: from value is NULL\n");
return OPAL_ERROR;
}
if( NULL == to ) {
- opal_output(opal_crs_base_output,
+ opal_output(opal_crs_base_framework.framework_output,
"opal:crs:base: copy_options: Error: to value is NULL\n");
return OPAL_ERROR;
}
@@ -311,7 +311,7 @@ int opal_crs_base_copy_options(opal_crs_base_ckpt_options_t *from,
int opal_crs_base_clear_options(opal_crs_base_ckpt_options_t *target)
{
if( NULL == target ) {
- opal_output(opal_crs_base_output,
+ opal_output(opal_crs_base_framework.framework_output,
"opal:crs:base: copy_options: Error: target value is NULL\n");
return OPAL_ERROR;
}
View
80 opal/mca/crs/base/crs_base_open.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
@@ -8,7 +9,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Evergrid, Inc. All rights reserved.
- * Copyright (c) 2011-2012 Los Alamos National Security, LLC.
+ * Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
*
* $COPYRIGHT$
@@ -36,7 +37,6 @@
/*
* Globals
*/
-int opal_crs_base_output = -1;
opal_crs_base_module_t opal_crs = {
NULL, /* crs_init */
NULL, /* crs_finalize */
@@ -47,15 +47,20 @@ opal_crs_base_module_t opal_crs = {
NULL, /* crs_prelaunch */
NULL /* crs_reg_thread */
};
-opal_list_t opal_crs_base_components_available;
+
opal_crs_base_component_t opal_crs_base_selected_component;
-bool crs_base_do_not_select = false;
+extern bool opal_crs_base_do_not_select;
+static int opal_crs_base_register (mca_base_register_flag_t flags);
-static int crs_base_verbose = 0;
+/* Use default select */
+MCA_BASE_FRAMEWORK_DECLARE(opal, crs, "Checkpoint and Restart Service (CRS)",
+ opal_crs_base_register, opal_crs_base_open,
+ opal_crs_base_close, mca_crs_base_static_components, 0);
-static int opal_crs_base_register(int flags)
+static int opal_crs_base_register (mca_base_register_flag_t flags)
{
+ int ret;
/*
* Note: If we are a tool, then we will manually run the selection routine
* for the checkpointer. The tool will set the MCA parameter
@@ -65,69 +70,28 @@ static int opal_crs_base_register(int flags)
* that indicates the checkpointer to be used after calling opal_init.
* Therefore it would need to select a specific module, but it doesn't
* know which one until later. It will set the MCA parameter 'crs'
- * before calling this function.
+ * before calling select.
*/
- crs_base_do_not_select = false;
- (void) mca_base_var_register("opal", "crs", "base", "do_not_select",
- "Do not do the selection of the CRS component",
- MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_INTERNAL,
- OPAL_INFO_LVL_9,
- MCA_BASE_VAR_SCOPE_READONLY, &crs_base_do_not_select);
-
-
- /* Debugging/Verbose output */
- crs_base_verbose = 0;
- (void) mca_base_var_register("opal", "crs", "base", "verbose",
- "Verbosity level of the CRS framework",
- MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
- OPAL_INFO_LVL_9,
- MCA_BASE_VAR_SCOPE_READONLY,
- &crs_base_verbose);
+ ret = mca_base_framework_var_register (&opal_crs_base_framework, "do_not_select",
+ "Do not do the selection of the CRS component",
+ MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE |
+ MCA_BASE_VAR_FLAG_INTERNAL, OPAL_INFO_LVL_9,
+ MCA_BASE_VAR_SCOPE_ALL_EQ, &opal_crs_base_do_not_select);
- return OPAL_SUCCESS;
+ return (0 > ret) ? ret : OPAL_SUCCESS;
}
/**
* Function for finding and opening either all MCA components,
* or the one that was specifically requested via a MCA parameter.
*/
-int opal_crs_base_open(void)
+int opal_crs_base_open(mca_base_open_flag_t flags)
{
- int ret, exit_status = OPAL_SUCCESS;
-
- (void) opal_crs_base_register(0);
-
- if(0 != crs_base_verbose) {
- opal_crs_base_output = opal_output_open(NULL);
- } else {
- opal_crs_base_output = -1;
- }
- opal_output_set_verbosity(opal_crs_base_output, crs_base_verbose);
-
if( !opal_cr_is_enabled ) {
- opal_output_verbose(10, opal_crs_base_output,
+ opal_output_verbose(10, opal_crs_base_framework.framework_output,
"crs:open: FT is not enabled, skipping!");
- return OPAL_SUCCESS;
- }
-
- /* Open up all available components */
- if (OPAL_SUCCESS != (ret = mca_base_components_open("crs",
- opal_crs_base_output,
- mca_crs_base_static_components,
- &opal_crs_base_components_available,
- true)) ) {
- exit_status = OPAL_ERROR;
- if( OPAL_ERR_NOT_FOUND == ret) {
- const char **str_value = NULL;
-
- ret = mca_base_var_find("opal", "crs", NULL, NULL);
- mca_base_var_get_value(ret, &str_value, NULL, NULL);
- if (NULL != str_value && NULL != str_value[0] &&
- 0 == strncmp(str_value[0], "none", strlen("none"))) {
- exit_status = OPAL_SUCCESS;
- }
- }
+ return OPAL_ERR_NOT_AVAILABLE;;
}
- return exit_status;
+ return mca_base_framework_components_open (&opal_crs_base_framework, flags);
}
View
12 opal/mca/crs/base/crs_base_select.c
@@ -29,7 +29,7 @@
#include "opal/mca/crs/crs.h"
#include "opal/mca/crs/base/base.h"
-extern bool crs_base_do_not_select;
+bool opal_crs_base_do_not_select = false;
int opal_crs_base_select(void)
{
@@ -38,22 +38,22 @@ int opal_crs_base_select(void)
opal_crs_base_module_t *best_module = NULL;
if( !opal_cr_is_enabled ) {
- opal_output_verbose(10, opal_crs_base_output,
+ opal_output_verbose(10, opal_crs_base_framework.framework_output,
"crs:select: FT is not enabled, skipping!");
return OPAL_SUCCESS;
}
- if( crs_base_do_not_select ) {
- opal_output_verbose(10, opal_crs_base_output,
+ if( opal_crs_base_do_not_select ) {
+ opal_output_verbose(10, opal_crs_base_framework.framework_output,
"crs:select: Not selecting at this time!");
return OPAL_SUCCESS;
}
/*
* Select the best component
*/
- if( OPAL_SUCCESS != mca_base_select("crs", opal_crs_base_output,
- &opal_crs_base_components_available,
+ if( OPAL_SUCCESS != mca_base_select("crs", opal_crs_base_framework.framework_output,
+ &opal_crs_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
/* This will only happen if no component was selected */
View
2 opal/mca/crs/blcr/crs_blcr_component.c
@@ -115,7 +115,7 @@ static int crs_blcr_open(void)
opal_output_set_verbosity(mca_crs_blcr_component.super.output_handle,
mca_crs_blcr_component.super.verbose);
} else {
- mca_crs_blcr_component.super.output_handle = opal_crs_base_output;
+ mca_crs_blcr_component.super.output_handle = opal_crs_base_framework.framework_output;
}
/*
View
4 opal/mca/crs/blcr/crs_blcr_module.c
@@ -521,7 +521,7 @@ int opal_crs_blcr_restart(opal_crs_base_snapshot_t *base_snapshot, bool spawn_ch
* along very well.
*/
opal_progress_finalize();
- opal_event_base_close();
+ (void) mca_base_framework_close(&opal_event_base_framework);
if (!spawn_child) {
cr_full_cmd = opal_argv_join(cr_argv, ' ');
@@ -705,7 +705,7 @@ static int opal_crs_blcr_restart_cmd(char *fname, char **cmd)
"crs:blcr: restart_cmd(%s, ---)", fname);
if (NULL == fname) {
- opal_output_verbose(10, opal_crs_base_output,
+ opal_output_verbose(10, opal_crs_base_framework.framework_output,
"crs:blcr: restart_cmd: Error: filename is NULL!");
return OPAL_CRS_ERROR;
}
View
2 opal/mca/crs/dmtcp/crs_dmtcp_component.c
@@ -106,7 +106,7 @@ static int crs_dmtcp_open(void)
opal_output_set_verbosity(mca_crs_dmtcp_component.super.output_handle,
mca_crs_dmtcp_component.super.verbose);
} else {
- mca_crs_dmtcp_component.super.output_handle = opal_crs_base_output;
+ mca_crs_dmtcp_component.super.output_handle = opal_crs_base_framework.framework_output;
}
/*
View
12 opal/mca/crs/none/crs_none_module.c
@@ -108,15 +108,15 @@ int opal_crs_none_restart(opal_crs_base_snapshot_t *base_snapshot, bool spawn_ch
opal_crs_base_metadata_read_token(base_snapshot->metadata, CRS_METADATA_CONTEXT, &tmp_argv);
if( NULL == tmp_argv ) {
- opal_output(opal_crs_base_output,
+ opal_output(opal_crs_base_framework.framework_output,
"crs:none: none_restart: Error: Failed to read the %s token from the local checkpoint in %s",
CRS_METADATA_CONTEXT, base_snapshot->metadata_filename);
exit_status = OPAL_ERROR;
goto cleanup;
}
if( opal_argv_count(tmp_argv) <= 0 ) {
- opal_output_verbose(10, opal_crs_base_output,
+ opal_output_verbose(10, opal_crs_base_framework.framework_output,
"crs:none: none_restart: No command line to exec, so just returning");
exit_status = OPAL_SUCCESS;
goto cleanup;
@@ -128,23 +128,23 @@ int opal_crs_none_restart(opal_crs_base_snapshot_t *base_snapshot, bool spawn_ch
}
if( !spawn_child ) {
- opal_output_verbose(10, opal_crs_base_output,
+ opal_output_verbose(10, opal_crs_base_framework.framework_output,
"crs:none: none_restart: exec :(%s, %s):",
strdup(cr_argv[0]),
opal_argv_join(cr_argv, ' '));
status = execvp(strdup(cr_argv[0]), cr_argv);
if(status < 0) {
- opal_output(opal_crs_base_output,
+ opal_output(opal_crs_base_framework.framework_output,
"crs:none: none_restart: Child failed to execute :(%d):", status);
}
- opal_output(opal_crs_base_output,
+ opal_output(opal_crs_base_framework.framework_output,
"crs:none: none_restart: execvp returned %d", status);
exit_status = status;
goto cleanup;
} else {
- opal_output(opal_crs_base_output,
+ opal_output(opal_crs_base_framework.framework_output,
"crs:none: none_restart: Spawn not implemented");
exit_status = OPAL_ERR_NOT_IMPLEMENTED;
goto cleanup;
View
2 opal/mca/crs/self/crs_self_component.c
@@ -147,7 +147,7 @@ static int crs_self_open(void)
opal_output_set_verbosity(mca_crs_self_component.super.output_handle,
mca_crs_self_component.super.verbose);
} else {
- mca_crs_self_component.super.output_handle = opal_crs_base_output;
+ mca_crs_self_component.super.output_handle = opal_crs_base_framework.framework_output;
}
/*
View
13 opal/mca/db/base/base.h
@@ -17,28 +17,21 @@
#include "opal/types.h"
#include "opal/mca/mca.h"
+#include "opal/mca/base/mca_base_framework.h"
#include "opal/class/opal_list.h"
#include "opal/dss/dss.h"
#include "opal/mca/db/db.h"
BEGIN_C_DECLS
-/**
- * Open the db framework
- */
-OPAL_DECLSPEC int opal_db_base_open(void);
+OPAL_DECLSPEC extern mca_base_framework_t opal_db_base_framework;
/**
* Select a db module
*/
OPAL_DECLSPEC int opal_db_base_select(void);
-/**
- * Close the db framework
- */
-OPAL_DECLSPEC int opal_db_base_close(void);
-
typedef struct {
opal_list_item_t super;
int pri;
@@ -48,8 +41,6 @@ typedef struct {
OBJ_CLASS_DECLARATION(opal_db_active_module_t);
typedef struct {
- int output;
- opal_list_t available_components;
opal_list_t store_order;
opal_list_t fetch_order;
} opal_db_base_t;
View
14 opal/mca/db/base/db_base_close.c
@@ -23,21 +23,15 @@
extern opal_list_t opal_db_base_components_available;
int
+opal_db_base_close(void);
+
+int
opal_db_base_close(void)
{
if (NULL != opal_db.finalize) {
opal_db.finalize();
}
-
- mca_base_components_close(opal_db_base.output,
- &opal_db_base.available_components, NULL);
-
- OBJ_DESTRUCT(&opal_db_base.available_components);
-
- /* Close the framework output */
- opal_output_close (opal_db_base.output);
- opal_db_base.output = -1;
- return OPAL_SUCCESS;
+ return mca_base_framework_components_close(&opal_db_base_framework, NULL);
}
View
20 opal/mca/db/base/db_base_open.c
@@ -41,25 +41,21 @@ opal_db_base_module_t opal_db = {
};
opal_db_base_t opal_db_base;
-int opal_db_base_open(void)
+/* Declared in opal_db_close.c */
+int opal_db_base_close(void);
+
+static int opal_db_base_open(mca_base_open_flag_t flags)
{
- opal_db_base.output = opal_output_open(NULL);
-
- OBJ_CONSTRUCT(&opal_db_base.available_components, opal_list_t);
OBJ_CONSTRUCT(&opal_db_base.fetch_order, opal_list_t);
OBJ_CONSTRUCT(&opal_db_base.store_order, opal_list_t);
/* Open up all available components */
- if (OPAL_SUCCESS !=
- mca_base_components_open("db", opal_db_base.output, mca_db_base_static_components,
- &opal_db_base.available_components,
- true)) {
- return OPAL_ERROR;
- }
-
- return OPAL_SUCCESS;
+ return mca_base_framework_components_open(&opal_db_base_framework, flags);
}
+MCA_BASE_FRAMEWORK_DECLARE(opal, db, NULL, NULL, opal_db_base_open, opal_db_base_close,
+ mca_db_base_static_components, 0);
+
OBJ_CLASS_INSTANCE(opal_db_active_module_t,
opal_list_item_t,
NULL, NULL);
View
12 opal/mca/db/base/db_base_select.c
@@ -38,30 +38,30 @@ opal_db_base_select(void)
selected = true;
/* Query all available components and ask if they have a module */
- OPAL_LIST_FOREACH(cli, &opal_db_base.available_components, mca_base_component_list_item_t) {
+ OPAL_LIST_FOREACH(cli, &opal_db_base_framework.framework_components, mca_base_component_list_item_t) {
component = (opal_db_base_component_t *) cli->cli_component;
- opal_output_verbose(5, opal_db_base.output,
+ opal_output_verbose(5, opal_db_base_framework.framework_output,
"mca:db:select: checking available component %s",
component->base_version.mca_component_name);
/* If there's no query function, skip it */
if (NULL == component->query) {
- opal_output_verbose(5, opal_db_base.output,
+ opal_output_verbose(5, opal_db_base_framework.framework_output,
"mca:db:select: Skipping component [%s]. It does not implement a query function",
component->base_version.mca_component_name );
continue;
}
/* Query the component */
- opal_output_verbose(5, opal_db_base.output,
+ opal_output_verbose(5, opal_db_base_framework.framework_output,
"mca:db:select: Querying component [%s]",
component->base_version.mca_component_name);
rc = component->query(&module, &store, &fetch);
/* If no module was returned, then skip component */
if (OPAL_SUCCESS != rc || NULL == module) {
- opal_output_verbose(5, opal_db_base.output,
+ opal_output_verbose(5, opal_db_base_framework.framework_output,
"mca:db:select: Skipping component [%s]. Query failed to return a module",
component->base_version.mca_component_name );
continue;
@@ -118,7 +118,7 @@ opal_db_base_select(void)
}
}
- if (4 < opal_output_get_verbosity(opal_db_base.output)) {
+ if (4 < opal_output_get_verbosity(opal_db_base_framework.framework_output)) {
opal_output(0, "Final db priorities");
/* show the prioritized list */
OPAL_LIST_FOREACH(mod, &opal_db_base.store_order, opal_db_active_module_t) {
View
18 opal/mca/db/hash/db_hash.c
@@ -164,14 +164,14 @@ static int store(const opal_identifier_t id,
/* we are at the bottom of the store priorities, so
* if this fell to us, we store it
*/
- opal_output_verbose(1, opal_db_base.output,
+ opal_output_verbose(1, opal_db_base_framework.framework_output,
"db:hash:store storing data for proc %" PRIu64 " at locality %d",
id, (int)locality);
/* lookup the proc data object for this proc */
if (NULL == (proc_data = lookup_opal_proc(&hash_data, id))) {
/* unrecoverable error */
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:hash:store: storing key %s[%s] for proc %" PRIu64 " unrecoverably failed",
key, opal_dss.lookup_data_type(type), id));
return OPAL_ERR_OUT_OF_RESOURCE;
@@ -181,7 +181,7 @@ static int store(const opal_identifier_t id,
* a pre-existing value
*/
kv = lookup_keyval(proc_data, key);
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:hash:store: %s key %s[%s] for proc %" PRIu64 "",
(NULL == kv ? "storing" : "updating"),
key, opal_dss.lookup_data_type(type), id));
@@ -269,14 +269,14 @@ static int store_pointer(opal_identifier_t id,
/* we are at the bottom of the store priorities, so
* if this fell to us, we store it
*/
- opal_output_verbose(1, opal_db_base.output,
+ opal_output_verbose(1, opal_db_base_framework.framework_output,
"db:hash:store storing data for proc %" PRIu64 " at locality %d",
id, (int)locality);
/* lookup the proc data object for this proc */
if (NULL == (proc_data = lookup_opal_proc(&hash_data, id))) {
/* unrecoverable error */
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:hash:store: storing key %s[%s] for proc %" PRIu64 " unrecoverably failed",
kv->key, opal_dss.lookup_data_type(kv->type), id));
return OPAL_ERR_OUT_OF_RESOURCE;
@@ -286,7 +286,7 @@ static int store_pointer(opal_identifier_t id,
* a pre-existing value
*/
k2 = lookup_keyval(proc_data, kv->key);
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:hash:store: %s pointer of key %s[%s] for proc %" PRIu64 "",
(NULL == k2 ? "storing" : "updating"),
kv->key, opal_dss.lookup_data_type(kv->type), id));
@@ -305,7 +305,7 @@ static int fetch(opal_identifier_t id,
opal_value_t *kv;
opal_byte_object_t *boptr;
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:hash:fetch: searching for key %s[%s] on proc %" PRIu64 "",
(NULL == key) ? "NULL" : key,
opal_dss.lookup_data_type(type), id));
@@ -394,7 +394,7 @@ static int fetch_pointer(opal_identifier_t id,
proc_data_t *proc_data;
opal_value_t *kv;
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:hash:fetch_pointer: searching for key %s on proc %" PRIu64 "",
(NULL == key) ? "NULL" : key, id));
@@ -471,7 +471,7 @@ static int fetch_multiple(opal_identifier_t id,
char *srchkey, *ptr;
size_t len = 0;
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:hash:fetch_multiple: searching for key %s on proc %" PRIu64 "",
(NULL == key) ? "NULL" : key, id));
View
18 opal/mca/db/pmi/db_pmi.c
@@ -141,7 +141,7 @@ static int store(opal_identifier_t proc,
return OPAL_ERR_TAKE_NEXT_OPTION;
}
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:pmi:store: storing key %s[%s] for proc %" PRIu64 "",
key, opal_dss.lookup_data_type(type), proc));
@@ -222,7 +222,7 @@ static int store(opal_identifier_t proc,
* required to hold the entire string
*/
asprintf(&pmidata, "%d:%s", opal_argv_count(strdata), strdata[0]);
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:pmi:store: storing key %s data %s",
pmikey, pmidata));
@@ -237,7 +237,7 @@ static int store(opal_identifier_t proc,
/* for each remaining segment, augment the key with the index */
for (i=1; NULL != strdata[i]; i++) {
asprintf(&tmpkey, "%s:%d", pmikey, i);
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:pmi:store: storing key %s data %s",
pmikey, strdata[i]));
@@ -298,7 +298,7 @@ static int store(opal_identifier_t proc,
return OPAL_ERR_NOT_SUPPORTED;
}
- OPAL_OUTPUT_VERBOSE((10, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((10, opal_db_base_framework.framework_output,
"PUTTING KEY %s DATA %s",
pmikey, pmidata));
@@ -323,7 +323,7 @@ static int store_pointer(opal_identifier_t proc,
return OPAL_ERR_TAKE_NEXT_OPTION;
}
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:pmi:store: storing pointer of key %s for proc %" PRIu64 "",
kv->key, proc));
@@ -350,7 +350,7 @@ static char* fetch_string(const char *key)
return NULL;
}
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:pmi:fetch_string: received key %s DATA %s",
key, tmp_val));
@@ -376,7 +376,7 @@ static char* fetch_string(const char *key)
free(data);
return NULL;
}
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:pmi:fetch_string: received key %s DATA %s",
tmpkey, tmp_val));
@@ -451,7 +451,7 @@ static int fetch(const opal_identifier_t proc,
char tmp_val[1024];
size_t sval;
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:pmi:fetch: searching for key %s[%s] on proc %" PRIu64 "",
(NULL == key) ? "NULL" : key,
opal_dss.lookup_data_type(type), proc));
@@ -538,7 +538,7 @@ static int fetch_multiple(opal_identifier_t proc,
opal_list_t *kvs)
{
- OPAL_OUTPUT_VERBOSE((5, opal_db_base.output,
+ OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:pmi:fetch_multiple: searching for key %s on proc %" PRIu64 "",
(NULL == key) ? "NULL" : key, proc));
View
2 opal/mca/db/print/db_print.c
@@ -98,7 +98,7 @@ static int add_log(const char *table,
int i;
bool found;
- opal_output_verbose(2, opal_db_base.output,
+ opal_output_verbose(2, opal_db_base_framework.framework_output,
"Logging data for table %s", table);
found = false;
View
2 opal/mca/db/sqlite/db_sqlite.c
@@ -119,7 +119,7 @@ static int add_log(const char *table,
char *sql, **cmd = NULL, *tmp;
sqlite3_stmt *stmt;
- opal_output_verbose(2, opal_db_base.output,
+ opal_output_verbose(2, opal_db_base_framework.framework_output,
"%s Logging data for table %s",
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), table);
View
1 opal/mca/event/base/Makefile.am
@@ -11,6 +11,5 @@ headers += \
base/base.h
libmca_event_la_SOURCES += \
- base/event_base_close.c \
base/event_base_open.c
View
76 opal/mca/event/base/base.h
@@ -15,7 +15,7 @@
#include "opal_config.h"
#include "opal/class/opal_pointer_array.h"
-
+#include "opal/mca/base/base.h"
#include "opal/mca/event/event.h"
/*
@@ -24,80 +24,10 @@
BEGIN_C_DECLS
-extern int opal_event_base_inited;
-
-/**
- * Initialize the event MCA framework
- *
- * @retval OPAL_SUCCESS Upon success
- * @retval OPAL_ERROR Upon failure
- *
- * This must be the first function invoked in the event MCA
- * framework. It initializes the event MCA framework, finds
- * and opens event components, etc.
- *
- * This function is invoked during opal_init().
- *
- * This function fills in the internal global variable
- * opal_event_base_components_opened, which is a list of all
- * event components that were successfully opened. This
- * variable should \em only be used by other event base
- * functions -- it is not considered a public interface member --
- * and is only mentioned here for completeness.
- */
-OPAL_DECLSPEC int opal_event_base_open(void);
-
-/**
- * Select an available component.
- *
- * @return OPAL_SUCCESS Upon success.
- * @return OPAL_NOT_FOUND If no component can be selected.
- * @return OPAL_ERROR Upon other failure.
- *
- * This function invokes the selection process for event components,
- * which works as follows:
- *
- * - If the \em event MCA parameter is not specified, the
- * selection set is all available event components.
- * - If the \em event MCA parameter is specified, the
- * selection set is just that component.
- * - All components in the selection set are queried to see if
- * they want to run. All components that want to run are ranked
- * by their priority and the highest priority component is
- * selected. All non-selected components have their "close"
- * function invoked to let them know that they were not selected.
- * - The selected component will have its "init" function invoked to
- * let it know that it was selected.
- *
- * If we fall through this entire process and no component is
- * selected, then return OPAL_NOT_FOUND (this is not a fatal
- * error).
- *
- * At the end of this process, we'll either have a single
- * component that is selected and initialized, or no component was
- * selected. If no component was selected, subsequent invocation
- * of the event wrapper functions will return an error.
- */
-OPAL_DECLSPEC int opal_event_base_select(void);
-
-/**
- * Shut down the event MCA framework.
- *
- * @retval OPAL_SUCCESS Always
- *
- * This function shuts down everything in the event MCA
- * framework, and is called during opal_finalize().
- *
- * It must be the last function invoked on the event MCA
- * framework.
- */
-OPAL_DECLSPEC int opal_event_base_close(void);
-
/**
- * Debugging output stream
+ * Event framework
*/
-OPAL_DECLSPEC extern int opal_event_base_output;
-OPAL_DECLSPEC extern opal_list_t opal_event_components;
+OPAL_DECLSPEC extern mca_base_framework_t opal_event_base_framework;
END_C_DECLS
View
21 opal/mca/event/base/event_base_close.c
@@ -17,24 +17,9 @@
int opal_event_base_close(void)
{
- opal_list_item_t *item;
-
opal_event_base_inited--;
- /* no need to close the component as it was statically opened */
-
- /* for support of tools such as ompi_info */
- for (item = opal_list_remove_first(&opal_event_components);
- NULL != item;
- item = opal_list_remove_first(&opal_event_components)) {
- OBJ_RELEASE(item);
- }
- OBJ_DESTRUCT(&opal_event_components);
-
- /* Close the framework output */
- opal_output_close (opal_event_base_output);
- opal_event_base_output = -1;
-
- /* All done */
- return OPAL_SUCCESS;
+ /* cleanup components even though they are statically opened */
+ return mca_base_framework_components_close (&opal_event_base_framework,
+ NULL);
}
View
75 opal/mca/event/base/event_base_open.c
@@ -26,60 +26,45 @@
*/
#include "opal/mca/event/base/static-components.h"
+/**
+ * Initialize the event MCA framework
+ *
+ * @retval OPAL_SUCCESS Upon success
+ * @retval OPAL_ERROR Upon failure
+ *
+ * This must be the first function invoked in the event MCA
+ * framework. It initializes the event MCA framework, finds
+ * and opens event components, etc.
+ *
+ * This function is invoked during opal_init().
+ *
+ * This function fills in the internal global variable
+ * opal_event_base_components_opened, which is a list of all
+ * event components that were successfully opened. This
+ * variable should \em only be used by other event base
+ * functions -- it is not considered a public interface member --
+ * and is only mentioned here for completeness.
+ */
+static int opal_event_base_open(mca_base_open_flag_t flags);
+/* Use default register and close function */
+MCA_BASE_FRAMEWORK_DECLARE(opal, event, NULL, NULL, opal_event_base_open,
+ NULL, mca_event_base_static_components,
+ 0);
+
/*
* Globals
*/
-int opal_event_base_output = -1;
-opal_list_t opal_event_components;
opal_event_base_t *opal_event_base=NULL;
-int opal_event_base_inited = 0;
-
-/*
- * Locals
- */
-static int opal_event_base_verbose = 0;
-static int opal_event_base_register(int flags)
+static int opal_event_base_open(mca_base_open_flag_t flags)
{
- /* Debugging / verbose output */
- opal_event_base_verbose = 0;
- (void) mca_base_var_register("opal", "event", "base", "verbose",
- "Verbosity level of the event framework",
- MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
- OPAL_INFO_LVL_9,
- MCA_BASE_VAR_SCOPE_READONLY,
- &opal_event_base_verbose);
-
- return OPAL_SUCCESS;
-}
+ int rc = OPAL_SUCCESS;
-int opal_event_base_open(void)
-{
- int rc;
+ /* Silence compiler warning */
+ (void) flags;
- if( opal_event_base_inited++ < 0 ) {
- return OPAL_SUCCESS;
- }
-
- (void) opal_event_base_register(0);
-
- if (0 != opal_event_base_verbose) {
- opal_event_base_output = opal_output_open(NULL);
- } else {
- opal_event_base_output = -1;
- }
-
- /* to support tools such as ompi_info, add the components
- * to a list
- */
- OBJ_CONSTRUCT(&opal_event_components, opal_list_t);
- if (OPAL_SUCCESS !=
- mca_base_components_open("event", opal_event_base_output,
- mca_event_base_static_components,
- &opal_event_components, true)) {
- return OPAL_ERROR;
- }
+ /* no need to open the components since we only use one */
/* init the lib */
if (OPAL_SUCCESS != (rc = opal_event_init())) {
View
2 opal/mca/event/libevent2019/libevent2019_module.c
@@ -82,7 +82,7 @@ int opal_event_init(void)
bool dumpit=false;
int i, j;
- if (opal_output_get_verbosity(opal_event_base_output) > 4) {
+ if (opal_output_get_verbosity(opal_event_base_framework.framework_output) > 4) {
event_enable_debug_mode();
event_set_debug_output(true);
dumpit = true;
View
38 opal/mca/hwloc/base/base.h
@@ -25,25 +25,7 @@ BEGIN_C_DECLS
/* ******************************************************************** */
/**
- * Initialize the hwloc MCA framework
- *
- * @retval OPAL_SUCCESS Upon success
- * @retval OPAL_ERROR Upon failure
- *
- * This must be the first function invoked in the hwloc MCA
- * framework. It initializes the hwloc MCA framework, finds
- * and opens hwloc components, etc.
- *
- * This function is invoked during opal_init().
- *
- * This function fills in the internal global variable
- * opal_hwloc_base_components_opened, which is a list of all
- * hwloc components that were successfully opened. This
- * variable should \em only be used by other hwloc base
- * functions -- it is not considered a public interface member --
- * and is only mentioned here for completeness.
- *
- * Note that this function does NOT fill the global variable
+ * Note that the open function does NOT fill the global variable
* opal_hwloc_topology, nor does it set the process-wide memory
* affinity policy. Filling opal_hwloc_topology via
* hwloc_topology_load() can be expensive (and/or serialized by the
@@ -54,29 +36,15 @@ BEGIN_C_DECLS
* (after opal_hwloc_topology has been loaded) to set the process-wide
* memory affinity policy.
*/
-OPAL_DECLSPEC int opal_hwloc_base_open(void);
-
-/**
- * Shut down the hwloc MCA framework.
- *
- * @retval OPAL_SUCCESS Always
- *
- * This function shuts down everything in the hwloc MCA
- * framework, and is called during opal_finalize().
- *
- * It must be the last function invoked on the hwloc MCA
- * framework.
- */
-OPAL_DECLSPEC int opal_hwloc_base_close(void);
/**
* Debugging output stream
*/
-OPAL_DECLSPEC extern int opal_hwloc_base_output;
-OPAL_DECLSPEC extern opal_list_t opal_hwloc_base_components;
OPAL_DECLSPEC extern bool opal_hwloc_base_inited;
OPAL_DECLSPEC extern bool opal_hwloc_topology_inited;
+OPAL_DECLSPEC extern mca_base_framework_t opal_hwloc_base_framework;
+
/* we always must have some minimal locality support */
#define OPAL_HWLOC_PRINT_MAX_SIZE 50
#define OPAL_HWLOC_PRINT_NUM_BUFS 16
View
16 opal/mca/hwloc/base/hwloc_base_close.c
@@ -16,6 +16,8 @@
#include "opal/mca/hwloc/base/base.h"
#include "opal/util/output.h"
+int opal_hwloc_base_close(void);
+
int opal_hwloc_base_close(void)
{
if (!opal_hwloc_base_inited) {
@@ -24,27 +26,21 @@ int opal_hwloc_base_close(void)
#if OPAL_HAVE_HWLOC
{
- opal_list_item_t *item;
+ int ret;
/* no need to close the component as it was statically opened */
/* for support of tools such as ompi_info */
- for (item = opal_list_remove_first(&opal_hwloc_base_components);
- NULL != item;
- item = opal_list_remove_first(&opal_hwloc_base_components)) {
- OBJ_RELEASE(item);
+ ret = mca_base_framework_components_close (&opal_hwloc_base_framework, NULL);
+ if (OPAL_SUCCESS != ret) {
+ return ret;
}
- OBJ_DESTRUCT(&opal_hwloc_base_components);
/* free memory */
if (NULL != opal_hwloc_my_cpuset) {
hwloc_bitmap_free(opal_hwloc_my_cpuset);
opal_hwloc_my_cpuset = NULL;
}
-
- /* Close the framework output */
- opal_output_close (opal_hwloc_base_output);
- opal_hwloc_base_output = -1;
}
#endif
View
2 opal/mca/hwloc/base/hwloc_base_dt.c
@@ -242,7 +242,7 @@ int opal_hwloc_compare(const hwloc_topology_t topo1,
s1->cpubind->set_thisthread_cpubind != s2->cpubind->set_thisthread_cpubind ||
s1->membind->set_thisproc_membind != s2->membind->set_thisproc_membind ||
s1->membind->set_thisthread_membind != s2->membind->set_thisthread_membind) {
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:compare BINDING CAPABILITIES DIFFER"));
return OPAL_VALUE1_GREATER;
}
View
39 opal/mca/hwloc/base/hwloc_base_open.c
@@ -34,8 +34,6 @@
/*
* Globals
*/
-int opal_hwloc_base_output = -1;
-opal_list_t opal_hwloc_base_components;
bool opal_hwloc_base_inited = false;
#if OPAL_HAVE_HWLOC
hwloc_topology_t opal_hwloc_topology=NULL;
@@ -73,12 +71,19 @@ static mca_base_var_enum_value_t hwloc_failure_action[] = {
{0, NULL}
};
-static int opal_hwloc_base_verbose = 0;
+static int opal_hwloc_base_register(mca_base_register_flag_t flags);
+static int opal_hwloc_base_open(mca_base_open_flag_t flags);
+/* defined in hwloc_base_close.c */
+int opal_hwloc_base_close(void);
+
+MCA_BASE_FRAMEWORK_DECLARE(opal, hwloc, NULL, opal_hwloc_base_register, opal_hwloc_base_open, opal_hwloc_base_close,
+ mca_hwloc_base_static_components, 0);
+
static char *opal_hwloc_base_binding_policy = NULL;
static bool opal_hwloc_base_bind_to_core = false;
static bool opal_hwloc_base_bind_to_socket = false;
-static int opal_hwloc_base_register(int flags)
+static int opal_hwloc_base_register(mca_base_register_flag_t flags)
{
mca_base_var_enum_t *new_enum;
int ret;
@@ -87,16 +92,6 @@ static int opal_hwloc_base_register(int flags)
return OPAL_ERR_NOT_AVAILABLE;
#endif
- /* Debugging / verbose output */
- opal_hwloc_base_verbose = 0;
- (void) mca_base_var_register("opal", "hwloc", "base", "verbose",
- "Verbosity level of the hwloc framework",
- MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
- OPAL_INFO_LVL_9,
- MCA_BASE_VAR_SCOPE_READONLY,
- &opal_hwloc_base_verbose);
-
-
/* hwloc_base_mbind_policy */
opal_hwloc_base_map = OPAL_HWLOC_BASE_MAP_NONE;
@@ -166,10 +161,11 @@ static int opal_hwloc_base_register(int flags)
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY, &opal_hwloc_use_hwthreads_as_cpus);
+ /* register components */
return OPAL_SUCCESS;
}
-int opal_hwloc_base_open(void)
+static int opal_hwloc_base_open(mca_base_open_flag_t flags)
{
if (opal_hwloc_base_inited) {
return OPAL_SUCCESS;
@@ -181,14 +177,6 @@ int opal_hwloc_base_open(void)
int i, value;
opal_data_type_t tmp;
char **tmpvals, **quals;
-
- (void) opal_hwloc_base_register(0);
-
- if (0 != opal_hwloc_base_verbose) {
- opal_hwloc_base_output = opal_output_open(NULL);
- } else {
- opal_hwloc_base_output = -1;
- }
/* binding specification */
if (NULL == opal_hwloc_base_binding_policy) {
@@ -293,11 +281,8 @@ int opal_hwloc_base_open(void)
/* to support tools such as ompi_info, add the components
* to a list
*/
- OBJ_CONSTRUCT(&opal_hwloc_base_components, opal_list_t);
if (OPAL_SUCCESS !=
- mca_base_components_open("hwloc", opal_hwloc_base_output,
- mca_hwloc_base_static_components,
- &opal_hwloc_base_components, true)) {
+ mca_base_framework_components_open(&opal_hwloc_base_framework, flags)) {
return OPAL_ERROR;
}
View
54 opal/mca/hwloc/base/hwloc_base_util.c
@@ -101,7 +101,7 @@ int opal_hwloc_base_filter_cpus(hwloc_topology_t topo)
/* should only ever enter here once, but check anyway */
if (NULL != sum->available) {
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:filter_cpus specified - already done"));
return OPAL_SUCCESS;
}
@@ -111,10 +111,10 @@ int opal_hwloc_base_filter_cpus(hwloc_topology_t topo)
/* get the root available cpuset */
avail = hwloc_bitmap_alloc();
hwloc_bitmap_and(avail, root->online_cpuset, root->allowed_cpuset);
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base: no cpus specified - using root available cpuset"));
} else {
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base: filtering cpuset"));
/* find the specified logical cpus */
ranges = opal_argv_split(opal_hwloc_base_cpu_set, ',');
@@ -208,7 +208,7 @@ int opal_hwloc_base_get_topology(void)
{
int rc;
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:get_topology"));
if (0 != hwloc_topology_init(&opal_hwloc_topology) ||
@@ -324,7 +324,7 @@ hwloc_cpuset_t opal_hwloc_base_get_available_cpus(hwloc_topology_t topo,
opal_hwloc_topo_data_t *rdata;
opal_hwloc_obj_data_t *data;
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base: get available cpus"));
/* get the node-level information */
@@ -334,15 +334,15 @@ hwloc_cpuset_t opal_hwloc_base_get_available_cpus(hwloc_topology_t topo,
if (NULL == rdata) {
rdata = OBJ_NEW(opal_hwloc_topo_data_t);
root->userdata = (void*)rdata;
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:get_available_cpus first time - filtering cpus"));
}
/* ensure the topo-level cpuset was prepared */
opal_hwloc_base_filter_cpus(topo);
/* are we asking about the root object? */
if (obj == root) {
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:get_available_cpus root object"));
return rdata->available;
}
@@ -521,7 +521,7 @@ unsigned int opal_hwloc_base_get_obj_idx(hwloc_topology_t topo,
hwloc_obj_t ptr;
unsigned int nobjs, i;
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:get_idx"));
/* see if we already have the info */
@@ -533,7 +533,7 @@ unsigned int opal_hwloc_base_get_obj_idx(hwloc_topology_t topo,
}
if (data->idx < UINT_MAX) {
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:get_idx already have data: %u",
data->idx));
return data->idx;
@@ -545,7 +545,7 @@ unsigned int opal_hwloc_base_get_obj_idx(hwloc_topology_t topo,
}
nobjs = opal_hwloc_base_get_nbobjs_by_type(topo, obj->type, cache_level, rtype);
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:get_idx found %u objects of type %s:%u",
nobjs, hwloc_obj_type_string(obj->type), cache_level));
@@ -691,7 +691,7 @@ unsigned int opal_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo,
/* bozo check */
if (NULL == topo) {
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:get_nbobjs NULL topology"));
return 0;
}
@@ -728,7 +728,7 @@ unsigned int opal_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo,
cache_level == sum->cache_level &&
rtype == sum->rtype) {
/* yep - return the value */
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:get_nbojbs pre-existing data %u of %s:%u",
sum->num_objs, hwloc_obj_type_string(target), cache_level));
return sum->num_objs;
@@ -747,7 +747,7 @@ unsigned int opal_hwloc_base_get_nbobjs_by_type(hwloc_topology_t topo,
sum->rtype = rtype;
opal_list_append(&data->summaries, &sum->super);
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:get_nbojbs computed data %u of %s:%u",
num_objs, hwloc_obj_type_string(target), cache_level));
@@ -774,7 +774,7 @@ static hwloc_obj_t df_search_min_bound(hwloc_topology_t topo,
data = OBJ_NEW(opal_hwloc_obj_data_t);
start->userdata = data;
}
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:min_bound_under_obj object %s:%u nbound %u min %u",
hwloc_obj_type_string(target), start->logical_index,
data->num_bound, *min_bound));
@@ -815,7 +815,7 @@ hwloc_obj_t opal_hwloc_base_find_min_bound_target_under_obj(hwloc_topology_t top
/* bozo check */
if (NULL == topo || NULL == obj) {
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:find_min_bound_under_obj NULL %s",
(NULL == topo) ? "topology" : "object"));
return NULL;
@@ -845,12 +845,12 @@ hwloc_obj_t opal_hwloc_base_find_min_bound_target_under_obj(hwloc_topology_t top
loc = df_search_min_bound(topo, obj, target, cache_level, &min_bound);
if (HWLOC_OBJ_CACHE == target) {
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:min_bound_under_obj found min bound of %u on %s:%u:%u",
min_bound, hwloc_obj_type_string(target),
cache_level, loc->logical_index));
} else {
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:min_bound_under_obj found min bound of %u on %s:%u",
min_bound, hwloc_obj_type_string(target), loc->logical_index));
}
@@ -913,7 +913,7 @@ void opal_hwloc_base_clear_usage(hwloc_topology_t topo)
/* bozo check */
if (NULL == topo) {
- OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_output,
+ OPAL_OUTPUT_VERBOSE((5, opal_hwloc_base_framework.framework_output,
"hwloc:base:clear_usage: NULL topology"));
return;
}
@@ -1053,7 +1053,7 @@ static int socket_core_to_cpu_set(char *socket_core_list,
break;
case 2: /* range of core id's was given */
- opal_output_verbose(5, opal_hwloc_base_output,
+ opal_output_verbose(5, opal_hwloc_base_framework.framework_output,
"range of cores given: start %s stop %s",
range[0], range[1]);
lower_range = atoi(range[0]);
@@ -1106,7 +1106,7 @@ int opal_hwloc_base_slot_list_parse(const char *slot_str,
return OPAL_ERR_BAD_PARAM;
}
- opal_output_verbose(5, opal_hwloc_base_output,
+ opal_output_verbose(5, opal_hwloc_base_framework.framework_output,
"slot assignment: slot_list == %s",
slot_str);
@@ -1117,7 +1117,7 @@ int opal_hwloc_base_slot_list_parse(const char *slot_str,
hwloc_bitmap_zero(cpumask);
/* loop across the items and accumulate the mask */
for (i=0; NULL != item[i]; i++) {
- opal_output_verbose(5, opal_hwloc_base_output,
+ opal_output_verbose(5, opal_hwloc_base_framework.framework_output,
"working assignment %s",
item[i]);
/* if they specified "socket" by starting with an S/s,
@@ -1273,7 +1273,7 @@ opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t top
*/
if (peer1 == peer2) {
for (i=lvl; 0 < i; i--) {
- opal_output_verbose(5, opal_hwloc_base_output,
+ opal_output_verbose(5, opal_hwloc_base_framework.framework_output,
"equal level - computing locality: %s",
opal_hwloc_base_print_level(i));
locality |= get_locality(i);
@@ -1291,12 +1291,12 @@ opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t top
}
/* get the objects for these peers */
- opal_output_verbose(5, opal_hwloc_base_output,
+ opal_output_verbose(5, opal_hwloc_base_framework.framework_output,
"computing locality - getting object at level %s, index %u",
opal_hwloc_base_print_level(lvl), peer1);
obj1 = opal_hwloc_base_get_obj_by_type(topo, opal_hwloc_levels[lvl],
cache_level, peer1, OPAL_HWLOC_AVAILABLE);
- opal_output_verbose(5, opal_hwloc_base_output,
+ opal_output_verbose(5, opal_hwloc_base_framework.framework_output,
"computing locality - getting object at level %s, index %u",
opal_hwloc_base_print_level(lvl), peer2);
obj2 = opal_hwloc_base_get_obj_by_type(topo, opal_hwloc_levels[lvl],
@@ -1312,7 +1312,7 @@ opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t top
--lvl;
while (OPAL_HWLOC_NODE_LEVEL < lvl &&
NULL != obj1 && NULL != obj2 && obj1 != obj2) {
- opal_output_verbose(5, opal_hwloc_base_output,
+ opal_output_verbose(5, opal_hwloc_base_framework.framework_output,
"computing locality - shifting up from %s",
opal_hwloc_base_print_level(lvl));
obj1 = obj1->parent;
@@ -1322,7 +1322,7 @@ opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t top
/* set the locality */
for (i=lvl; 0 < i; i--) {
- opal_output_verbose(5, opal_hwloc_base_output,
+ opal_output_verbose(5, opal_hwloc_base_framework.framework_output,
"computing locality - filling level %s",
opal_hwloc_base_print_level(i));
locality |= get_locality(i);
@@ -1350,7 +1350,7 @@ opal_hwloc_locality_t opal_hwloc_base_get_relative_locality(hwloc_topology_t top
}
}
- opal_output_verbose(5, opal_hwloc_base_output,
+ opal_output_verbose(5, opal_hwloc_base_framework.framework_output,
"locality: %s",
opal_hwloc_base_print_locality(locality));
View
13 opal/mca/if/base/base.h
@@ -13,21 +13,16 @@
#include "opal_config.h"
+#include "opal/mca/base/mca_base_framework.h"
+
#include "opal/mca/if/if.h"
-/*
- * Global functions for MCA overall if open and close
- */
BEGIN_C_DECLS
-OPAL_DECLSPEC int opal_if_base_open(void);
-OPAL_DECLSPEC int opal_if_base_close(void);
-
/*
- * Globals
+ * Framework declaration
*/
-OPAL_DECLSPEC extern opal_list_t opal_if_components;
-OPAL_DECLSPEC extern int opal_if_base_output;
+OPAL_DECLSPEC extern mca_base_framework_t opal_if_base_framework;
END_C_DECLS
View
120 opal/mca/if/base/if_base_components.c
@@ -17,129 +17,59 @@
#include "opal/mca/if/base/base.h"
#include "opal/mca/if/base/static-components.h"
-int opal_if_base_output=-1;
-opal_list_t opal_if_components;
-static bool already_done = false;
-
/* instantiate the global list of interfaces */
opal_list_t opal_if_list;
-bool opal_if_do_not_resolve;
-bool opal_if_retain_loopback;
-
-static int opal_if_base_verbose = -1;
+bool opal_if_do_not_resolve = false;
+bool opal_if_retain_loopback = false;
/* instance the opal_if_t object */
OBJ_CLASS_INSTANCE(opal_if_t, opal_list_item_t, NULL, NULL);
-static int opal_if_base_register(int flags)
-{
- int var_id;
+static int opal_if_base_register (mca_base_register_flag_t flags);
+static int opal_if_base_open (mca_base_open_flag_t flags);
+static int opal_if_base_close(void);
- opal_if_base_verbose = -1;
- (void) mca_base_var_register("opal", "if", "base", "verbose",
- "Provide verbose output if greater than 0",
- MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
- OPAL_INFO_LVL_9,
- MCA_BASE_VAR_SCOPE_READONLY,
- &opal_if_base_verbose);
+MCA_BASE_FRAMEWORK_DECLARE(opal, if, NULL, opal_if_base_register, opal_if_base_open, opal_if_base_close,
+ mca_if_base_static_components, 0);
+static int opal_if_base_register (mca_base_register_flag_t flags)
+{
opal_if_do_not_resolve = false;
- var_id = mca_base_var_register("opal", "if", "base", "do_not_resolve",
-