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 *
2627/*
2728 * Globals
2829 */
29- int opal_compress_base_output = -1 ;
3030opal_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+
3939opal_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}
0 commit comments