/* * Copyright (c) 2013-2022 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2013 Inria. All rights reserved. * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. * Copyright (c) 2014-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 Cisco Systems, Inc. All rights reserved * Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights * reserved. * Copyright (c) 2021 Nanook Consulting. All rights reserved. * Copyright (c) 2022 Triad National Security, LLC. All rights * reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ #ifndef OPAL_PROC_H #define OPAL_PROC_H #include "opal_config.h" #include "opal/class/opal_list.h" #include "opal/mca/hwloc/hwloc-internal.h" #include "opal/mca/pmix/pmix-internal.h" #include "opal/types.h" #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT # include #endif /** * This is a transparent handle proposed to the upper layer as a mean * to store whatever information it needs in order to efficiently * retrieve the RTE process naming scheme, and get access to the RTE * information associated with it. The only direct usage of this type * is to be copied from one structure to another, otherwise it should * only be used via the accessors defined below. */ #define OPAL_JOBID_T OPAL_UINT32 #define OPAL_JOBID_MAX UINT32_MAX - 2 #define OPAL_JOBID_MIN 0 #define OPAL_JOBID_INVALID (OPAL_JOBID_MAX + 2) #define OPAL_JOBID_WILDCARD (OPAL_JOBID_MAX + 1) #define OPAL_VPID_T OPAL_UINT32 #define OPAL_VPID_MAX UINT32_MAX - 2 #define OPAL_VPID_MIN 0 #define OPAL_VPID_INVALID (OPAL_VPID_MAX + 2) #define OPAL_VPID_WILDCARD (OPAL_VPID_MAX + 1) #define OPAL_PROC_MY_NAME (opal_proc_local_get()->proc_name) #define OPAL_PROC_MY_HOSTNAME (opal_process_info.nodename) #define OPAL_NAME_WILDCARD (&opal_name_wildcard) OPAL_DECLSPEC extern opal_process_name_t opal_name_wildcard; #define OPAL_NAME_INVALID (&opal_name_invalid) OPAL_DECLSPEC extern opal_process_name_t opal_name_invalid; #define OPAL_NAME_ARGS(n) \ (unsigned long) ((NULL == n) ? (unsigned long) OPAL_JOBID_INVALID \ : (unsigned long) (n)->jobid), \ (unsigned long) ((NULL == n) ? (unsigned long) OPAL_VPID_INVALID \ : (unsigned long) (n)->vpid) #if OPAL_ENABLE_HETEROGENEOUS_SUPPORT && !defined(WORDS_BIGENDIAN) # define OPAL_PROCESS_NAME_NTOH(guid) opal_process_name_ntoh_intr(&(guid)) static inline __opal_attribute_always_inline__ void opal_process_name_ntoh_intr(opal_process_name_t *name) { name->jobid = ntohl(name->jobid); name->vpid = ntohl(name->vpid); } # define OPAL_PROCESS_NAME_HTON(guid) opal_process_name_hton_intr(&(guid)) static inline __opal_attribute_always_inline__ void opal_process_name_hton_intr(opal_process_name_t *name) { name->jobid = htonl(name->jobid); name->vpid = htonl(name->vpid); } #else # define OPAL_PROCESS_NAME_NTOH(guid) # define OPAL_PROCESS_NAME_HTON(guid) #endif typedef struct opal_proc_t { /** allow proc to be placed on a list */ opal_list_item_t super; /** this process' name */ opal_process_name_t proc_name; /** architecture of this process */ uint32_t proc_arch; /** flags for this proc */ opal_hwloc_locality_t proc_flags; /** Base convertor for the proc described by this process */ struct opal_convertor_t *proc_convertor; } opal_proc_t; OBJ_CLASS_DECLARATION(opal_proc_t); typedef struct { opal_list_item_t super; opal_process_name_t name; } opal_namelist_t; OBJ_CLASS_DECLARATION(opal_namelist_t); typedef struct opal_process_info_t { opal_process_name_t my_name; pmix_proc_t myprocid; bool nativelaunch; /**< launched by mpirun */ char *nodename; /**< string name for this node */ char *top_session_dir; /**< Top-level session directory */ char *job_session_dir; /**< Session directory for job */ char *proc_session_dir; /**< Session directory for the process */ uint32_t num_local_peers; /**< number of procs from my job that share my node with me */ uint16_t my_local_rank; /**< local rank on this node within my job */ uint16_t my_node_rank; uint16_t my_numa_rank; /**< rank on this processes NUMA node. A value of UINT16_MAX indicates unavailable numa_rank */ char *cpuset; /**< String-representation of bitmap where we are bound */ char *locality; /**< String-representation of process locality */ pid_t pid; uint32_t num_procs; uint32_t app_num; uint32_t univ_size; char *app_sizes; char *app_ldrs; char *command; uint32_t num_apps; char *initial_wdir; uint32_t reincarnation; bool proc_is_bound; char *initial_errhandler; bool is_singleton; /**