This source file includes following definitions.
- mca_base_framework_components_register
- register_components
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 #include "opal_config.h"
  24 
  25 #include <stdio.h>
  26 #include <string.h>
  27 #include <stdlib.h>
  28 
  29 #include "opal/class/opal_list.h"
  30 #include "opal/util/argv.h"
  31 #include "opal/util/output.h"
  32 #include "opal/util/show_help.h"
  33 #include "opal/mca/mca.h"
  34 #include "opal/mca/base/base.h"
  35 #include "opal/mca/base/mca_base_framework.h"
  36 #include "opal/mca/base/mca_base_component_repository.h"
  37 #include "opal/constants.h"
  38 
  39 
  40 
  41 
  42 static int register_components(mca_base_framework_t *framework);
  43 
  44 
  45 
  46 
  47 int mca_base_framework_components_register (mca_base_framework_t *framework,
  48                                             mca_base_register_flag_t flags)
  49 {
  50     bool open_dso_components = !(flags & MCA_BASE_REGISTER_STATIC_ONLY);
  51     bool ignore_requested = !!(flags & MCA_BASE_REGISTER_ALL);
  52     int ret;
  53 
  54     
  55     ret = mca_base_component_find(NULL, framework, ignore_requested, open_dso_components);
  56     if (OPAL_SUCCESS != ret) {
  57         return ret;
  58     }
  59 
  60     
  61     return register_components(framework);
  62 }
  63 
  64 
  65 
  66 
  67 
  68 
  69 
  70 
  71 static int register_components(mca_base_framework_t *framework)
  72 {
  73     int ret;
  74     mca_base_component_t *component;
  75     mca_base_component_list_item_t *cli, *next;
  76     int output_id = framework->framework_output;
  77 
  78     
  79     opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
  80                          "mca: base: components_register: registering framework %s components",
  81                          framework->framework_name);
  82 
  83     
  84 
  85     OPAL_LIST_FOREACH_SAFE(cli, next, &framework->framework_components, mca_base_component_list_item_t) {
  86         component = (mca_base_component_t *)cli->cli_component;
  87 
  88         opal_output_verbose(MCA_BASE_VERBOSE_COMPONENT, output_id,
  89                             "mca: base: components_register: found loaded component %s",
  90                             component->mca_component_name);
  91 
  92         
  93         if (NULL == component->mca_register_component_params) {
  94             opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
  95                                  "mca: base: components_register: "
  96                                  "component %s has no register or open function",
  97                                  component->mca_component_name);
  98             ret = OPAL_SUCCESS;
  99         } else {
 100             ret = component->mca_register_component_params();
 101         }
 102 
 103         if (OPAL_SUCCESS != ret) {
 104             if (OPAL_ERR_NOT_AVAILABLE != ret) {
 105                 
 106 
 107 
 108 
 109 
 110 
 111 
 112 
 113 
 114 
 115 
 116                 if (mca_base_component_show_load_errors) {
 117                     opal_output_verbose (MCA_BASE_VERBOSE_ERROR, output_id,
 118                                          "mca: base: components_register: component %s "
 119                                          "/ %s register function failed",
 120                                          component->mca_type_name,
 121                                          component->mca_component_name);
 122                 }
 123 
 124                 opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id,
 125                                      "mca: base: components_register: "
 126                                      "component %s register function failed",
 127                                      component->mca_component_name);
 128             }
 129 
 130             opal_list_remove_item (&framework->framework_components, &cli->super);
 131 
 132             
 133             OBJ_RELEASE(cli);
 134             continue;
 135         }
 136 
 137         if (NULL != component->mca_register_component_params) {
 138             opal_output_verbose (MCA_BASE_VERBOSE_COMPONENT, output_id, "mca: base: components_register: "
 139                                  "component %s register function successful",
 140                                  component->mca_component_name);
 141         }
 142 
 143         
 144         mca_base_component_var_register (component, "major_version", NULL, MCA_BASE_VAR_TYPE_INT, NULL,
 145                                          0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY | MCA_BASE_VAR_FLAG_INTERNAL,
 146                                          OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_CONSTANT,
 147                                          &component->mca_component_major_version);
 148         mca_base_component_var_register (component, "minor_version", NULL, MCA_BASE_VAR_TYPE_INT, NULL,
 149                                          0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY | MCA_BASE_VAR_FLAG_INTERNAL,
 150                                          OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_CONSTANT,
 151                                          &component->mca_component_minor_version);
 152         mca_base_component_var_register (component, "release_version", NULL, MCA_BASE_VAR_TYPE_INT, NULL,
 153                                          0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY | MCA_BASE_VAR_FLAG_INTERNAL,
 154                                          OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_CONSTANT,
 155                                          &component->mca_component_release_version);
 156     }
 157 
 158     
 159 
 160     return OPAL_SUCCESS;
 161 }