Skip to content

Commit 365cf48

Browse files
committed
Update OPAL frameworks to use the MCA framework system.
This commit was SVN r28239.
1 parent c3b67d0 commit 365cf48

File tree

82 files changed

+514
-1595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+514
-1595
lines changed

opal/mca/backtrace/base/backtrace_component.c

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12+
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
13+
* reserved.
1214
* $COPYRIGHT$
1315
*
1416
* Additional copyrights may follow
@@ -19,13 +21,8 @@
1921

2022
#include "opal_config.h"
2123

22-
#include "opal/constants.h"
23-
#include "opal/mca/mca.h"
24-
#include "opal/mca/base/base.h"
25-
#include "opal/mca/backtrace/backtrace.h"
2624
#include "opal/mca/backtrace/base/base.h"
2725

28-
2926
/*
3027
* The following file was created by configure. It contains extern
3128
* statements and the definition of an array of pointers to each
@@ -37,35 +34,7 @@
3734
/*
3835
* Globals
3936
*/
40-
opal_list_t opal_backtrace_base_components_opened;
41-
42-
43-
int
44-
opal_backtrace_base_open(void)
45-
{
46-
/* Open up all available components */
47-
if (OPAL_SUCCESS !=
48-
mca_base_components_open("backtrace", 0,
49-
mca_backtrace_base_static_components,
50-
&opal_backtrace_base_components_opened,
51-
true)) {
52-
return OPAL_ERROR;
53-
}
54-
55-
/* All done */
56-
return OPAL_SUCCESS;
57-
}
58-
59-
60-
int
61-
opal_backtrace_base_close(void)
62-
{
63-
/* Close all components that are still open */
64-
mca_base_components_close(0,
65-
&opal_backtrace_base_components_opened,
66-
NULL);
67-
OBJ_DESTRUCT(&opal_backtrace_base_components_opened);
6837

69-
/* All done */
70-
return OPAL_SUCCESS;
71-
}
38+
/* Uses default register/open/close functions */
39+
MCA_BASE_FRAMEWORK_DECLARE(opal, backtrace, NULL, NULL, NULL, NULL,
40+
mca_backtrace_base_static_components, 0);

opal/mca/backtrace/base/base.h

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,52 +22,17 @@
2222

2323
#include "opal_config.h"
2424

25-
#include "opal/mca/backtrace/backtrace.h"
25+
#include "opal/mca/base/mca_base_framework.h"
2626

27+
#include "opal/mca/backtrace/backtrace.h"
2728

2829
/*
2930
* Global functions for MCA overall backtrace open and close
3031
*/
3132

3233
BEGIN_C_DECLS
3334

34-
/**
35-
* Initialize the backtrace MCA framework
36-
*
37-
* @retval OPAL_SUCCESS Upon success
38-
* @retval OPAL_ERROR Upon failure
39-
*
40-
* This must be the first function invoked in the backtrace MCA
41-
* framework. It initializes the backtrace MCA framework, finds
42-
* and opens backtrace components, etc.
43-
*
44-
* This function is invoked during opal_init() and during the
45-
* initialization of the special case of the laminfo command.
46-
*
47-
* This function fills in the internal global variable
48-
* opal_backtrace_base_components_opened, which is a list of all
49-
* backtrace components that were successfully opened. This
50-
* variable should \em only be used by other backtrace base
51-
* functions -- it is not considered a public interface member --
52-
* and is only mentioned here for completeness.
53-
*/
54-
OPAL_DECLSPEC int opal_backtrace_base_open(void);
55-
56-
57-
/**
58-
* Shut down the backtrace MCA framework.
59-
*
60-
* @retval OPAL_SUCCESS Always
61-
*
62-
* This function shuts down everything in the backtrace MCA
63-
* framework, and is called during opal_finalize() and the
64-
* special case of the laminfo command.
65-
*
66-
* It must be the last function invoked on the backtrace MCA framework.
67-
*/
68-
OPAL_DECLSPEC int opal_backtrace_base_close(void);
35+
OPAL_DECLSPEC extern mca_base_framework_t opal_backtrace_base_framework;
6936

70-
OPAL_DECLSPEC extern opal_list_t opal_backtrace_base_components_opened;
71-
7237
END_C_DECLS
7338
#endif /* OPAL_BASE_BACKTRACE_H */

opal/mca/compress/base/base.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "opal/util/opal_environ.h"
1818
#include "opal/runtime/opal_cr.h"
1919

