root/orte/mca/rmaps/rmaps_types.h

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

INCLUDED FROM


   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2008 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) 2011-2017 Cisco Systems, Inc.  All rights reserved
  13  * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
  14  *                         reserved.
  15  * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 /** @file:
  23  */
  24 
  25 #ifndef ORTE_MCA_RMAPS_TYPES_H
  26 #define ORTE_MCA_RMAPS_TYPES_H
  27 
  28 #include "orte_config.h"
  29 #include "orte/constants.h"
  30 
  31 #include "opal/class/opal_pointer_array.h"
  32 #include "opal/mca/hwloc/hwloc-internal.h"
  33 
  34 #include "orte/runtime/orte_globals.h"
  35 
  36 /*
  37  * General MAP types - instanced in runtime/orte_globals_class_instances.h
  38  */
  39 
  40 BEGIN_C_DECLS
  41 
  42 typedef uint16_t orte_mapping_policy_t;
  43 #define ORTE_MAPPING_POLICY OPAL_UINT16
  44 typedef uint16_t orte_ranking_policy_t;
  45 #define ORTE_RANKING_POLICY OPAL_UINT16
  46 
  47 /*
  48  * Structure that represents the mapping of a job to an
  49  * allocated set of resources.
  50  */
  51 struct orte_job_map_t {
  52     opal_object_t super;
  53     /* user-specified mapping params */
  54     char *req_mapper;  /* requested mapper */
  55     char *last_mapper; /* last mapper used */
  56     orte_mapping_policy_t mapping;
  57     orte_ranking_policy_t ranking;
  58     opal_binding_policy_t binding;
  59     /* mapping options */
  60     char *ppr;
  61     int16_t cpus_per_rank;
  62     bool display_map;
  63     /* *** */
  64     /* number of new daemons required to be launched
  65      * to support this job map
  66      */
  67     orte_std_cntr_t num_new_daemons;
  68     /* starting vpid of the new daemons - they will
  69      * be sequential from that point
  70      */
  71     orte_vpid_t daemon_vpid_start;
  72     /* number of nodes participating in this job */
  73     orte_std_cntr_t num_nodes;
  74     /* array of pointers to nodes in this map for this job */
  75     opal_pointer_array_t *nodes;
  76 };
  77 typedef struct orte_job_map_t orte_job_map_t;
  78 ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_job_map_t);
  79 
  80 /**
  81  * Macro for use in components that are of type rmaps
  82  */
  83 #define ORTE_RMAPS_BASE_VERSION_2_0_0 \
  84     ORTE_MCA_BASE_VERSION_2_1_0("rmaps", 2, 0, 0)
  85 
  86 /* define map-related directives */
  87 #define ORTE_MAPPING_NO_USE_LOCAL      0x0100
  88 #define ORTE_MAPPING_NO_OVERSUBSCRIBE  0x0200
  89 #define ORTE_MAPPING_SUBSCRIBE_GIVEN   0x0400
  90 #define ORTE_MAPPING_SPAN              0x0800
  91 /* an error flag */
  92 #define ORTE_MAPPING_CONFLICTED        0x1000
  93 /* directives given */
  94 #define ORTE_MAPPING_LOCAL_GIVEN       0x2000
  95 #define ORTE_MAPPING_GIVEN             0x4000
  96 /* mapping a debugger job */
  97 #define ORTE_MAPPING_DEBUGGER          0x8000
  98 #define ORTE_SET_MAPPING_DIRECTIVE(target, pol) \
  99     (target) |= (pol)
 100 #define ORTE_UNSET_MAPPING_DIRECTIVE(target, pol) \
 101     (target) &= ~(pol)
 102 #define ORTE_GET_MAPPING_DIRECTIVE(pol) \
 103     ((pol) & 0xff00)
 104 
 105 /* round-robin policies */
 106 /* start with hardware-based options
 107  * so the values match the corresponding
 108  * levels in opal/mca/hwloc/hwloc-internal.h
 109  */
 110 #define ORTE_MAPPING_BYNODE            1
 111 #define ORTE_MAPPING_BYBOARD           2
 112 #define ORTE_MAPPING_BYNUMA            3
 113 #define ORTE_MAPPING_BYSOCKET          4
 114 #define ORTE_MAPPING_BYL3CACHE         5
 115 #define ORTE_MAPPING_BYL2CACHE         6
 116 #define ORTE_MAPPING_BYL1CACHE         7
 117 #define ORTE_MAPPING_BYCORE            8
 118 #define ORTE_MAPPING_BYHWTHREAD        9
 119 /* now take the other round-robin options */
 120 #define ORTE_MAPPING_BYSLOT            10
 121 #define ORTE_MAPPING_BYDIST            11
 122 /* convenience - declare anything <= 15 to be round-robin*/
 123 #define ORTE_MAPPING_RR                0x000f
 124 
 125 /* sequential policy */
 126 #define ORTE_MAPPING_SEQ               20
 127 /* staged execution mapping */
 128 #define ORTE_MAPPING_STAGED            21
 129 /* rank file and other user-defined mapping */
 130 #define ORTE_MAPPING_BYUSER            22
 131 /* pattern-based mapping */
 132 #define ORTE_MAPPING_PPR               23
 133 /* macro to separate out the mapping policy
 134  * from the directives
 135  */
 136 #define ORTE_GET_MAPPING_POLICY(pol) \
 137     ((pol) & 0x00ff)
 138 /* macro to determine if mapping policy is set */
 139 #define ORTE_MAPPING_POLICY_IS_SET(pol) \
 140     ((pol) & 0x00ff)
 141 #define ORTE_SET_MAPPING_POLICY(target, pol)     \
 142     (target) = (pol) | ((target) & 0xff00)
 143 
 144 /* define ranking directives */
 145 #define ORTE_RANKING_SPAN           0x1000
 146 #define ORTE_RANKING_FILL           0x2000
 147 #define ORTE_RANKING_GIVEN          0x4000
 148 #define ORTE_SET_RANKING_DIRECTIVE(target, pol) \
 149     (target) |= (pol)
 150 #define ORTE_UNSET_RANKING_DIRECTIVE(target, pol) \
 151     (target) &= ~(pol)
 152 #define ORTE_GET_RANKING_DIRECTIVE(pol) \
 153     ((pol) & 0xf000)
 154 
 155 /* define ranking policies */
 156 #define ORTE_RANK_BY_NODE           1
 157 #define ORTE_RANK_BY_BOARD          2
 158 #define ORTE_RANK_BY_NUMA           3
 159 #define ORTE_RANK_BY_SOCKET         4
 160 #define ORTE_RANK_BY_L3CACHE        5
 161 #define ORTE_RANK_BY_L2CACHE        6
 162 #define ORTE_RANK_BY_L1CACHE        7
 163 #define ORTE_RANK_BY_CORE           8
 164 #define ORTE_RANK_BY_HWTHREAD       9
 165 #define ORTE_RANK_BY_SLOT           10
 166 #define ORTE_GET_RANKING_POLICY(pol) \
 167     ((pol) & 0x0fff)
 168 /* macro to determine if ranking policy is set */
 169 #define ORTE_RANKING_POLICY_IS_SET(pol) \
 170     ((pol) & 0x0fff)
 171 #define ORTE_SET_RANKING_POLICY(target, pol)     \
 172     (target) = (pol) | ((target) & 0xf000)
 173 
 174 END_C_DECLS
 175 
 176 #endif

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