This source file includes following definitions.
- crs_self_register
- crs_self_open
- crs_self_close
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 #include "opal_config.h"
  21 
  22 #include "opal/constants.h"
  23 #include "opal/mca/crs/crs.h"
  24 #include "opal/mca/crs/base/base.h"
  25 #include "opal/util/output.h"
  26 #include "crs_self.h"
  27 
  28 
  29 
  30 
  31 const char *opal_crs_self_component_version_string =
  32 "OPAL CRS self MCA component version " OPAL_VERSION;
  33 
  34 
  35 
  36 
  37 static int crs_self_register (void);
  38 static int crs_self_open(void);
  39 static int crs_self_close(void);
  40 
  41 
  42 
  43 
  44 
  45 opal_crs_self_component_t mca_crs_self_component = {
  46     
  47     {
  48         
  49 
  50 
  51         .base_version = {
  52             OPAL_CRS_BASE_VERSION_2_0_0,
  53 
  54             
  55             .mca_component_name = "self",
  56             MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
  57                                   OPAL_RELEASE_VERSION),
  58 
  59             
  60             .mca_open_component = crs_self_open,
  61             .mca_close_component = crs_self_close,
  62             .mca_query_component = opal_crs_self_component_query,
  63             .mca_register_component_params = crs_self_register,
  64         },
  65         {
  66             
  67             MCA_BASE_METADATA_PARAM_CHECKPOINT
  68         },
  69 
  70         
  71         0,
  72         
  73         -1
  74     },
  75     
  76     PREFIX_DEFAULT,
  77     
  78     false,
  79     
  80     true,
  81     
  82     NULL,
  83     NULL,
  84     NULL
  85 };
  86 
  87 static int crs_self_register (void)
  88 {
  89     int ret;
  90 
  91     
  92     mca_crs_self_component.super.priority = 20;
  93     ret = mca_base_component_var_register (&mca_crs_self_component.super.base_version,
  94                                            "priority", "Priority of the CRS self component "
  95                                            "(default: 20)", MCA_BASE_VAR_TYPE_INT, NULL, 0,
  96                                            MCA_BASE_VAR_FLAG_SETTABLE,
  97                                            OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_ALL_EQ,
  98                                            &mca_crs_self_component.super.priority);
  99     if (0 > ret) {
 100         return ret;
 101     }
 102 
 103     mca_crs_self_component.super.verbose = 0;
 104     ret = mca_base_component_var_register (&mca_crs_self_component.super.base_version,
 105                                            "verbose",
 106                                            "Verbose level for the CRS self component",
 107                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
 108                                            OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
 109                                            &mca_crs_self_component.super.verbose);
 110     if (0 > ret) {
 111         return ret;
 112     }
 113 
 114     
 115 
 116 
 117     mca_crs_self_component.prefix = NULL;
 118     ret = mca_base_component_var_register (&mca_crs_self_component.super.base_version,
 119                                            "prefix",
 120                                            "Prefix for user defined callback functions",
 121                                            MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
 122                                            OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
 123                                            &mca_crs_self_component.prefix);
 124     if (0 > ret) {
 125         return ret;
 126     }
 127 
 128     ret = mca_base_component_var_register (&mca_crs_self_component.super.base_version,
 129                                            "do_restart",
 130                                            "Start execution by calling restart callback",
 131                                            MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
 132                                            OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
 133                                            &mca_crs_self_component.do_restart);
 134     return (0 > ret) ? ret : OPAL_SUCCESS;
 135 }
 136 
 137 static int crs_self_open(void)
 138 {
 139     
 140 
 141 
 142 
 143 
 144     
 145 
 146 
 147     if ( 0 != mca_crs_self_component.super.verbose) {
 148         mca_crs_self_component.super.output_handle = opal_output_open(NULL);
 149         opal_output_set_verbosity(mca_crs_self_component.super.output_handle,
 150                                   mca_crs_self_component.super.verbose);
 151     } else {
 152         mca_crs_self_component.super.output_handle = opal_crs_base_framework.framework_output;
 153     }
 154 
 155     
 156 
 157 
 158     opal_output_verbose(10, mca_crs_self_component.super.output_handle,
 159                         "crs:self: open()");
 160     opal_output_verbose(20, mca_crs_self_component.super.output_handle,
 161                         "crs:self: open: priority   = %d",
 162                         mca_crs_self_component.super.priority);
 163     opal_output_verbose(20, mca_crs_self_component.super.output_handle,
 164                         "crs:self: open: verbosity  = %d",
 165                         mca_crs_self_component.super.verbose);
 166     opal_output_verbose(20, mca_crs_self_component.super.output_handle,
 167                         "crs:self: open: prefix     = %s",
 168                         mca_crs_self_component.prefix);
 169     opal_output_verbose(20, mca_crs_self_component.super.output_handle,
 170                         "crs:self: open: do_restart = %d",
 171                         mca_crs_self_component.do_restart);
 172 
 173     return OPAL_SUCCESS;
 174 }
 175 
 176 static int crs_self_close(void)
 177 {
 178     opal_output_verbose(10, mca_crs_self_component.super.output_handle,
 179                         "crs:self: close()");
 180 
 181     return OPAL_SUCCESS;
 182 }