20+
#include "opal/mca/base/base.h"
21+
2022
/*
2123
* Global functions for MCA overall COMPRESS
2224
*/
@@ -33,7 +35,7 @@ extern "C" {
3335
*
3436
* This function is invoked during opal_init();
3537
*/
36-
OPAL_DECLSPEC int opal_compress_base_open(void);
38+
OPAL_DECLSPEC int opal_compress_base_open(mca_base_open_flag_t flags);
3739

3840
/**
3941
* Select an available component.
@@ -58,8 +60,7 @@ extern "C" {
5860
/**
5961
* Globals
6062
*/
61-
OPAL_DECLSPEC extern int opal_compress_base_output;
62-
OPAL_DECLSPEC extern opal_list_t opal_compress_base_components_available;
63+
OPAL_DECLSPEC extern mca_base_framework_t opal_compress_base_framework;
6364
OPAL_DECLSPEC extern opal_compress_base_component_t opal_compress_base_selected_component;
6465
OPAL_DECLSPEC extern opal_compress_base_module_t opal_compress;
6566

opal/mca/compress/base/compress_base_close.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int opal_compress_base_close(void)
2121
{
2222
/* Compression currently only used with C/R */
2323
if( !opal_cr_is_enabled ) {
24-
opal_output_verbose(10, opal_compress_base_output,
24+
opal_output_verbose(10, opal_compress_base_framework.framework_output,
2525
"compress:open: FT is not enabled, skipping!");
2626
return OPAL_SUCCESS;
2727
}
@@ -32,13 +32,5 @@ int opal_compress_base_close(void)
3232
}
3333

3434
/* Close all available modules that are open */
35-
mca_base_components_close(opal_compress_base_output,
36-
&opal_compress_base_components_available,
37-
NULL);
38-
39-
/* Close the framework output */
40-
opal_output_close (opal_compress_base_output);
41-
opal_compress_base_output = -1;
42-
43-
return OPAL_SUCCESS;
35+
return mca_base_framework_components_close (&opal_compress_base_framework, NULL);
4436
}
Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2004-2010 The Trustees of Indiana University.
34
* All rights reserved.
45
*
5-
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
6+
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
67
* All rights reserved.
78
* $COPYRIGHT$
89
*
@@ -26,7 +27,6 @@
2627
/*
2728
* Globals
2829
*/
29-
int opal_compress_base_output = -1;
3030
opal_compress_base_module_t opal_compress = {
3131
NULL, /* init */
3232
NULL, /* finalize */
@@ -35,21 +35,22 @@ opal_compress_base_module_t opal_compress = {
3535
NULL, /* decompress */
3636
NULL /* decompress_nb */
3737
};
38-
opal_list_t opal_compress_base_components_available;
38+
3939
opal_compress_base_component_t opal_compress_base_selected_component;
4040

41-
static int opal_compress_base_verbose = 0;
41+
static int opal_compress_base_register (mca_base_register_flag_t flags);
42+
43+
MCA_BASE_FRAMEWORK_DECLARE(opal, compress, NULL, opal_compress_base_register, opal_compress_base_open,
44+
opal_compress_base_close, mca_compress_base_static_components, 0);
4245

43-
static int opal_compress_base_register(int flags)
46+
static int opal_compress_base_register (mca_base_register_flag_t flags)
4447
{
45-
/* Debugging/Verbose output */
46-
opal_compress_base_verbose = 0;
47-
(void) mca_base_var_register("opal", "compress", "base", "verbose",
48-
"Verbosity level of the COMPRESS framework",
49-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
50-
OPAL_INFO_LVL_9,
51-
MCA_BASE_VAR_SCOPE_READONLY,
52-
&opal_compress_base_verbose);
48+
/* Compression currently only used with C/R */
49+
if( !opal_cr_is_enabled ) {
50+
opal_output_verbose(10, opal_compress_base_framework.framework_output,
51+
"compress:open: FT is not enabled, skipping!");
52+
return OPAL_ERR_NOT_AVAILABLE;
53+
}
5354

5455
return OPAL_SUCCESS;
5556
}
@@ -58,44 +59,15 @@ static int opal_compress_base_register(int flags)
5859
* Function for finding and opening either all MCA components,
5960
* or the one that was specifically requested via a MCA parameter.
6061
*/
61-
int opal_compress_base_open(void)
62+
int opal_compress_base_open(mca_base_open_flag_t flags)
6263
{
63-
int ret, exit_status = OPAL_SUCCESS;
64-
65-
(void) opal_compress_base_register(0);
66-
67-
if(0 != opal_compress_base_verbose) {
68-
opal_compress_base_output = opal_output_open(NULL);
69-
} else {
70-
opal_compress_base_output = -1;
71-
}
72-
opal_output_set_verbosity(opal_compress_base_output, opal_compress_base_verbose);
73-
7464
/* Compression currently only used with C/R */
7565
if( !opal_cr_is_enabled ) {
76-
opal_output_verbose(10, opal_compress_base_output,
66+
opal_output_verbose(10, opal_compress_base_framework.framework_output,
7767
"compress:open: FT is not enabled, skipping!");
7868
return OPAL_SUCCESS;
7969
}
8070

8171
/* Open up all available components */
82-
if (OPAL_SUCCESS != (ret = mca_base_components_open("compress",
83-
opal_compress_base_output,
84-
mca_compress_base_static_components,
85-
&opal_compress_base_components_available,
86-
true)) ) {
87-
exit_status = OPAL_ERROR;
88-
if( OPAL_ERR_NOT_FOUND == ret) {
89-
const char **str_value = NULL;
90-
91-
ret = mca_base_var_find("opal", "compress", NULL, NULL);
92-
mca_base_var_get_value(ret, &str_value, NULL, NULL);
93-
if (NULL != str_value && NULL != str_value[0] &&
94-
0 == strncmp(str_value[0], "none", strlen("none"))) {
95-
exit_status = OPAL_SUCCESS;
96-
}
97-
}
98-
}
99-
100-
return exit_status;
72+
return mca_base_framework_components_open (&opal_compress_base_framework, flags);
10173
}

opal/mca/compress/base/compress_base_select.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ int opal_compress_base_select(void)
3030

3131
/* Compression currently only used with C/R */
3232
if( !opal_cr_is_enabled ) {
33-
opal_output_verbose(10, opal_compress_base_output,
33+
opal_output_verbose(10, opal_compress_base_framework.framework_output,
3434
"compress:open: FT is not enabled, skipping!");
3535
return OPAL_SUCCESS;
3636
}
3737

3838
/*
3939
* Select the best component
4040
*/
41-
if( OPAL_SUCCESS != mca_base_select("compress", opal_compress_base_output,
42-
&opal_compress_base_components_available,
41+
if( OPAL_SUCCESS != mca_base_select("compress", opal_compress_base_framework.framework_output,
42+
&opal_compress_base_framework.framework_components,
4343
(mca_base_module_t **) &best_module,
4444
(mca_base_component_t **) &best_component) ) {
4545
/* This will only happen if no component was selected */

opal/mca/compress/bzip/compress_bzip_component.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static int compress_bzip_open(void)
117117
opal_output_set_verbosity(mca_compress_bzip_component.super.output_handle,
118118
mca_compress_bzip_component.super.verbose);
119119
} else {
120-
mca_compress_bzip_component.super.output_handle = opal_compress_base_output;
120+
mca_compress_bzip_component.super.output_handle = opal_compress_base_framework.framework_output;
121121
}
122122

123123
/*

opal/mca/compress/gzip/compress_gzip_component.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int compress_gzip_open(void)
118118
opal_output_set_verbosity(mca_compress_gzip_component.super.output_handle,
119119
mca_compress_gzip_component.super.verbose);
120120
} else {
121-
mca_compress_gzip_component.super.output_handle = opal_compress_base_output;
121+
mca_compress_gzip_component.super.output_handle = opal_compress_base_framework.framework_output;
122122
}
123123

124124
/*

opal/mca/crs/base/base.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define OPAL_CRS_BASE_H
2222

2323
#include "opal_config.h"
24+
#include "opal/mca/base/base.h"
2425
#include "opal/mca/crs/crs.h"
2526
#include "opal/util/opal_environ.h"
2627
#include "opal/runtime/opal_cr.h"
@@ -47,7 +48,7 @@ BEGIN_C_DECLS
4748
*
4849
* This function is invoked during opal_init();
4950
*/
50-
OPAL_DECLSPEC int opal_crs_base_open(void);
51+
OPAL_DECLSPEC int opal_crs_base_open(mca_base_open_flag_t flags);
5152

5253
/**
5354
* Select an available component.
@@ -72,8 +73,7 @@ BEGIN_C_DECLS
7273
/**
7374
* Globals
7475
*/
75-
OPAL_DECLSPEC extern int opal_crs_base_output;
76-
OPAL_DECLSPEC extern opal_list_t opal_crs_base_components_available;
76+
OPAL_DECLSPEC extern mca_base_framework_t opal_crs_base_framework;
7777
OPAL_DECLSPEC extern opal_crs_base_component_t opal_crs_base_selected_component;
7878
OPAL_DECLSPEC extern opal_crs_base_module_t opal_crs;
7979

opal/mca/crs/base/crs_base_close.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
int opal_crs_base_close(void)
2626
{
2727
if( !opal_cr_is_enabled ) {
28-
opal_output_verbose(10, opal_crs_base_output,
28+
opal_output_verbose(10, opal_crs_base_framework.framework_output,
2929
"crs:close: FT is not enabled, skipping!");
3030
return OPAL_SUCCESS;
3131
}
@@ -36,13 +36,6 @@ int opal_crs_base_close(void)
3636
}
3737

3838
/* Close all available modules that are open */
39-
mca_base_components_close(opal_crs_base_output,
40-
&opal_crs_base_components_available,
41-
NULL);
42-
43-
/* Close the framework output */
44-
opal_output_close (opal_crs_base_output);
45-
opal_crs_base_output = -1;
46-
47-
return OPAL_SUCCESS;
39+
return mca_base_framework_components_close (&opal_crs_base_framework,
40+
NULL);
4841
}

0 commit comments

Comments
 (0)