This source file includes following definitions.
- pmix_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 
  24 #include <src/include/pmix_config.h>
  25 
  26 #include <stdio.h>
  27 #include <string.h>
  28 #include <stdlib.h>
  29 
  30 #include "src/class/pmix_list.h"
  31 #include "src/util/argv.h"
  32 #include "src/util/error.h"
  33 #include "src/util/output.h"
  34 #include "src/util/show_help.h"
  35 #include "src/mca/mca.h"
  36 #include "src/mca/base/base.h"
  37 #include "src/mca/base/pmix_mca_base_framework.h"
  38 #include "src/mca/base/pmix_mca_base_component_repository.h"
  39 #include "pmix_common.h"
  40 
  41 
  42 
  43 
  44 static int register_components(pmix_mca_base_framework_t *framework);
  45 
  46 
  47 
  48 
  49 int pmix_mca_base_framework_components_register (pmix_mca_base_framework_t *framework,
  50                                             pmix_mca_base_register_flag_t flags)
  51 {
  52     bool open_dso_components = !(flags & PMIX_MCA_BASE_REGISTER_STATIC_ONLY);
  53     bool ignore_requested = !!(flags & PMIX_MCA_BASE_REGISTER_ALL);
  54     int ret;
  55 
  56     
  57     ret = pmix_mca_base_component_find(NULL, framework, ignore_requested, open_dso_components);
  58     if (PMIX_SUCCESS != ret) {
  59         return ret;
  60     }
  61 
  62     
  63     return register_components(framework);
  64 }
  65 
  66 
  67 
  68 
  69 
  70 
  71 
  72 
  73 static int register_components(pmix_mca_base_framework_t *framework)
  74 {
  75     int ret;
  76     pmix_mca_base_component_t *component;
  77     pmix_mca_base_component_list_item_t *cli, *next;
  78     int output_id = framework->framework_output;
  79 
  80     
  81     pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
  82                          "pmix:mca: base: components_register: registering framework %s components",
  83                          framework->framework_name);
  84 
  85     
  86 
  87     PMIX_LIST_FOREACH_SAFE(cli, next, &framework->framework_components, pmix_mca_base_component_list_item_t) {
  88         component = (pmix_mca_base_component_t *)cli->cli_component;
  89 
  90         pmix_output_verbose(PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
  91                             "pmix:mca: base: components_register: found loaded component %s",
  92                             component->pmix_mca_component_name);
  93 
  94         
  95         if (NULL == component->pmix_mca_register_component_params) {
  96             pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
  97                                  "pmix:mca: base: components_register: "
  98                                  "component %s has no register or open function",
  99                                  component->pmix_mca_component_name);
 100             ret = PMIX_SUCCESS;
 101         } else {
 102             ret = component->pmix_mca_register_component_params();
 103         }
 104 
 105         if (PMIX_SUCCESS != ret) {
 106             if (PMIX_ERR_NOT_AVAILABLE != ret) {
 107                 
 108 
 109 
 110 
 111 
 112 
 113 
 114 
 115 
 116 
 117 
 118                 if (pmix_mca_base_component_show_load_errors) {
 119                     pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_ERROR, output_id,
 120                                          "pmix:mca: base: components_register: component %s "
 121                                          "/ %s register function failed",
 122                                          component->pmix_mca_type_name,
 123                                          component->pmix_mca_component_name);
 124                 }
 125 
 126                 pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
 127                                      "pmix:mca: base: components_register: "
 128                                      "component %s register function failed",
 129                                      component->pmix_mca_component_name);
 130             }
 131 
 132             pmix_list_remove_item (&framework->framework_components, &cli->super);
 133 
 134             
 135             PMIX_RELEASE(cli);
 136             continue;
 137         }
 138 
 139         if (NULL != component->pmix_mca_register_component_params) {
 140             pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id, "pmix:mca: base: components_register: "
 141                                  "component %s register function successful",
 142                                  component->pmix_mca_component_name);
 143         }
 144 
 145         
 146         pmix_mca_base_component_var_register (component, "major_version", NULL, PMIX_MCA_BASE_VAR_TYPE_INT, NULL,
 147                                          0, PMIX_MCA_BASE_VAR_FLAG_DEFAULT_ONLY | PMIX_MCA_BASE_VAR_FLAG_INTERNAL,
 148                                          PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_CONSTANT,
 149                                          &component->pmix_mca_component_major_version);
 150         pmix_mca_base_component_var_register (component, "minor_version", NULL, PMIX_MCA_BASE_VAR_TYPE_INT, NULL,
 151                                          0, PMIX_MCA_BASE_VAR_FLAG_DEFAULT_ONLY | PMIX_MCA_BASE_VAR_FLAG_INTERNAL,
 152                                          PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_CONSTANT,
 153                                          &component->pmix_mca_component_minor_version);
 154         pmix_mca_base_component_var_register (component, "release_version", NULL, PMIX_MCA_BASE_VAR_TYPE_INT, NULL,
 155                                          0, PMIX_MCA_BASE_VAR_FLAG_DEFAULT_ONLY | PMIX_MCA_BASE_VAR_FLAG_INTERNAL,
 156                                          PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_CONSTANT,
 157                                          &component->pmix_mca_component_release_version);
 158     }
 159 
 160     
 161 
 162     return PMIX_SUCCESS;
 163 }