1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 #ifndef ORTE_ATTRS_H
  13 #define ORTE_ATTRS_H
  14 
  15 #include "orte_config.h"
  16 #include "orte/types.h"
  17 
  18 
  19 
  20 
  21 #define ORTE_ATTR_LOCAL    true      
  22 #define ORTE_ATTR_GLOBAL   false     
  23 
  24 
  25 
  26 #define ORTE_ATTR_KEY_BASE        0
  27 
  28 
  29 typedef uint8_t orte_app_context_flags_t;
  30 #define ORTE_APP_FLAG_USED_ON_NODE  0x01  
  31 
  32 
  33 
  34 #define ORTE_APP_HOSTFILE            1    
  35 #define ORTE_APP_ADD_HOSTFILE        2    
  36 #define ORTE_APP_DASH_HOST           3    
  37 #define ORTE_APP_ADD_HOST            4    
  38 #define ORTE_APP_USER_CWD            5    
  39 #define ORTE_APP_SSNDIR_CWD          6    
  40 #define ORTE_APP_PRELOAD_BIN         7    
  41 #define ORTE_APP_PRELOAD_FILES       8    
  42 #define ORTE_APP_SSTORE_LOAD         9    
  43 #define ORTE_APP_RECOV_DEF          10    
  44 #define ORTE_APP_MAX_RESTARTS       11    
  45 #define ORTE_APP_MIN_NODES          12    
  46 #define ORTE_APP_MANDATORY          13    
  47 #define ORTE_APP_MAX_PPN            14    
  48 #define ORTE_APP_PREFIX_DIR         15    
  49 #define ORTE_APP_NO_CACHEDIR        16    
  50 #define ORTE_APP_SET_ENVAR          17    
  51 #define ORTE_APP_UNSET_ENVAR        18    
  52 #define ORTE_APP_PREPEND_ENVAR      19    
  53 #define ORTE_APP_APPEND_ENVAR       20    
  54 #define ORTE_APP_ADD_ENVAR          21    
  55 #define ORTE_APP_PSET_NAME          23    
  56                                           
  57 
  58 #define ORTE_APP_MAX_KEY        100
  59 
  60 
  61 
  62 typedef uint8_t orte_node_flags_t;
  63 #define ORTE_NODE_FLAG_DAEMON_LAUNCHED    0x01   
  64 #define ORTE_NODE_FLAG_LOC_VERIFIED       0x02   
  65                                                  
  66 #define ORTE_NODE_FLAG_OVERSUBSCRIBED     0x04   
  67 #define ORTE_NODE_FLAG_MAPPED             0x08   
  68 #define ORTE_NODE_FLAG_SLOTS_GIVEN        0x10   
  69 #define ORTE_NODE_NON_USABLE              0x20   
  70 
  71 
  72 
  73 #define ORTE_NODE_START_KEY    ORTE_APP_MAX_KEY
  74 
  75 #define ORTE_NODE_USERNAME       (ORTE_NODE_START_KEY + 1)
  76 #define ORTE_NODE_LAUNCH_ID      (ORTE_NODE_START_KEY + 2)   
  77 #define ORTE_NODE_HOSTID         (ORTE_NODE_START_KEY + 3)   
  78                                                              
  79 #define ORTE_NODE_ALIAS          (ORTE_NODE_START_KEY + 4)   
  80 #define ORTE_NODE_SERIAL_NUMBER  (ORTE_NODE_START_KEY + 5)   
  81 #define ORTE_NODE_PORT           (ORTE_NODE_START_KEY + 6)   
  82 
  83 #define ORTE_NODE_MAX_KEY        200
  84 
  85 
  86 typedef uint16_t orte_job_flags_t;
  87 #define ORTE_JOB_FLAGS_T  OPAL_UINT16
  88 #define ORTE_JOB_FLAG_UPDATED            0x0001   
  89 #define ORTE_JOB_FLAG_RESTARTED          0x0004   
  90 #define ORTE_JOB_FLAG_ABORTED            0x0008   
  91 #define ORTE_JOB_FLAG_DEBUGGER_DAEMON    0x0010   
  92 #define ORTE_JOB_FLAG_FORWARD_OUTPUT     0x0020   
  93 #define ORTE_JOB_FLAG_DO_NOT_MONITOR     0x0040   
  94 #define ORTE_JOB_FLAG_FORWARD_COMM       0x0080   
  95 #define ORTE_JOB_FLAG_RECOVERABLE        0x0100   
  96 #define ORTE_JOB_FLAG_RESTART            0x0200   
  97 #define ORTE_JOB_FLAG_PROCS_MIGRATING    0x0400   
  98 #define ORTE_JOB_FLAG_OVERSUBSCRIBED     0x0800   
  99 
 100 
 101 #define ORTE_JOB_START_KEY   ORTE_NODE_MAX_KEY
 102 
 103 #define ORTE_JOB_LAUNCH_MSG_SENT        (ORTE_JOB_START_KEY + 1)     
 104 #define ORTE_JOB_LAUNCH_MSG_RECVD       (ORTE_JOB_START_KEY + 2)     
 105 #define ORTE_JOB_MAX_LAUNCH_MSG_RECVD   (ORTE_JOB_START_KEY + 3)     
 106 #define ORTE_JOB_CKPT_STATE             (ORTE_JOB_START_KEY + 5)     
 107 #define ORTE_JOB_SNAPSHOT_REF           (ORTE_JOB_START_KEY + 6)     
 108 #define ORTE_JOB_SNAPSHOT_LOC           (ORTE_JOB_START_KEY + 7)     
 109 #define ORTE_JOB_SNAPC_INIT_BAR         (ORTE_JOB_START_KEY + 8)     
 110 #define ORTE_JOB_SNAPC_FINI_BAR         (ORTE_JOB_START_KEY + 9)     
 111 #define ORTE_JOB_NUM_NONZERO_EXIT       (ORTE_JOB_START_KEY + 10)    
 112 #define ORTE_JOB_FAILURE_TIMER_EVENT    (ORTE_JOB_START_KEY + 11)    
 113 #define ORTE_JOB_ABORTED_PROC           (ORTE_JOB_START_KEY + 12)    
 114 #define ORTE_JOB_MAPPER                 (ORTE_JOB_START_KEY + 13)    
 115 #define ORTE_JOB_REDUCER                (ORTE_JOB_START_KEY + 14)    
 116 #define ORTE_JOB_COMBINER               (ORTE_JOB_START_KEY + 15)    
 117 #define ORTE_JOB_INDEX_ARGV             (ORTE_JOB_START_KEY + 16)    
 118 #define ORTE_JOB_NO_VM                  (ORTE_JOB_START_KEY + 17)    
 119 #define ORTE_JOB_SPIN_FOR_DEBUG         (ORTE_JOB_START_KEY + 18)    
 120 #define ORTE_JOB_CONTINUOUS_OP          (ORTE_JOB_START_KEY + 19)    
 121 #define ORTE_JOB_RECOVER_DEFINED        (ORTE_JOB_START_KEY + 20)    
 122 #define ORTE_JOB_NON_ORTE_JOB           (ORTE_JOB_START_KEY + 22)    
 123 #define ORTE_JOB_STDOUT_TARGET          (ORTE_JOB_START_KEY + 23)    
 124 #define ORTE_JOB_POWER                  (ORTE_JOB_START_KEY + 24)    
 125 #define ORTE_JOB_MAX_FREQ               (ORTE_JOB_START_KEY + 25)    
 126 #define ORTE_JOB_MIN_FREQ               (ORTE_JOB_START_KEY + 26)    
 127 #define ORTE_JOB_GOVERNOR               (ORTE_JOB_START_KEY + 27)    
 128 #define ORTE_JOB_FAIL_NOTIFIED          (ORTE_JOB_START_KEY + 28)    
 129 #define ORTE_JOB_TERM_NOTIFIED          (ORTE_JOB_START_KEY + 29)    
 130 #define ORTE_JOB_PEER_MODX_ID           (ORTE_JOB_START_KEY + 30)    
 131 #define ORTE_JOB_INIT_BAR_ID            (ORTE_JOB_START_KEY + 31)    
 132 #define ORTE_JOB_FINI_BAR_ID            (ORTE_JOB_START_KEY + 32)    
 133 #define ORTE_JOB_FWDIO_TO_TOOL          (ORTE_JOB_START_KEY + 33)    
 134 #define ORTE_JOB_PHYSICAL_CPUIDS        (ORTE_JOB_START_KEY + 34)    
 135 #define ORTE_JOB_LAUNCHED_DAEMONS       (ORTE_JOB_START_KEY + 35)    
 136 #define ORTE_JOB_REPORT_BINDINGS        (ORTE_JOB_START_KEY + 36)    
 137 #define ORTE_JOB_CPU_LIST               (ORTE_JOB_START_KEY + 37)    
 138 #define ORTE_JOB_NOTIFICATIONS          (ORTE_JOB_START_KEY + 38)    
 139 #define ORTE_JOB_ROOM_NUM               (ORTE_JOB_START_KEY + 39)    
 140 #define ORTE_JOB_LAUNCH_PROXY           (ORTE_JOB_START_KEY + 40)    
 141 #define ORTE_JOB_NSPACE_REGISTERED      (ORTE_JOB_START_KEY + 41)    
 142 #define ORTE_JOB_FIXED_DVM              (ORTE_JOB_START_KEY + 42)    
 143 #define ORTE_JOB_DVM_JOB                (ORTE_JOB_START_KEY + 43)    
 144 #define ORTE_JOB_CANCELLED              (ORTE_JOB_START_KEY + 44)    
 145 #define ORTE_JOB_OUTPUT_TO_FILE         (ORTE_JOB_START_KEY + 45)    
 146 #define ORTE_JOB_MERGE_STDERR_STDOUT    (ORTE_JOB_START_KEY + 46)    
 147 #define ORTE_JOB_TAG_OUTPUT             (ORTE_JOB_START_KEY + 47)    
 148 #define ORTE_JOB_TIMESTAMP_OUTPUT       (ORTE_JOB_START_KEY + 48)    
 149 #define ORTE_JOB_MULTI_DAEMON_SIM       (ORTE_JOB_START_KEY + 49)    
 150 #define ORTE_JOB_NOTIFY_COMPLETION      (ORTE_JOB_START_KEY + 50)    
 151 #define ORTE_JOB_TRANSPORT_KEY          (ORTE_JOB_START_KEY + 51)    
 152 #define ORTE_JOB_INFO_CACHE             (ORTE_JOB_START_KEY + 52)    
 153 #define ORTE_JOB_FULLY_DESCRIBED        (ORTE_JOB_START_KEY + 53)    
 154 #define ORTE_JOB_SILENT_TERMINATION     (ORTE_JOB_START_KEY + 54)    
 155                                                                      
 156 #define ORTE_JOB_SET_ENVAR              (ORTE_JOB_START_KEY + 55)    
 157 #define ORTE_JOB_UNSET_ENVAR            (ORTE_JOB_START_KEY + 56)    
 158 #define ORTE_JOB_PREPEND_ENVAR          (ORTE_JOB_START_KEY + 57)    
 159 #define ORTE_JOB_APPEND_ENVAR           (ORTE_JOB_START_KEY + 58)    
 160 #define ORTE_JOB_ADD_ENVAR              (ORTE_JOB_START_KEY + 59)    
 161 #define ORTE_JOB_APP_SETUP_DATA         (ORTE_JOB_START_KEY + 60)    
 162 
 163 #define ORTE_JOB_MAX_KEY   300
 164 
 165 
 166 
 167 typedef uint16_t orte_proc_flags_t;
 168 #define ORTE_PROC_FLAG_ALIVE         0x0001  
 169 #define ORTE_PROC_FLAG_ABORT         0x0002  
 170 #define ORTE_PROC_FLAG_UPDATED       0x0004  
 171 #define ORTE_PROC_FLAG_LOCAL         0x0008  
 172 #define ORTE_PROC_FLAG_REPORTED      0x0010  
 173 #define ORTE_PROC_FLAG_REG           0x0020  
 174 #define ORTE_PROC_FLAG_HAS_DEREG     0x0040  
 175 #define ORTE_PROC_FLAG_AS_MPI        0x0080  
 176 #define ORTE_PROC_FLAG_IOF_COMPLETE  0x0100  
 177 #define ORTE_PROC_FLAG_WAITPID       0x0200  
 178 #define ORTE_PROC_FLAG_RECORDED      0x0400  
 179 #define ORTE_PROC_FLAG_DATA_IN_SM    0x0800  
 180 #define ORTE_PROC_FLAG_DATA_RECVD    0x1000  
 181 #define ORTE_PROC_FLAG_SM_ACCESS     0x2000  
 182 #define ORTE_PROC_FLAG_TOOL          0x4000  
 183 
 184 
 185 #define ORTE_PROC_START_KEY   ORTE_JOB_MAX_KEY
 186 
 187 #define ORTE_PROC_NOBARRIER       (ORTE_PROC_START_KEY +  1)           
 188 #define ORTE_PROC_CPU_BITMAP      (ORTE_PROC_START_KEY +  2)           
 189 #define ORTE_PROC_HWLOC_LOCALE    (ORTE_PROC_START_KEY +  3)           
 190 #define ORTE_PROC_HWLOC_BOUND     (ORTE_PROC_START_KEY +  4)           
 191 #define ORTE_PROC_PRIOR_NODE      (ORTE_PROC_START_KEY +  5)           
 192 #define ORTE_PROC_NRESTARTS       (ORTE_PROC_START_KEY +  6)           
 193 #define ORTE_PROC_RESTART_TIME    (ORTE_PROC_START_KEY +  7)           
 194 #define ORTE_PROC_FAST_FAILS      (ORTE_PROC_START_KEY +  8)           
 195 #define ORTE_PROC_CKPT_STATE      (ORTE_PROC_START_KEY +  9)           
 196 #define ORTE_PROC_SNAPSHOT_REF    (ORTE_PROC_START_KEY + 10)           
 197 #define ORTE_PROC_SNAPSHOT_LOC    (ORTE_PROC_START_KEY + 11)           
 198 #define ORTE_PROC_NODENAME        (ORTE_PROC_START_KEY + 12)           
 199 #define ORTE_PROC_CGROUP          (ORTE_PROC_START_KEY + 13)           
 200 #define ORTE_PROC_NBEATS          (ORTE_PROC_START_KEY + 14)           
 201 
 202 #define ORTE_PROC_MAX_KEY   400
 203 
 204 
 205 #define ORTE_RML_START_KEY  ORTE_PROC_MAX_KEY
 206 #define ORTE_RML_TRANSPORT_TYPE         (ORTE_RML_START_KEY +  1)   
 207 #define ORTE_RML_PROTOCOL_TYPE          (ORTE_RML_START_KEY +  2)   
 208 #define ORTE_RML_CONDUIT_ID             (ORTE_RML_START_KEY +  3)   
 209 #define ORTE_RML_INCLUDE_COMP_ATTRIB    (ORTE_RML_START_KEY +  4)   
 210 #define ORTE_RML_EXCLUDE_COMP_ATTRIB    (ORTE_RML_START_KEY +  5)   
 211 #define ORTE_RML_TRANSPORT_ATTRIB       (ORTE_RML_START_KEY +  6)   
 212 #define ORTE_RML_QUALIFIER_ATTRIB       (ORTE_RML_START_KEY +  7)   
 213 #define ORTE_RML_PROVIDER_ATTRIB        (ORTE_RML_START_KEY +  8)   
 214 #define ORTE_RML_PROTOCOL_ATTRIB        (ORTE_RML_START_KEY +  9)   
 215 #define ORTE_RML_ROUTED_ATTRIB          (ORTE_RML_START_KEY + 10)   
 216 
 217 #define ORTE_ATTR_KEY_MAX  1000
 218 
 219 
 220 
 221 #define ORTE_FLAG_SET(p, f)         ((p)->flags |= (f))
 222 #define ORTE_FLAG_UNSET(p, f)       ((p)->flags &= ~(f))
 223 #define ORTE_FLAG_TEST(p, f)        ((p)->flags & (f))
 224 
 225 ORTE_DECLSPEC const char *orte_attr_key_to_str(orte_attribute_key_t key);
 226 
 227 
 228 ORTE_DECLSPEC bool orte_get_attribute(opal_list_t *attributes, orte_attribute_key_t key,
 229                                       void **data, opal_data_type_t type);
 230 
 231 
 232 ORTE_DECLSPEC int orte_set_attribute(opal_list_t *attributes, orte_attribute_key_t key,
 233                                      bool local, void *data, opal_data_type_t type);
 234 
 235 
 236 ORTE_DECLSPEC void orte_remove_attribute(opal_list_t *attributes, orte_attribute_key_t key);
 237 
 238 ORTE_DECLSPEC orte_attribute_t* orte_fetch_attribute(opal_list_t *attributes,
 239                                                      orte_attribute_t *prev,
 240                                                      orte_attribute_key_t key);
 241 
 242 ORTE_DECLSPEC int orte_add_attribute(opal_list_t *attributes,
 243                                      orte_attribute_key_t key, bool local,
 244                                      void *data, opal_data_type_t type);
 245 
 246 ORTE_DECLSPEC int orte_prepend_attribute(opal_list_t *attributes,
 247                                          orte_attribute_key_t key, bool local,
 248                                          void *data, opal_data_type_t type);
 249 
 250 ORTE_DECLSPEC int orte_attr_load(orte_attribute_t *kv,
 251                                  void *data, opal_data_type_t type);
 252 
 253 ORTE_DECLSPEC int orte_attr_unload(orte_attribute_t *kv,
 254                                    void **data, opal_data_type_t type);
 255 
 256 
 257 
 258 
 259 
 260 
 261 typedef char* (*orte_attr2str_fn_t)(orte_attribute_key_t key);
 262 
 263 ORTE_DECLSPEC int orte_attr_register(const char *project,
 264                                      orte_attribute_key_t key_base,
 265                                      orte_attribute_key_t key_max,
 266                                      orte_attr2str_fn_t converter);
 267 
 268 #endif