root/orte/include/orte/types.h

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

INCLUDED FROM


   1 /*
   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-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) 2014-2018 Intel, Inc. All rights reserved.
  13  * $COPYRIGHT$
  14  *
  15  * Additional copyrights may follow
  16  *
  17  * $HEADER$
  18  */
  19 /** @file */
  20 
  21 #ifndef ORTE_TYPES_H
  22 #define ORTE_TYPES_H
  23 
  24 #include "orte_config.h"
  25 
  26 #ifdef HAVE_SYS_TYPES_H
  27 #include <sys/types.h>
  28 #endif
  29 #include "opal/dss/dss_types.h"
  30 #include "opal/util/proc.h"
  31 
  32 /**
  33  * Supported datatypes for messaging and storage operations.
  34  */
  35 
  36 typedef int32_t orte_std_cntr_t;  /** standard counters used in ORTE */
  37 #define ORTE_STD_CNTR_T         OPAL_INT32
  38 #define ORTE_STD_CNTR_MAX       INT32_MAX
  39 #define ORTE_STD_CNTR_MIN       INT32_MIN
  40 #define ORTE_STD_CNTR_INVALID   -1
  41 
  42 /** rank on node, used for both local and node rank. We
  43  * don't send these around on their own, so don't create
  44  * dedicated type support for them - we are defining them
  45  * here solely for readability in the code and so we have
  46  * one place where any future changes can be made
  47  */
  48 typedef uint16_t orte_local_rank_t;
  49 typedef uint16_t orte_node_rank_t;
  50 #define ORTE_LOCAL_RANK         OPAL_UINT16
  51 #define ORTE_NODE_RANK          OPAL_UINT16
  52 #define ORTE_LOCAL_RANK_MAX     UINT16_MAX-1
  53 #define ORTE_NODE_RANK_MAX      UINT16_MAX-1
  54 #define ORTE_LOCAL_RANK_INVALID UINT16_MAX
  55 #define ORTE_NODE_RANK_INVALID  UINT16_MAX
  56 
  57 /* index for app_contexts */
  58 typedef uint32_t orte_app_idx_t;
  59 #define ORTE_APP_IDX        OPAL_UINT32
  60 #define ORTE_APP_IDX_MAX    UINT32_MAX
  61 
  62 /* general typedefs & structures */
  63 
  64 /* Equate the ORTE jobid/vpid types and their associated values/structs
  65  * to their OPAL equivalents
  66  */
  67 
  68 typedef opal_jobid_t orte_jobid_t;
  69 #define ORTE_JOBID_T        OPAL_JOBID_T
  70 #define ORTE_JOBID_MAX      OPAL_JOBID_MAX
  71 #define ORTE_JOBID_MIN      OPAL_JOBID_MIN
  72 typedef opal_vpid_t orte_vpid_t;
  73 #define ORTE_VPID_T         OPAL_VPID_T
  74 #define ORTE_VPID_MAX       OPAL_VPID_MAX
  75 #define ORTE_VPID_MIN       OPAL_VPID_MIX
  76 
  77 #define ORTE_PROCESS_NAME_HTON(n) OPAL_PROCESS_NAME_HTON(n)
  78 
  79 #define ORTE_PROCESS_NAME_NTOH(n) OPAL_PROCESS_NAME_NTOH(n)
  80 
  81 #define ORTE_NAME_ARGS(n) \
  82     (unsigned long) ((NULL == n) ? (unsigned long)ORTE_JOBID_INVALID : (unsigned long)(n)->jobid), \
  83     (unsigned long) ((NULL == n) ? (unsigned long)ORTE_VPID_INVALID : (unsigned long)(n)->vpid) \
  84 
  85 /*
  86  * define invalid values
  87  */
  88 #define ORTE_JOBID_INVALID          OPAL_JOBID_INVALID
  89 #define ORTE_VPID_INVALID           OPAL_VPID_INVALID
  90 #define ORTE_LOCAL_JOBID_INVALID    (ORTE_JOBID_INVALID & 0x0000FFFF)
  91 
  92 /*
  93  * define wildcard values
  94  */
  95 #define ORTE_JOBID_WILDCARD         OPAL_JOBID_WILDCARD
  96 #define ORTE_VPID_WILDCARD          OPAL_VPID_WILDCARD
  97 #define ORTE_LOCAL_JOBID_WILDCARD   (ORTE_JOBID_WILDCARD & 0x0000FFFF)
  98 
  99 /*
 100  * define the process name structure
 101  */
 102 typedef opal_process_name_t orte_process_name_t;
 103 
 104 
 105 /**
 106  * handle differences in iovec
 107  */
 108 
 109 #if defined(__APPLE__)
 110 typedef char* orte_iov_base_ptr_t;
 111 #else
 112 typedef void* orte_iov_base_ptr_t;
 113 #endif
 114 
 115 /* ORTE attribute */
 116 typedef uint16_t orte_attribute_key_t;
 117 #define ORTE_ATTR_KEY_T   OPAL_UINT16
 118 typedef struct {
 119     opal_list_item_t super;             /* required for this to be on lists */
 120     orte_attribute_key_t key;           /* key identifier */
 121     opal_data_type_t type;              /* the type of value stored */
 122     bool local;                         // whether or not to pack/send this value
 123     union {
 124         bool flag;
 125         uint8_t byte;
 126         char *string;
 127         size_t size;
 128         pid_t pid;
 129         int integer;
 130         int8_t int8;
 131         int16_t int16;
 132         int32_t int32;
 133         int64_t int64;
 134         unsigned int uint;
 135         uint8_t uint8;
 136         uint16_t uint16;
 137         uint32_t uint32;
 138         uint64_t uint64;
 139         opal_byte_object_t bo;
 140         opal_buffer_t buf;
 141         float fval;
 142         struct timeval tv;
 143         void *ptr;  // never packed or passed anywhere
 144         orte_vpid_t vpid;
 145         orte_jobid_t jobid;
 146         opal_process_name_t name;
 147         opal_envar_t envar;
 148     } data;
 149 } orte_attribute_t;
 150 OPAL_DECLSPEC OBJ_CLASS_DECLARATION(orte_attribute_t);
 151 
 152 
 153 /* Name-related types - equate to OPAL equivalents*/
 154 #define    ORTE_NAME                OPAL_NAME   /**< an orte_process_name_t */
 155 #define    ORTE_VPID                OPAL_VPID   /**< a vpid */
 156 #define    ORTE_JOBID               OPAL_JOBID  /**< a jobid */
 157 
 158 /* General ORTE types - support handled within DSS */
 159 #define    ORTE_STD_CNTR            (OPAL_DSS_ID_DYNAMIC + 1)  /**< standard counter type */
 160     /* State-related types */
 161 #define    ORTE_NODE_STATE          (OPAL_DSS_ID_DYNAMIC + 2)  /**< node status flag */
 162 #define    ORTE_PROC_STATE          (OPAL_DSS_ID_DYNAMIC + 3)  /**< process/resource status */
 163 #define    ORTE_JOB_STATE           (OPAL_DSS_ID_DYNAMIC + 4)  /**< job status flag */
 164 #define    ORTE_EXIT_CODE           (OPAL_DSS_ID_DYNAMIC + 5)  /**< process exit code */
 165     /* Data-passing types */
 166 #define    ORTE_VALUE               (OPAL_DSS_ID_DYNAMIC + 6)  /**< registry return value */
 167     /* Resource types */
 168 #define    ORTE_APP_CONTEXT         (OPAL_DSS_ID_DYNAMIC + 7) /**< argv and enviro arrays */
 169 #define    ORTE_NODE_DESC           (OPAL_DSS_ID_DYNAMIC + 8) /**< describes capabilities of nodes */
 170 #define    ORTE_SLOT_DESC           (OPAL_DSS_ID_DYNAMIC + 9) /**< describes slot allocations/reservations */
 171 #define    ORTE_JOB                 (OPAL_DSS_ID_DYNAMIC + 10) /**< job information */
 172 #define    ORTE_NODE                (OPAL_DSS_ID_DYNAMIC + 11) /**< node information */
 173 #define    ORTE_PROC                (OPAL_DSS_ID_DYNAMIC + 12) /**< process information */
 174 #define    ORTE_JOB_MAP             (OPAL_DSS_ID_DYNAMIC + 13) /**< map of process locations */
 175 
 176 /* RML types */
 177 #define    ORTE_RML_TAG             (OPAL_DSS_ID_DYNAMIC + 14) /**< tag for sending/receiving messages */
 178 /* DAEMON command type */
 179 #define    ORTE_DAEMON_CMD          (OPAL_DSS_ID_DYNAMIC + 15) /**< command flag for communicating with the daemon */
 180 
 181 /* IOF types */
 182 #define    ORTE_IOF_TAG             (OPAL_DSS_ID_DYNAMIC + 16)
 183 
 184 /* Attribute */
 185 #define    ORTE_ATTRIBUTE           (OPAL_DSS_ID_DYNAMIC + 17)
 186 /* Grpcomm signature */
 187 #define    ORTE_SIGNATURE           (OPAL_DSS_ID_DYNAMIC + 18)
 188 
 189 /* provide a boundary for others to use */
 190 #define    ORTE_DSS_ID_DYNAMIC      (OPAL_DSS_ID_DYNAMIC + 50)
 191 
 192 #endif

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