This source file includes following definitions.
- orte_rmaps_base_select
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 #include "orte_config.h"
  20 #include "orte/constants.h"
  21 
  22 #include <string.h>
  23 
  24 #include "orte/mca/mca.h"
  25 #include "opal/mca/base/base.h"
  26 
  27 #include "orte/mca/rmaps/base/base.h"
  28 
  29 static bool selected = false;
  30 
  31 
  32 
  33 
  34 
  35 int orte_rmaps_base_select(void)
  36 {
  37     mca_base_component_list_item_t *cli = NULL;
  38     mca_base_component_t *component = NULL;
  39     mca_base_module_t *module = NULL;
  40     orte_rmaps_base_module_t *nmodule;
  41     orte_rmaps_base_selected_module_t *newmodule, *mod;
  42     int rc, priority;
  43     bool inserted;
  44 
  45     if (selected) {
  46         
  47         return ORTE_SUCCESS;
  48     }
  49     selected = true;
  50 
  51     
  52     OPAL_LIST_FOREACH(cli, &orte_rmaps_base_framework.framework_components, mca_base_component_list_item_t) {
  53         component = (mca_base_component_t *) cli->cli_component;
  54 
  55         opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
  56                             "mca:rmaps:select: checking available component %s", component->mca_component_name);
  57 
  58         
  59         if (NULL == component->mca_query_component) {
  60             opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
  61                                 "mca:rmaps:select: Skipping component [%s]. It does not implement a query function",
  62                                 component->mca_component_name );
  63             continue;
  64         }
  65 
  66         
  67         opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
  68                             "mca:rmaps:select: Querying component [%s]",
  69                             component->mca_component_name);
  70         rc = component->mca_query_component(&module, &priority);
  71 
  72         
  73         if (ORTE_SUCCESS != rc || NULL == module) {
  74             opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
  75                                 "mca:rmaps:select: Skipping component [%s]. Query failed to return a module",
  76                                 component->mca_component_name );
  77             continue;
  78         }
  79 
  80         
  81         nmodule = (orte_rmaps_base_module_t*) module;
  82         
  83         newmodule = OBJ_NEW(orte_rmaps_base_selected_module_t);
  84         newmodule->pri = priority;
  85         newmodule->module = nmodule;
  86         newmodule->component = component;
  87 
  88         
  89         inserted = false;
  90         OPAL_LIST_FOREACH(mod, &orte_rmaps_base.selected_modules, orte_rmaps_base_selected_module_t) {
  91             if (priority > mod->pri) {
  92                 opal_list_insert_pos(&orte_rmaps_base.selected_modules,
  93                                      (opal_list_item_t*)mod, &newmodule->super);
  94                 inserted = true;
  95                 break;
  96             }
  97         }
  98         if (!inserted) {
  99             
 100             opal_list_append(&orte_rmaps_base.selected_modules, &newmodule->super);
 101         }
 102     }
 103 
 104     if (4 < opal_output_get_verbosity(orte_rmaps_base_framework.framework_output)) {
 105         opal_output(0, "%s: Final mapper priorities", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
 106         
 107         OPAL_LIST_FOREACH(mod, &orte_rmaps_base.selected_modules, orte_rmaps_base_selected_module_t) {
 108             opal_output(0, "\tMapper: %s Priority: %d", mod->component->mca_component_name, mod->pri);
 109         }
 110     }
 111 
 112     return ORTE_SUCCESS;;
 113 }