root/orte/mca/rmaps/base/rmaps_base_frame.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. orte_rmaps_base_register
  2. orte_rmaps_base_close
  3. orte_rmaps_base_open
  4. check_modifiers
  5. orte_rmaps_base_set_mapping_policy
  6. orte_rmaps_base_set_ranking_policy

   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2011 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2006-2015 Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2011-2013 Los Alamos National Security, LLC.
  14  *                         All rights reserved.
  15  * Copyright (c) 2014-2019 Intel, Inc.  All rights reserved.
  16  * Copyright (c) 2014-2015 Research Organization for Information Science
  17  *                         and Technology (RIST). All rights reserved.
  18  * $COPYRIGHT$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  23  */
  24 
  25 #include "orte_config.h"
  26 #include "orte/constants.h"
  27 
  28 #include <string.h>
  29 
  30 #include "orte/mca/mca.h"
  31 #include "opal/util/argv.h"
  32 #include "opal/util/output.h"
  33 #include "opal/util/printf.h"
  34 #include "opal/mca/base/base.h"
  35 
  36 #include "orte/runtime/orte_globals.h"
  37 #include "orte/util/show_help.h"
  38 #include "orte/mca/errmgr/errmgr.h"
  39 
  40 #include "orte/mca/rmaps/base/rmaps_private.h"
  41 #include "orte/mca/rmaps/base/base.h"
  42 /*
  43  * The following file was created by configure.  It contains extern
  44  * statements and the definition of an array of pointers to each
  45  * component's public mca_base_component_t struct.
  46  */
  47 
  48 #include "orte/mca/rmaps/base/static-components.h"
  49 
  50 /*
  51  * Global variables
  52  */
  53 orte_rmaps_base_t orte_rmaps_base = {{{0}}};
  54 bool orte_rmaps_base_pernode = false;
  55 int orte_rmaps_base_n_pernode = 0;
  56 int orte_rmaps_base_n_persocket = 0;
  57 
  58 /*
  59  * Local variables
  60  */
  61 static char *rmaps_base_mapping_policy = NULL;
  62 static char *rmaps_base_ranking_policy = NULL;
  63 static bool rmaps_base_bycore = false;
  64 static bool rmaps_base_byslot = false;
  65 static bool rmaps_base_bynode = false;
  66 static bool rmaps_base_no_schedule_local = false;
  67 static bool rmaps_base_no_oversubscribe = false;
  68 static bool rmaps_base_oversubscribe = false;
  69 static bool rmaps_base_display_devel_map = false;
  70 static bool rmaps_base_display_diffable_map = false;
  71 static char *rmaps_base_topo_file = NULL;
  72 static char *rmaps_dist_device = NULL;
  73 static bool rmaps_base_inherit = false;
  74 
  75 static int orte_rmaps_base_register(mca_base_register_flag_t flags)
  76 {
  77     int var_id;
  78 
  79     orte_rmaps_base_pernode = false;
  80     var_id = mca_base_var_register("orte", "rmaps", "base", "pernode",
  81                                  "Launch one ppn as directed",
  82                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
  83                                  OPAL_INFO_LVL_9,
  84                                  MCA_BASE_VAR_SCOPE_READONLY,
  85                                  &orte_rmaps_base_pernode);
  86     (void) mca_base_var_register_synonym(var_id, "orte", "rmaps", "ppr", "pernode", 0);
  87 
  88     orte_rmaps_base_n_pernode = 0;
  89     var_id = mca_base_var_register("orte", "rmaps", "base", "n_pernode",
  90                                  "Launch n procs/node", MCA_BASE_VAR_TYPE_INT,
  91                                  NULL, 0, 0,
  92                                  OPAL_INFO_LVL_9,
  93                                  MCA_BASE_VAR_SCOPE_READONLY, &orte_rmaps_base_n_pernode);
  94     (void) mca_base_var_register_synonym(var_id, "orte", "rmaps","ppr", "n_pernode", 0);
  95 
  96     orte_rmaps_base_n_persocket = 0;
  97     var_id = mca_base_var_register("orte", "rmaps", "base", "n_persocket",
  98                                  "Launch n procs/socket", MCA_BASE_VAR_TYPE_INT,
  99                                  NULL, 0, 0,
 100                                  OPAL_INFO_LVL_9,
 101                                  MCA_BASE_VAR_SCOPE_READONLY, &orte_rmaps_base_n_persocket);
 102     (void) mca_base_var_register_synonym(var_id, "orte", "rmaps","ppr", "n_persocket", 0);
 103 
 104     orte_rmaps_base.ppr = NULL;
 105     var_id = mca_base_var_register("orte", "rmaps", "base", "pattern",
 106                                  "Comma-separated list of number of processes on a given resource type [default: none]",
 107                                  MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_9,
 108                                  MCA_BASE_VAR_SCOPE_READONLY, &orte_rmaps_base.ppr);
 109     (void) mca_base_var_register_synonym(var_id, "orte", "rmaps","ppr", "pattern", 0);
 110 
 111     /* define default mapping policy */
 112     rmaps_base_mapping_policy = NULL;
 113     var_id = mca_base_var_register("orte", "rmaps", "base", "mapping_policy",
 114                                    "Mapping Policy [slot | hwthread | core (default:np<=2) | l1cache | l2cache | l3cache | socket (default:np>2) | numa | board | node | seq | dist | ppr], with allowed modifiers :PE=y,SPAN,OVERSUBSCRIBE,NOOVERSUBSCRIBE",
 115                                    MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
 116                                    OPAL_INFO_LVL_9,
 117                                    MCA_BASE_VAR_SCOPE_READONLY,
 118                                    &rmaps_base_mapping_policy);
 119     (void) mca_base_var_register_synonym(var_id, "orte", "rmaps", "base", "schedule_policy",
 120                                          MCA_BASE_VAR_SYN_FLAG_DEPRECATED);
 121 
 122     /* define default ranking policy */
 123     rmaps_base_ranking_policy = NULL;
 124     (void) mca_base_var_register("orte", "rmaps", "base", "ranking_policy",
 125                                            "Ranking Policy [slot (default:np<=2) | hwthread | core | l1cache | l2cache | l3cache | socket (default:np>2) | numa | board | node], with modifier :SPAN or :FILL",
 126                                 MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
 127                                 OPAL_INFO_LVL_9,
 128                                 MCA_BASE_VAR_SCOPE_READONLY,
 129                                 &rmaps_base_ranking_policy);
 130 
 131     /* backward compatibility */
 132     rmaps_base_bycore = false;
 133     (void) mca_base_var_register("orte", "rmaps", "base", "bycore",
 134                                  "Whether to map and rank processes round-robin by core",
 135                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 136                                  OPAL_INFO_LVL_9,
 137                                  MCA_BASE_VAR_SCOPE_READONLY, &rmaps_base_bycore);
 138 
 139     rmaps_base_byslot = false;
 140     (void) mca_base_var_register("orte", "rmaps", "base", "byslot",
 141                                  "Whether to map and rank processes round-robin by slot",
 142                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 143                                  OPAL_INFO_LVL_9,
 144                                  MCA_BASE_VAR_SCOPE_READONLY, &rmaps_base_byslot);
 145 
 146     rmaps_base_bynode = false;
 147     (void) mca_base_var_register("orte", "rmaps", "base", "bynode",
 148                                  "Whether to map and rank processes round-robin by node",
 149                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 150                                  OPAL_INFO_LVL_9,
 151                                  MCA_BASE_VAR_SCOPE_READONLY, &rmaps_base_bynode);
 152 
 153     /* #cpus/rank to use */
 154     orte_rmaps_base.cpus_per_rank = 0;
 155     var_id = mca_base_var_register("orte", "rmaps", "base", "cpus_per_proc",
 156                                    "Number of cpus to use for each rank [1-2**15 (default=1)]",
 157                                    MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 158                                    OPAL_INFO_LVL_9,
 159                                    MCA_BASE_VAR_SCOPE_READONLY, &orte_rmaps_base.cpus_per_rank);
 160     mca_base_var_register_synonym(var_id, "orte", "rmaps", "base", "cpus_per_rank", 0);
 161 
 162     rmaps_dist_device = NULL;
 163     var_id = mca_base_var_register("orte", "rmaps", NULL, "dist_device",
 164                                    "If specified, map processes near to this device. Any device name that is identified by the lstopo hwloc utility as Net or OpenFabrics (for example eth0, mlx4_0, etc) or special name as auto ",
 165                                    MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
 166                                    OPAL_INFO_LVL_9,
 167                                    MCA_BASE_VAR_SCOPE_READONLY,
 168                                    &rmaps_dist_device);
 169 
 170     rmaps_base_no_schedule_local = false;
 171     (void) mca_base_var_register("orte", "rmaps", "base", "no_schedule_local",
 172                                  "If false, allow scheduling MPI applications on the same node as mpirun (default).  If true, do not schedule any MPI applications on the same node as mpirun",
 173                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 174                                  OPAL_INFO_LVL_9,
 175                                  MCA_BASE_VAR_SCOPE_READONLY, &rmaps_base_no_schedule_local);
 176 
 177     /** default condition that allows oversubscription */
 178     rmaps_base_no_oversubscribe = false;
 179     (void) mca_base_var_register("orte", "rmaps", "base", "no_oversubscribe",
 180                                  "If true, then do not allow oversubscription of nodes - mpirun will return an error if there aren't enough nodes to launch all processes without oversubscribing",
 181                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 182                                  OPAL_INFO_LVL_9,
 183                                  MCA_BASE_VAR_SCOPE_READONLY, &rmaps_base_no_oversubscribe);
 184 
 185     rmaps_base_oversubscribe = false;
 186     (void) mca_base_var_register("orte", "rmaps", "base", "oversubscribe",
 187                                  "If true, then allow oversubscription of nodes and overloading of processing elements",
 188                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 189                                  OPAL_INFO_LVL_9,
 190                                  MCA_BASE_VAR_SCOPE_READONLY, &rmaps_base_oversubscribe);
 191 
 192     /* should we display the map after determining it? */
 193     orte_rmaps_base.display_map = false;
 194     (void) mca_base_var_register("orte", "rmaps", "base", "display_map",
 195                                  "Whether to display the process map after it is computed",
 196                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 197                                  OPAL_INFO_LVL_9,
 198                                  MCA_BASE_VAR_SCOPE_READONLY, &orte_rmaps_base.display_map);
 199 
 200     rmaps_base_display_devel_map = false;
 201     (void) mca_base_var_register("orte", "rmaps", "base", "display_devel_map",
 202                                  "Whether to display a developer-detail process map after it is computed",
 203                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 204                                  OPAL_INFO_LVL_9,
 205                                  MCA_BASE_VAR_SCOPE_READONLY, &rmaps_base_display_devel_map);
 206 
 207     /* should we display the topology along with the map? */
 208     orte_display_topo_with_map = false;
 209     (void) mca_base_var_register("orte", "rmaps", "base", "display_topo_with_map",
 210                                  "Whether to display the topology with the map",
 211                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 212                                  OPAL_INFO_LVL_9,
 213                                  MCA_BASE_VAR_SCOPE_READONLY, &orte_display_topo_with_map);
 214 
 215     rmaps_base_display_diffable_map = false;
 216     (void) mca_base_var_register("orte", "rmaps", "base", "display_diffable_map",
 217                                  "Whether to display a diffable process map after it is computed",
 218                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 219                                  OPAL_INFO_LVL_9,
 220                                  MCA_BASE_VAR_SCOPE_READONLY, &rmaps_base_display_diffable_map);
 221 
 222     rmaps_base_topo_file = NULL;
 223     (void) mca_base_var_register("orte", "rmaps", "base", "topology",
 224                                  "hwloc topology file (xml format) describing the topology of the compute nodes [default: none]",
 225                                  MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_9,
 226                                  MCA_BASE_VAR_SCOPE_READONLY, &rmaps_base_topo_file);
 227 
 228     rmaps_base_inherit = false;
 229     (void) mca_base_var_register("orte", "rmaps", "base", "inherit",
 230                                  "Whether child jobs shall inherit launch directives",
 231                                  MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 232                                  OPAL_INFO_LVL_9,
 233                                  MCA_BASE_VAR_SCOPE_READONLY, &rmaps_base_inherit);
 234 
 235     return ORTE_SUCCESS;
 236 }
 237 
 238 static int orte_rmaps_base_close(void)
 239 {
 240     opal_list_item_t *item;
 241 
 242     /* cleanup globals */
 243     while (NULL != (item = opal_list_remove_first(&orte_rmaps_base.selected_modules))) {
 244         OBJ_RELEASE(item);
 245     }
 246     OBJ_DESTRUCT(&orte_rmaps_base.selected_modules);
 247 
 248     return mca_base_framework_components_close(&orte_rmaps_base_framework, NULL);
 249 }
 250 
 251 /**
 252  * Function for finding and opening either all MCA components, or the one
 253  * that was specifically requested via a MCA parameter.
 254  */
 255 static int orte_rmaps_base_open(mca_base_open_flag_t flags)
 256 {
 257     int rc;
 258 
 259     /* init the globals */
 260     OBJ_CONSTRUCT(&orte_rmaps_base.selected_modules, opal_list_t);
 261     orte_rmaps_base.slot_list = NULL;
 262     orte_rmaps_base.mapping = 0;
 263     orte_rmaps_base.ranking = 0;
 264     orte_rmaps_base.device = NULL;
 265     orte_rmaps_base.inherit = rmaps_base_inherit;
 266 
 267     /* if a topology file was given, then set our topology
 268      * from it. Even though our actual topology may differ,
 269      * mpirun only needs to see the compute node topology
 270      * for mapping purposes
 271      */
 272     if (NULL != rmaps_base_topo_file) {
 273         if (OPAL_SUCCESS != (rc = opal_hwloc_base_set_topology(rmaps_base_topo_file))) {
 274             orte_show_help("help-orte-rmaps-base.txt", "topo-file", true, rmaps_base_topo_file);
 275             return ORTE_ERR_SILENT;
 276         }
 277     }
 278 
 279     /* check for violations that has to be detected before we parse the mapping option */
 280     if (NULL != orte_rmaps_base.ppr) {
 281         orte_show_help("help-orte-rmaps-base.txt", "deprecated", true,
 282                        "--ppr, -ppr", "--map-by ppr:<pattern>",
 283                        "rmaps_base_pattern, rmaps_ppr_pattern",
 284                        "rmaps_base_mapping_policy=ppr:<pattern>");
 285         /* if the mapping policy is NULL, then we can proceed */
 286         if (NULL == rmaps_base_mapping_policy) {
 287             opal_asprintf(&rmaps_base_mapping_policy, "ppr:%s", orte_rmaps_base.ppr);
 288         } else {
 289             return ORTE_ERR_SILENT;
 290         }
 291     }
 292 
 293     if (0 < orte_rmaps_base.cpus_per_rank) {
 294         orte_show_help("help-orte-rmaps-base.txt", "deprecated", true,
 295                        "--cpus-per-proc, -cpus-per-proc, --cpus-per-rank, -cpus-per-rank",
 296                        "--map-by <obj>:PE=N, default <obj>=NUMA",
 297                        "rmaps_base_cpus_per_proc", "rmaps_base_mapping_policy=<obj>:PE=N, default <obj>=NUMA");
 298     }
 299 
 300     if (ORTE_SUCCESS != (rc = orte_rmaps_base_set_mapping_policy(NULL, &orte_rmaps_base.mapping,
 301                                                                  &orte_rmaps_base.device,
 302                                                                  rmaps_base_mapping_policy))) {
 303         return rc;
 304     }
 305 
 306     if (ORTE_SUCCESS != (rc = orte_rmaps_base_set_ranking_policy(&orte_rmaps_base.ranking,
 307                                                                  orte_rmaps_base.mapping,
 308                                                                  rmaps_base_ranking_policy))) {
 309         return rc;
 310     }
 311 
 312     if (rmaps_base_bycore) {
 313         orte_show_help("help-orte-rmaps-base.txt", "deprecated", true,
 314                        "--bycore, -bycore", "--map-by core",
 315                        "rmaps_base_bycore", "rmaps_base_mapping_policy=core");
 316         /* set mapping policy to bycore - error if something else already set */
 317         if ((ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) &&
 318             ORTE_GET_MAPPING_POLICY(orte_rmaps_base.mapping) != ORTE_MAPPING_BYCORE) {
 319             /* error - cannot redefine the default mapping policy */
 320             orte_show_help("help-orte-rmaps-base.txt", "redefining-policy", true, "mapping",
 321                            "bycore", orte_rmaps_base_print_mapping(orte_rmaps_base.mapping));
 322             return ORTE_ERR_SILENT;
 323         }
 324         ORTE_SET_MAPPING_POLICY(orte_rmaps_base.mapping, ORTE_MAPPING_BYCORE);
 325         ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_GIVEN);
 326         /* set ranking policy to bycore - error if something else already set */
 327         if ((ORTE_RANKING_GIVEN & ORTE_GET_RANKING_DIRECTIVE(orte_rmaps_base.ranking)) &&
 328             ORTE_GET_RANKING_POLICY(orte_rmaps_base.ranking) != ORTE_RANK_BY_CORE) {
 329             /* error - cannot redefine the default ranking policy */
 330             orte_show_help("help-orte-rmaps-base.txt", "redefining-policy", true, "ranking",
 331                            "bycore", orte_rmaps_base_print_ranking(orte_rmaps_base.ranking));
 332             return ORTE_ERR_SILENT;
 333         }
 334         ORTE_SET_RANKING_POLICY(orte_rmaps_base.ranking, ORTE_RANK_BY_CORE);
 335         ORTE_SET_RANKING_DIRECTIVE(orte_rmaps_base.ranking, ORTE_RANKING_GIVEN);
 336     }
 337 
 338     if (rmaps_base_byslot) {
 339         orte_show_help("help-orte-rmaps-base.txt", "deprecated", true,
 340                        "--byslot, -byslot", "--map-by slot",
 341                        "rmaps_base_byslot", "rmaps_base_mapping_policy=slot");
 342         /* set mapping policy to byslot - error if something else already set */
 343         if ((ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) &&
 344             ORTE_GET_MAPPING_POLICY(orte_rmaps_base.mapping) != ORTE_MAPPING_BYSLOT) {
 345             /* error - cannot redefine the default mapping policy */
 346             orte_show_help("help-orte-rmaps-base.txt", "redefining-policy", true, "mapping",
 347                            "byslot", orte_rmaps_base_print_mapping(orte_rmaps_base.mapping));
 348             return ORTE_ERR_SILENT;
 349         }
 350         ORTE_SET_MAPPING_POLICY(orte_rmaps_base.mapping, ORTE_MAPPING_BYSLOT);
 351         ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_GIVEN);
 352         /* set ranking policy to byslot - error if something else already set */
 353         if ((ORTE_RANKING_GIVEN & ORTE_GET_RANKING_DIRECTIVE(orte_rmaps_base.ranking)) &&
 354             ORTE_GET_RANKING_POLICY(orte_rmaps_base.ranking) != ORTE_RANK_BY_SLOT) {
 355             /* error - cannot redefine the default ranking policy */
 356             orte_show_help("help-orte-rmaps-base.txt", "redefining-policy", true, "ranking",
 357                            "byslot", orte_rmaps_base_print_ranking(orte_rmaps_base.ranking));
 358             return ORTE_ERR_SILENT;
 359         }
 360         ORTE_SET_RANKING_POLICY(orte_rmaps_base.ranking, ORTE_RANK_BY_SLOT);
 361         ORTE_SET_RANKING_DIRECTIVE(orte_rmaps_base.ranking, ORTE_RANKING_GIVEN);
 362     }
 363 
 364     if (rmaps_base_bynode) {
 365         orte_show_help("help-orte-rmaps-base.txt", "deprecated", true,
 366                        "--bynode, -bynode", "--map-by node",
 367                        "rmaps_base_bynode", "rmaps_base_mapping_policy=node");
 368         /* set mapping policy to bynode - error if something else already set */
 369         if ((ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) &&
 370             ORTE_GET_MAPPING_POLICY(orte_rmaps_base.mapping) != ORTE_MAPPING_BYNODE) {
 371             orte_show_help("help-orte-rmaps-base.txt", "redefining-policy", true, "mapping",
 372                            "bynode", orte_rmaps_base_print_mapping(orte_rmaps_base.mapping));
 373             return ORTE_ERR_SILENT;
 374         }
 375         ORTE_SET_MAPPING_POLICY(orte_rmaps_base.mapping, ORTE_MAPPING_BYNODE);
 376         ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_GIVEN);
 377         /* set ranking policy to bynode - error if something else already set */
 378         if ((ORTE_RANKING_GIVEN & ORTE_GET_RANKING_DIRECTIVE(orte_rmaps_base.ranking)) &&
 379             ORTE_GET_RANKING_POLICY(orte_rmaps_base.ranking) != ORTE_RANK_BY_NODE) {
 380             /* error - cannot redefine the default ranking policy */
 381             orte_show_help("help-orte-rmaps-base.txt", "redefining-policy", true, "ranking",
 382                            "bynode", orte_rmaps_base_print_ranking(orte_rmaps_base.ranking));
 383             return ORTE_ERR_SILENT;
 384         }
 385         ORTE_SET_RANKING_POLICY(orte_rmaps_base.ranking, ORTE_RANK_BY_NODE);
 386         ORTE_SET_RANKING_DIRECTIVE(orte_rmaps_base.ranking, ORTE_RANKING_GIVEN);
 387     }
 388 
 389     if (0 < orte_rmaps_base.cpus_per_rank) {
 390         /* if we were asked for cpus/proc, then we have to
 391          * bind to those cpus - any other binding policy is an
 392          * error
 393          */
 394         if (OPAL_BINDING_POLICY_IS_SET(opal_hwloc_binding_policy)) {
 395             if (opal_hwloc_use_hwthreads_as_cpus) {
 396                 if (OPAL_BIND_TO_HWTHREAD != OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy) &&
 397                     OPAL_BIND_TO_NONE != OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) {
 398                     orte_show_help("help-orte-rmaps-base.txt", "mismatch-binding", true,
 399                                    orte_rmaps_base.cpus_per_rank, "use-hwthreads-as-cpus",
 400                                    opal_hwloc_base_print_binding(opal_hwloc_binding_policy),
 401                                    "bind-to hwthread");
 402                     return ORTE_ERR_SILENT;
 403                 }
 404             } else if (OPAL_BIND_TO_CORE != OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy) &&
 405                        OPAL_BIND_TO_NONE != OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) {
 406                 orte_show_help("help-orte-rmaps-base.txt", "mismatch-binding", true,
 407                                orte_rmaps_base.cpus_per_rank, "cores as cpus",
 408                                opal_hwloc_base_print_binding(opal_hwloc_binding_policy),
 409                                "bind-to core");
 410                 return ORTE_ERR_SILENT;
 411             }
 412         } else {
 413             if (opal_hwloc_use_hwthreads_as_cpus) {
 414                 OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_HWTHREAD);
 415             } else {
 416                 OPAL_SET_BINDING_POLICY(opal_hwloc_binding_policy, OPAL_BIND_TO_CORE);
 417             }
 418         }
 419         if (1 < orte_rmaps_base.cpus_per_rank) {
 420             /* we need to ensure we are mapping to a high-enough level to have
 421              * multiple cpus beneath it - by default, we'll go to the NUMA level */
 422             if (ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) {
 423                 if (ORTE_GET_MAPPING_POLICY(orte_rmaps_base.mapping) == ORTE_MAPPING_BYHWTHREAD ||
 424                   (ORTE_GET_MAPPING_POLICY(orte_rmaps_base.mapping) == ORTE_MAPPING_BYCORE &&
 425                   !opal_hwloc_use_hwthreads_as_cpus)) {
 426                     orte_show_help("help-orte-rmaps-base.txt", "mapping-too-low-init", true);
 427                     return ORTE_ERR_SILENT;
 428                 }
 429             } else {
 430                 opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
 431                                     "%s rmaps:base pe/rank set - setting mapping to BYNUMA",
 432                                     ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
 433                 ORTE_SET_MAPPING_POLICY(orte_rmaps_base.mapping, ORTE_MAPPING_BYNUMA);
 434                 ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_GIVEN);
 435             }
 436         }
 437     }
 438 
 439     if (orte_rmaps_base_pernode) {
 440         /* if the user didn't specify a mapping directive, then match it */
 441         if (!(ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
 442             /* ensure we set the mapping policy to ppr */
 443             ORTE_SET_MAPPING_POLICY(orte_rmaps_base.mapping, ORTE_MAPPING_PPR);
 444             ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_GIVEN);
 445             /* define the ppr */
 446             orte_rmaps_base.ppr = strdup("1:node");
 447         }
 448     }
 449 
 450     if (0 < orte_rmaps_base_n_pernode) {
 451          /* if the user didn't specify a mapping directive, then match it */
 452          if (!(ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
 453              /* ensure we set the mapping policy to ppr */
 454              ORTE_SET_MAPPING_POLICY(orte_rmaps_base.mapping, ORTE_MAPPING_PPR);
 455              ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_GIVEN);
 456              /* define the ppr */
 457              opal_asprintf(&orte_rmaps_base.ppr, "%d:node", orte_rmaps_base_n_pernode);
 458          }
 459     }
 460 
 461     if (0 < orte_rmaps_base_n_persocket) {
 462         /* if the user didn't specify a mapping directive, then match it */
 463         if (!(ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
 464             /* ensure we set the mapping policy to ppr */
 465             ORTE_SET_MAPPING_POLICY(orte_rmaps_base.mapping, ORTE_MAPPING_PPR);
 466             ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_GIVEN);
 467             /* define the ppr */
 468             opal_asprintf(&orte_rmaps_base.ppr, "%d:socket", orte_rmaps_base_n_persocket);
 469         }
 470     }
 471 
 472     /* Should we schedule on the local node or not? */
 473     if (rmaps_base_no_schedule_local) {
 474         orte_rmaps_base.mapping |= ORTE_MAPPING_NO_USE_LOCAL;
 475     }
 476 
 477     /* Should we oversubscribe or not? */
 478     if (rmaps_base_no_oversubscribe) {
 479         if ((ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) &&
 480             !(ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
 481             /* error - cannot redefine the default mapping policy */
 482             orte_show_help("help-orte-rmaps-base.txt", "redefining-policy", true, "mapping",
 483                            "no-oversubscribe", orte_rmaps_base_print_mapping(orte_rmaps_base.mapping));
 484             return ORTE_ERR_SILENT;
 485         }
 486         ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_NO_OVERSUBSCRIBE);
 487         ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_SUBSCRIBE_GIVEN);
 488     }
 489 
 490     /** force oversubscription permission */
 491     if (rmaps_base_oversubscribe) {
 492         if ((ORTE_MAPPING_SUBSCRIBE_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) &&
 493             (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping))) {
 494             /* error - cannot redefine the default mapping policy */
 495             orte_show_help("help-orte-rmaps-base.txt", "redefining-policy", true, "mapping",
 496                            "oversubscribe", orte_rmaps_base_print_mapping(orte_rmaps_base.mapping));
 497             return ORTE_ERR_SILENT;
 498         }
 499         ORTE_UNSET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_NO_OVERSUBSCRIBE);
 500         ORTE_SET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping, ORTE_MAPPING_SUBSCRIBE_GIVEN);
 501         /* also set the overload allowed flag */
 502         opal_hwloc_binding_policy |= OPAL_BIND_ALLOW_OVERLOAD;
 503     }
 504 
 505     /* should we display a detailed (developer-quality) version of the map after determining it? */
 506     if (rmaps_base_display_devel_map) {
 507         orte_rmaps_base.display_map = true;
 508         orte_devel_level_output = true;
 509     }
 510 
 511     /* should we display a diffable report of proc locations after determining it? */
 512     if (rmaps_base_display_diffable_map) {
 513         orte_rmaps_base.display_map = true;
 514         orte_display_diffable_output = true;
 515     }
 516 
 517     /* Open up all available components */
 518     rc = mca_base_framework_components_open(&orte_rmaps_base_framework, flags);
 519 
 520     /* check to see if any component indicated a problem */
 521     if (ORTE_MAPPING_CONFLICTED & ORTE_GET_MAPPING_DIRECTIVE(orte_rmaps_base.mapping)) {
 522         /* the component would have already reported the error, so
 523          * tell the rest of the chain to shut up
 524          */
 525         return ORTE_ERR_SILENT;
 526     }
 527 
 528     /* All done */
 529     return rc;
 530 }
 531 
 532 MCA_BASE_FRAMEWORK_DECLARE(orte, rmaps, "ORTE Mapping Subsystem",
 533                            orte_rmaps_base_register, orte_rmaps_base_open, orte_rmaps_base_close,
 534                            mca_rmaps_base_static_components, 0);
 535 
 536 OBJ_CLASS_INSTANCE(orte_rmaps_base_selected_module_t,
 537                    opal_list_item_t,
 538                    NULL, NULL);
 539 
 540 
 541 static int check_modifiers(char *ck, orte_mapping_policy_t *tmp)
 542 {
 543     char **ck2, *ptr;
 544     int i;
 545     bool found = false;
 546 
 547     opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
 548                         "%s rmaps:base check modifiers with %s",
 549                         ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
 550                         (NULL == ck) ? "NULL" : ck);
 551 
 552     if (NULL == ck) {
 553         return ORTE_SUCCESS;
 554     }
 555 
 556     ck2 = opal_argv_split(ck, ',');
 557     for (i=0; NULL != ck2[i]; i++) {
 558         if (0 == strncasecmp(ck2[i], "span", strlen(ck2[i]))) {
 559             ORTE_SET_MAPPING_DIRECTIVE(*tmp, ORTE_MAPPING_SPAN);
 560             found = true;
 561         } else if (0 == strncasecmp(ck2[i], "pe", strlen("pe"))) {
 562             /* break this at the = sign to get the number */
 563             if (NULL == (ptr = strchr(ck2[i], '='))) {
 564                 /* missing the value */
 565                 orte_show_help("help-orte-rmaps-base.txt", "missing-value", true, "pe", ck2[i]);
 566                 opal_argv_free(ck2);
 567                 return ORTE_ERR_SILENT;
 568             }
 569             ptr++;
 570             orte_rmaps_base.cpus_per_rank = strtol(ptr, NULL, 10);
 571             opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
 572                                 "%s rmaps:base setting pe/rank to %d",
 573                                 ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
 574                                 orte_rmaps_base.cpus_per_rank);
 575             found = true;
 576         } else if (0 == strncasecmp(ck2[i], "oversubscribe", strlen(ck2[i]))) {
 577             ORTE_UNSET_MAPPING_DIRECTIVE(*tmp, ORTE_MAPPING_NO_OVERSUBSCRIBE);
 578             ORTE_SET_MAPPING_DIRECTIVE(*tmp, ORTE_MAPPING_SUBSCRIBE_GIVEN);
 579             found = true;
 580         } else if (0 == strncasecmp(ck2[i], "nooversubscribe", strlen(ck2[i]))) {
 581             ORTE_SET_MAPPING_DIRECTIVE(*tmp, ORTE_MAPPING_NO_OVERSUBSCRIBE);
 582             ORTE_SET_MAPPING_DIRECTIVE(*tmp, ORTE_MAPPING_SUBSCRIBE_GIVEN);
 583             found = true;
 584         } else {
 585             /* unrecognized modifier */
 586             opal_argv_free(ck2);
 587             return ORTE_ERR_BAD_PARAM;
 588         }
 589     }
 590     opal_argv_free(ck2);
 591     if (found) {
 592         return ORTE_SUCCESS;
 593     }
 594     return ORTE_ERR_TAKE_NEXT_OPTION;
 595 }
 596 
 597 int orte_rmaps_base_set_mapping_policy(orte_job_t *jdata,
 598                                        orte_mapping_policy_t *policy,
 599                                        char **device, char *inspec)
 600 {
 601     char *ck;
 602     char *ptr, *cptr;
 603     orte_mapping_policy_t tmp;
 604     int rc;
 605     size_t len;
 606     char *spec;
 607     char *pch;
 608 
 609     /* set defaults */
 610     tmp = 0;
 611     if (NULL != device) {
 612         *device = NULL;
 613     }
 614 
 615     opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
 616                         "%s rmaps:base set policy with %s device %s",
 617                         ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
 618                         (NULL == inspec) ? "NULL" : inspec,
 619                         (NULL == device) ? "NULL" : "NONNULL");
 620 
 621     if (NULL == inspec) {
 622         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYSOCKET);
 623         goto setpolicy;
 624     }
 625 
 626     spec = strdup(inspec);  // protect the input string
 627     /* see if a colon was included - if so, then we have a policy + modifier */
 628     ck = strchr(spec, ':');
 629     if (NULL != ck) {
 630         /* if the colon is the first character of the string, then we
 631          * just have modifiers on the default mapping policy */
 632         if (ck == spec) {
 633             ck++;  // step over the colon
 634             opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
 635                                 "%s rmaps:base only modifiers %s provided - assuming bysocket mapping",
 636                                 ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ck);
 637             ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYSOCKET);
 638             if (ORTE_ERR_SILENT == (rc = check_modifiers(ck, &tmp)) &&
 639                 ORTE_ERR_BAD_PARAM != rc) {
 640                 free(spec);
 641                 return ORTE_ERR_SILENT;
 642             }
 643             free(spec);
 644             goto setpolicy;
 645         }
 646         *ck = '\0';  // terminate spec where the colon was
 647         ck++;    // step past the colon
 648         opal_output_verbose(5, orte_rmaps_base_framework.framework_output,
 649                             "%s rmaps:base policy %s modifiers %s provided",
 650                             ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), spec, ck);
 651 
 652         if (0 == strncasecmp(spec, "ppr", strlen(spec))) {
 653             /* at this point, ck points to a string that contains at least
 654              * two fields (specifying the #procs/obj and the object we are
 655              * to map by). we have to allow additional modifiers here - e.g.,
 656              * specifying #pe's/proc or oversubscribe - so check for modifiers. if
 657              * they are present, ck will look like "N:obj:mod1,mod2,mod3"
 658              */
 659             if (NULL == (ptr = strchr(ck, ':'))) {
 660                 /* this is an error - there had to be at least one
 661                  * colon to delimit the number from the object type
 662                  */
 663                 orte_show_help("help-orte-rmaps-base.txt", "invalid-pattern", true, inspec);
 664                 free(spec);
 665                 return ORTE_ERR_SILENT;
 666             }
 667             ptr++; // move past the colon
 668             /* at this point, ptr is pointing to the beginning of the string that describes
 669              * the object plus any modifiers (i.e., "obj:mod1,mod2". We first check to see if there
 670              * is another colon indicating that there are modifiers to the request */
 671             if (NULL != (cptr = strchr(ptr, ':'))) {
 672                 /* there are modifiers, so we terminate the object string
 673                  * at the location of the colon */
 674                 *cptr = '\0';
 675                 /* step over that colon */
 676                 cptr++;
 677                 /* now check for modifiers  - may be none, so
 678                  * don't emit an error message if the modifier
 679                  * isn't recognized */
 680                 if (ORTE_ERR_SILENT == (rc = check_modifiers(cptr, &tmp)) &&
 681                     ORTE_ERR_BAD_PARAM != rc) {
 682                     free(spec);
 683                     return ORTE_ERR_SILENT;
 684                 }
 685             }
 686             /* now save the pattern */
 687             if (NULL == jdata || NULL == jdata->map) {
 688                 orte_rmaps_base.ppr = strdup(ck);
 689             } else {
 690                 jdata->map->ppr = strdup(ck);
 691             }
 692             ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_PPR);
 693             ORTE_SET_MAPPING_DIRECTIVE(tmp, ORTE_MAPPING_GIVEN);
 694             free(spec);
 695             goto setpolicy;
 696         }
 697         if (ORTE_SUCCESS != (rc = check_modifiers(ck, &tmp)) &&
 698             ORTE_ERR_TAKE_NEXT_OPTION != rc) {
 699             if (ORTE_ERR_BAD_PARAM == rc) {
 700                 orte_show_help("help-orte-rmaps-base.txt", "unrecognized-modifier", true, inspec);
 701             }
 702             free(spec);
 703             return rc;
 704         }
 705     }
 706     len = strlen(spec);
 707     if (0 == strncasecmp(spec, "slot", len)) {
 708         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYSLOT);
 709     } else if (0 == strncasecmp(spec, "node", len)) {
 710         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYNODE);
 711     } else if (0 == strncasecmp(spec, "seq", len)) {
 712         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_SEQ);
 713     } else if (0 == strncasecmp(spec, "core", len)) {
 714         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYCORE);
 715     } else if (0 == strncasecmp(spec, "l1cache", len)) {
 716         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYL1CACHE);
 717     } else if (0 == strncasecmp(spec, "l2cache", len)) {
 718         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYL2CACHE);
 719     } else if (0 == strncasecmp(spec, "l3cache", len)) {
 720         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYL3CACHE);
 721     } else if (0 == strncasecmp(spec, "socket", len)) {
 722         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYSOCKET);
 723     } else if (0 == strncasecmp(spec, "numa", len)) {
 724         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYNUMA);
 725     } else if (0 == strncasecmp(spec, "board", len)) {
 726         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYBOARD);
 727     } else if (0 == strncasecmp(spec, "hwthread", len)) {
 728         ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYHWTHREAD);
 729         /* if we are mapping processes to individual hwthreads, then
 730          * we need to treat those hwthreads as separate cpus
 731          */
 732         opal_hwloc_use_hwthreads_as_cpus = true;
 733     } else if (0 == strncasecmp(spec, "dist", len)) {
 734         if (NULL != rmaps_dist_device) {
 735             if (NULL != (pch = strchr(rmaps_dist_device, ':'))) {
 736                 *pch = '\0';
 737             }
 738             if (NULL != device) {
 739                 *device = strdup(rmaps_dist_device);
 740             }
 741             ORTE_SET_MAPPING_POLICY(tmp, ORTE_MAPPING_BYDIST);
 742         } else {
 743             orte_show_help("help-orte-rmaps-base.txt", "device-not-specified", true);
 744             free(spec);
 745             return ORTE_ERR_SILENT;
 746         }
 747     } else {
 748         orte_show_help("help-orte-rmaps-base.txt", "unrecognized-policy", true, "mapping", spec);
 749         free(spec);
 750         return ORTE_ERR_SILENT;
 751     }
 752     free(spec);
 753     ORTE_SET_MAPPING_DIRECTIVE(tmp, ORTE_MAPPING_GIVEN);
 754 
 755  setpolicy:
 756     if (NULL == jdata || NULL == jdata->map) {
 757         *policy = tmp;
 758     } else {
 759         jdata->map->mapping = tmp;
 760     }
 761 
 762     return ORTE_SUCCESS;
 763 }
 764 
 765 int orte_rmaps_base_set_ranking_policy(orte_ranking_policy_t *policy,
 766                                        orte_mapping_policy_t mapping,
 767                                        char *spec)
 768 {
 769     orte_mapping_policy_t map;
 770     orte_ranking_policy_t tmp;
 771     char **ck;
 772     size_t len;
 773 
 774     /* set default */
 775     tmp = 0;
 776 
 777     if (NULL == spec) {
 778         /* check for map-by object directives - we set the
 779          * ranking to match if one was given
 780          */
 781         if (ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE(mapping)) {
 782             map = ORTE_GET_MAPPING_POLICY(mapping);
 783             switch (map) {
 784             case ORTE_MAPPING_BYSLOT:
 785                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_SLOT);
 786                 break;
 787             case ORTE_MAPPING_BYNODE:
 788                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_NODE);
 789                 break;
 790             case ORTE_MAPPING_BYCORE:
 791                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_CORE);
 792                 break;
 793             case ORTE_MAPPING_BYL1CACHE:
 794                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_L1CACHE);
 795                 break;
 796             case ORTE_MAPPING_BYL2CACHE:
 797                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_L2CACHE);
 798                 break;
 799             case ORTE_MAPPING_BYL3CACHE:
 800                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_L3CACHE);
 801                 break;
 802             case ORTE_MAPPING_BYSOCKET:
 803                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_SOCKET);
 804                 break;
 805             case ORTE_MAPPING_BYNUMA:
 806                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_NUMA);
 807                 break;
 808             case ORTE_MAPPING_BYBOARD:
 809                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_BOARD);
 810                 break;
 811             case ORTE_MAPPING_BYHWTHREAD:
 812                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_HWTHREAD);
 813                 break;
 814             default:
 815                 /* anything not tied to a specific hw obj can rank by slot */
 816                 ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_SLOT);
 817                 break;
 818             }
 819         } else {
 820             /* if no map-by was given, default to by-slot */
 821             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_SLOT);
 822         }
 823     } else {
 824         ck = opal_argv_split(spec, ':');
 825         if (2 < opal_argv_count(ck)) {
 826             /* incorrect format */
 827             orte_show_help("help-orte-rmaps-base.txt", "unrecognized-policy", true, "ranking", policy);
 828             opal_argv_free(ck);
 829             return ORTE_ERR_SILENT;
 830         }
 831         if (2 == opal_argv_count(ck)) {
 832             if (0 == strncasecmp(ck[1], "span", strlen(ck[1]))) {
 833                 ORTE_SET_RANKING_DIRECTIVE(tmp, ORTE_RANKING_SPAN);
 834             } else if (0 == strncasecmp(ck[1], "fill", strlen(ck[1]))) {
 835                 ORTE_SET_RANKING_DIRECTIVE(tmp, ORTE_RANKING_FILL);
 836             } else {
 837                 /* unrecognized modifier */
 838                 orte_show_help("help-orte-rmaps-base.txt", "unrecognized-modifier", true, ck[1]);
 839                 opal_argv_free(ck);
 840                 return ORTE_ERR_SILENT;
 841             }
 842         }
 843         len = strlen(ck[0]);
 844         if (0 == strncasecmp(ck[0], "slot", len)) {
 845             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_SLOT);
 846         } else if (0 == strncasecmp(ck[0], "node", len)) {
 847             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_NODE);
 848         } else if (0 == strncasecmp(ck[0], "hwthread", len)) {
 849             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_HWTHREAD);
 850         } else if (0 == strncasecmp(ck[0], "core", len)) {
 851             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_CORE);
 852         } else if (0 == strncasecmp(ck[0], "l1cache", len)) {
 853             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_L1CACHE);
 854         } else if (0 == strncasecmp(ck[0], "l2cache", len)) {
 855             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_L2CACHE);
 856         } else if (0 == strncasecmp(ck[0], "l3cache", len)) {
 857             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_L3CACHE);
 858         } else if (0 == strncasecmp(ck[0], "socket", len)) {
 859             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_SOCKET);
 860         } else if (0 == strncasecmp(ck[0], "numa", len)) {
 861             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_NUMA);
 862         } else if (0 == strncasecmp(ck[0], "board", len)) {
 863             ORTE_SET_RANKING_POLICY(tmp, ORTE_RANK_BY_BOARD);
 864         } else {
 865             orte_show_help("help-orte-rmaps-base.txt", "unrecognized-policy", true, "ranking", rmaps_base_ranking_policy);
 866             opal_argv_free(ck);
 867             return ORTE_ERR_SILENT;
 868         }
 869         opal_argv_free(ck);
 870         ORTE_SET_RANKING_DIRECTIVE(tmp, ORTE_RANKING_GIVEN);
 871     }
 872 
 873     *policy = tmp;
 874     return ORTE_SUCCESS;
 875 }

/* [<][>][^][v][top][bottom][index][help] */