root/ompi/mca/rte/pmix/rte_pmix.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. OMPI_CAST_RTE_NAME

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2012-2013 Los Alamos National Security, LLC.
   4  *                         All rights reserved.
   5  * Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
   6  * Copyright (c) 2014      Cisco Systems, Inc.  All rights reserved.
   7  * Copyright (c) 2014-2016 Research Organization for Information Science
   8  *                         and Technology (RIST). All rights reserved.
   9  * Copyright (c) 2015      Intel, Inc. All rights reserved.
  10  * Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
  11  * Copyright (c) 2018      Triad National Security, LLC. All rights
  12  *                         reserved.
  13  * $COPYRIGHT$
  14  *
  15  * Additional copyrights may follow
  16  *
  17  * $HEADER$
  18  *
  19  * When this component is used, this file is included in the rest of
  20  * the OPAL/OMPI code base via ompi/mca/rte/rte.h.  As such,
  21  * this header represents the public interface to this static component.
  22  */
  23 
  24 #ifndef MCA_OMPI_RTE_PMIX_H
  25 #define MCA_OMPI_RTE_PMIX_H
  26 
  27 #include "ompi_config.h"
  28 #include "ompi/constants.h"
  29 
  30 #include <stdint.h>
  31 
  32 #ifdef HAVE_SYS_TYPES_H
  33 #include <sys/types.h>
  34 #endif
  35 
  36 struct opal_proc_t;
  37 
  38 #include "opal/threads/threads.h"
  39 #include "opal/util/proc.h"
  40 #include "opal/mca/hwloc/hwloc-internal.h"
  41 #include "opal/mca/pmix/pmix.h"
  42 
  43 struct ompi_proc_t;
  44 struct ompi_communicator_t;
  45 
  46 BEGIN_C_DECLS
  47 
  48 /* Process name objects and operations */
  49 typedef opal_process_name_t ompi_process_name_t;
  50 typedef uint32_t ompi_jobid_t;
  51 typedef uint32_t ompi_vpid_t;
  52 
  53 /* some local storage */
  54 OMPI_DECLSPEC extern opal_process_name_t pmix_name_wildcard;
  55 OMPI_DECLSPEC extern hwloc_cpuset_t ompi_proc_applied_binding;
  56 
  57 #define OMPI_PROC_MY_NAME (&pmix_process_info.my_name)
  58 #define OMPI_NAME_WILDCARD  (&pmix_name_wildcard)
  59 
  60 typedef uint8_t ompi_rte_cmp_bitmask_t;
  61 #define OMPI_RTE_CMP_NONE   0x00
  62 #define OMPI_RTE_CMP_JOBID  0x02
  63 #define OMPI_RTE_CMP_VPID   0x04
  64 #define OMPI_RTE_CMP_ALL    0x0f
  65 #define OMPI_RTE_CMP_WILD   0x10
  66 
  67 OMPI_DECLSPEC char* ompi_pmix_print_name(const ompi_process_name_t *name);
  68 
  69 #define OMPI_NAME_PRINT(a) ompi_pmix_print_name(a)
  70 OMPI_DECLSPEC int ompi_rte_compare_name_fields(ompi_rte_cmp_bitmask_t mask,
  71                                                const opal_process_name_t* name1,
  72                                                const opal_process_name_t* name2);
  73 OMPI_DECLSPEC int ompi_rte_convert_string_to_process_name(opal_process_name_t *name,
  74                                                           const char* name_string);
  75 OMPI_DECLSPEC int ompi_rte_convert_process_name_to_string(char** name_string,
  76                                                           const opal_process_name_t *name);
  77 
  78 #define OMPI_LOCAL_JOBID(n) \
  79     ( (n) & 0x0000ffff)
  80 #define OMPI_JOB_FAMILY(n)  \
  81     (((n) >> 16) & 0x0000ffff)
  82 #define OMPI_CONSTRUCT_LOCAL_JOBID(local, job) \
  83     ( ((local) & 0xffff0000) | ((job) & 0x0000ffff) )
  84 #define OMPI_CONSTRUCT_JOB_FAMILY(n) \
  85     ( ((n) << 16) & 0xffff0000)
  86 
  87 #define OMPI_CONSTRUCT_JOBID(family, local) \
  88     OMPI_CONSTRUCT_LOCAL_JOBID(OMPI_CONSTRUCT_JOB_FAMILY(family), local)
  89 
  90 /* This is the DSS tag to serialize a proc name */
  91 #define OMPI_NAME OPAL_NAME
  92 #define OMPI_PROCESS_NAME_HTON OPAL_PROCESS_NAME_HTON
  93 #define OMPI_PROCESS_NAME_NTOH OPAL_PROCESS_NAME_NTOH
  94 
  95 #if OPAL_ENABLE_DEBUG
  96 static inline opal_process_name_t * OMPI_CAST_RTE_NAME(opal_process_name_t * name) {
  97     return (opal_process_name_t *)name;
  98 }
  99 #else
 100 #define OMPI_CAST_RTE_NAME(a) ((opal_process_name_t*)(a))
 101 #endif
 102 
 103 /* Process info struct and values */
 104 typedef uint16_t ompi_node_rank_t;
 105 typedef uint16_t ompi_local_rank_t;
 106 #define OMPI_NODE_RANK_INVALID UINT16_MAX
 107 #define OMPI_LOCAL_RANK_INVALID UINT16_MAX
 108 
 109 typedef struct {
 110     opal_process_name_t my_name;
 111     char *my_hnp_uri;
 112     char *nodename;
 113     pid_t pid;
 114     char *job_session_dir;
 115     char *proc_session_dir;
 116     uint16_t my_local_rank;
 117     uint16_t my_node_rank;
 118     int32_t num_local_peers;
 119     uint32_t num_procs;
 120     uint32_t app_num;
 121     char *cpuset;
 122 } pmix_process_info_t;
 123 OMPI_DECLSPEC extern pmix_process_info_t pmix_process_info;
 124 #define ompi_process_info pmix_process_info
 125 
 126 OMPI_DECLSPEC extern bool pmix_proc_is_bound;
 127 #define ompi_rte_proc_is_bound pmix_proc_is_bound
 128 
 129 /* Error handling objects and operations */
 130 OMPI_DECLSPEC void __opal_attribute_noreturn__
 131   ompi_rte_abort(int error_code, char *fmt, ...);
 132 OMPI_DECLSPEC void ompi_rte_abort_peers(opal_process_name_t *procs,
 133                                         int32_t num_procs,
 134                                         int error_code);
 135 #define OMPI_ERROR_LOG OPAL_ERROR_LOG
 136 
 137 /* Init and finalize operations */
 138 OMPI_DECLSPEC int ompi_rte_init(int *argc, char ***argv);
 139 OMPI_DECLSPEC int ompi_rte_finalize(void);
 140 OMPI_DECLSPEC void ompi_rte_wait_for_debugger(void);
 141 
 142 /* check dynamics support */
 143 OMPI_DECLSPEC bool ompi_rte_connect_accept_support(const char *port);
 144 
 145 END_C_DECLS
 146 
 147 #endif /* MCA_OMPI_RTE_PMIX_H */

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