Upgrade macos

This commit is contained in:
Bassem Girgis
2025-03-19 08:52:56 -05:00
parent 53580cb51f
commit d29ef955f5
8041 changed files with 1936720 additions and 130842 deletions

View File

@@ -0,0 +1,161 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2020 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2021-2023 Nanook Consulting. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
* rmaps framework base functionality.
*/
#ifndef PRTE_MCA_RMAPS_BASE_H
#define PRTE_MCA_RMAPS_BASE_H
/*
* includes
*/
#include "prte_config.h"
#include "types.h"
#include "src/class/pmix_list.h"
#include "src/mca/mca.h"
#include "src/mca/base/pmix_mca_base_framework.h"
#include "src/mca/schizo/schizo.h"
#include "src/util/pmix_printf.h"
#include "src/runtime/prte_globals.h"
#include "src/mca/rmaps/rmaps.h"
BEGIN_C_DECLS
/*
* MCA Framework
*/
PRTE_EXPORT extern pmix_mca_base_framework_t prte_rmaps_base_framework;
/* select a component */
PRTE_EXPORT int prte_rmaps_base_select(void);
/*
* Global functions for MCA overall collective open and close
*/
/**
* Struct to hold data global to the rmaps framework
*/
typedef struct {
/* list of selected modules */
pmix_list_t selected_modules;
/* default mapping/ranking directives */
prte_mapping_policy_t mapping;
prte_ranking_policy_t ranking;
/* default device for dist mapping */
char *device;
/* whether or not child jobs should inherit mapping/ranking/binding directives from their parent
* by default */
bool inherit;
/* whether or not we are using hwthreads as independent cpus by default */
bool hwthread_cpus;
/* default file for use in sequential and rankfile mapping
* when the directive comes thru MCA param */
char *file;
hwloc_cpuset_t available, baseset; // scratch for binding calculation
char *default_mapping_policy;
/* whether or not to require hwtcpus due to topology limitations */
bool require_hwtcpus;
} prte_rmaps_base_t;
/**
* Global instance of rmaps-wide framework data
*/
PRTE_EXPORT extern prte_rmaps_base_t prte_rmaps_base;
/**
* Select an rmaps component / module
*/
typedef struct {
pmix_list_item_t super;
int pri;
prte_rmaps_base_module_t *module;
pmix_mca_base_component_t *component;
} prte_rmaps_base_selected_module_t;
PMIX_CLASS_DECLARATION(prte_rmaps_base_selected_module_t);
/*
* Map a job
*/
PRTE_EXPORT void prte_rmaps_base_map_job(int sd, short args, void *cbdata);
/**
* Utility routines to get/set vpid mapping for the job
*/
PRTE_EXPORT int prte_rmaps_base_get_vpid_range(pmix_nspace_t jobid, pmix_rank_t *start,
pmix_rank_t *range);
PRTE_EXPORT int prte_rmaps_base_set_vpid_range(pmix_nspace_t jobid, pmix_rank_t start,
pmix_rank_t range);
/* pretty-print functions */
PRTE_EXPORT char *prte_rmaps_base_print_mapping(prte_mapping_policy_t mapping);
PRTE_EXPORT char *prte_rmaps_base_print_ranking(prte_ranking_policy_t ranking);
PRTE_EXPORT int prte_rmaps_base_prep_topology(hwloc_topology_t topo);
PRTE_EXPORT int prte_rmaps_base_filter_nodes(prte_app_context_t *app, pmix_list_t *nodes,
bool remove);
PRTE_EXPORT int prte_rmaps_base_set_default_mapping(prte_job_t *jdata,
prte_rmaps_options_t *options);
PRTE_EXPORT int prte_rmaps_base_set_mapping_policy(prte_job_t *jdata, char *spec);
PRTE_EXPORT int prte_rmaps_base_set_default_ranking(prte_job_t *jdata,
prte_rmaps_options_t *options);
PRTE_EXPORT int prte_rmaps_base_set_ranking_policy(prte_job_t *jdata, char *spec);
PRTE_EXPORT void prte_rmaps_base_display_map(prte_job_t *jdata);
PRTE_EXPORT void prte_rmaps_base_report_bindings(prte_job_t *jdata,
prte_rmaps_options_t *options);
PRTE_EXPORT int prte_rmaps_base_get_ncpus(prte_node_t *node,
hwloc_obj_t obj,
prte_rmaps_options_t *options);
PRTE_EXPORT bool prte_rmaps_base_check_avail(prte_job_t *jdata,
prte_app_context_t *app,
prte_node_t *node,
pmix_list_t *node_list,
hwloc_obj_t obj,
prte_rmaps_options_t *options);
PRTE_EXPORT int prte_rmaps_base_check_oversubscribed(prte_job_t *jdata,
prte_app_context_t *app,
prte_node_t *node,
prte_rmaps_options_t *options);
PRTE_EXPORT void prte_rmaps_base_get_cpuset(prte_job_t *jdata,
prte_node_t *node,
prte_rmaps_options_t *options);
PRTE_EXPORT int prte_rmaps_base_check_support(prte_job_t *jdata,
prte_node_t *node,
prte_rmaps_options_t *options);
END_C_DECLS
#endif

View File

@@ -0,0 +1,78 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2020 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2017-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2021-2024 Nanook Consulting All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*/
#ifndef PRTE_MCA_RMAPS_PRIVATE_H
#define PRTE_MCA_RMAPS_PRIVATE_H
/*
* includes
*/
#include "prte_config.h"
#include "types.h"
#include "src/hwloc/hwloc-internal.h"
#include "src/runtime/prte_globals.h"
#include "src/mca/schizo/schizo.h"
#include "src/mca/rmaps/rmaps.h"
BEGIN_C_DECLS
/*
* Base API functions
*/
/* LOCAL FUNCTIONS for use by RMAPS components */
PRTE_EXPORT int prte_rmaps_base_get_target_nodes(pmix_list_t *node_list, int32_t *total_num_slots,
prte_job_t *jdata, prte_app_context_t *app,
prte_mapping_policy_t policy, bool initial_map,
bool silent, bool keepall);
PRTE_EXPORT prte_proc_t *prte_rmaps_base_setup_proc(prte_job_t *jdata,
prte_app_idx_t idx,
prte_node_t *node,
hwloc_obj_t obj,
prte_rmaps_options_t *options);
PRTE_EXPORT void prte_rmaps_base_get_starting_point(pmix_list_t *node_list,
prte_job_t *jdata);
PRTE_EXPORT int prte_rmaps_base_compute_vpids(prte_job_t *jdata,
prte_rmaps_options_t *options);
PRTE_EXPORT int prte_rmaps_base_bind_proc(prte_job_t *jdata,
prte_proc_t *proc,
prte_node_t *node,
hwloc_obj_t obj,
prte_rmaps_options_t *options);
PRTE_EXPORT void prte_rmaps_base_update_local_ranks(prte_job_t *jdata, prte_node_t *oldnode,
prte_node_t *newnode, prte_proc_t *newproc);
END_C_DECLS
#endif

View File

@@ -0,0 +1,99 @@
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2020 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2011 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2017-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*
* The PRTE Resource MAPping Subsystem (RMAPS)
*
* The resource mapping subsystem is responsible for mapping processes
* to specific nodes/cpus within a given job. In many systems, this
* functionality will not be supported - the system will map processes
* wherever it chooses and does not allow the user to specify the
* mapping. RMAPS components, therefore, provide services for those
* systems that do permit such mappings.
*
* RMAPS checks the MCA parameters to see if a mapping algorithm has
* been specified. If the user selected a mapping algorithm, the
* indicated RMAPS component will take information from the registry
* to determine the number of applications/processes to be run, and
* the identified resources that have been allocated to this job. The
* selected RMAP component will then assign processes to resources
* according to its algorithm, with the results stored on the
* appropriate job segment - the assigned nodename for each process is
* stored in that respective process' container on the segment.
*
*/
#ifndef PRTE_MCA_RMAPS_H
#define PRTE_MCA_RMAPS_H
#include "prte_config.h"
#include "types.h"
#include "src/mca/mca.h"
#include "src/pmix/pmix-internal.h"
#include "src/runtime/prte_globals.h"
#include "src/mca/rmaps/rmaps_types.h"
BEGIN_C_DECLS
/*
* rmaps module functions
*/
/**
* RMAPS module functions - these are not accessible to the outside world,
* but are defined here by convention
*/
/* map a job - used by the HNP to compute the #procs on each node.
* This is passed to the backend daemons as a regex which they
* use to create an prte_job_map_t for the job */
typedef int (*prte_rmaps_base_module_map_fn_t)(prte_job_t *jdata,
prte_rmaps_options_t *options);
/*
* rmaps module version 4.0.0
*/
struct prte_rmaps_base_module_4_0_0_t {
/** Mapping function pointer */
prte_rmaps_base_module_map_fn_t map_job;
};
/** Convenience typedef */
typedef struct prte_rmaps_base_module_4_0_0_t prte_rmaps_base_module_4_0_0_t;
/** Convenience typedef */
typedef prte_rmaps_base_module_4_0_0_t prte_rmaps_base_module_t;
/*
* rmaps component
*/
/**
* rmaps component version 3.0.0
*/
typedef pmix_mca_base_component_t prte_rmaps_base_component_t;
END_C_DECLS
#endif

View File

@@ -0,0 +1,199 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2020 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*/
#ifndef PRTE_MCA_RMAPS_TYPES_H
#define PRTE_MCA_RMAPS_TYPES_H
#include "prte_config.h"
#include "constants.h"
#include "src/class/pmix_pointer_array.h"
#include "src/hwloc/hwloc-internal.h"
#include "src/runtime/prte_globals.h"
/*
* General MAP types - instanced in runtime/prte_globals_class_instances.h
*/
BEGIN_C_DECLS
typedef uint16_t prte_mapping_policy_t;
#define PRTE_MAPPING_POLICY PRTE_UINT16
typedef uint16_t prte_ranking_policy_t;
#define PRTE_RANKING_POLICY PRTE_UINT16
/*
* Structure that represents the mapping of a job to an
* allocated set of resources.
*/
struct prte_job_map_t {
pmix_object_t super;
/* user-specified mapping params */
char *req_mapper; /* requested mapper */
char *last_mapper; /* last mapper used */
prte_mapping_policy_t mapping;
prte_ranking_policy_t ranking;
prte_binding_policy_t binding;
bool rtos_set;
/* *** */
/* number of new daemons required to be launched
* to support this job map
*/
int32_t num_new_daemons;
/* starting vpid of the new daemons - they will
* be sequential from that point
*/
pmix_rank_t daemon_vpid_start;
/* number of nodes participating in this job */
int32_t num_nodes;
/* array of pointers to nodes in this map for this job */
pmix_pointer_array_t *nodes;
};
typedef struct prte_job_map_t prte_job_map_t;
PRTE_EXPORT PMIX_CLASS_DECLARATION(prte_job_map_t);
typedef struct {
/* input info */
uint16_t cpus_per_rank;
bool use_hwthreads;
int stream;
int verbosity;
char *cpuset;
hwloc_cpuset_t job_cpuset;
bool bindsupport;
bool donotlaunch;
bool membind_warned;
bool oversubscribe;
bool overload;
/* mapping values */
prte_mapping_policy_t map;
bool mapspan;
bool ordered;
prte_binding_policy_t mapdepth;
unsigned ncpus;
int nprocs;
hwloc_obj_type_t maptype;
unsigned cmaplvl;
/* #procs/resource as per PPR */
int pprn;
/* ranking values */
prte_ranking_policy_t rank;
bool userranked;
unsigned nnodes;
unsigned total_nobjs;
unsigned nobjs;
/* binding values */
prte_binding_policy_t bind;
bool dobind;
hwloc_obj_type_t hwb;
unsigned clvl;
/* usage tracking */
hwloc_cpuset_t target;
hwloc_obj_t obj;
} prte_rmaps_options_t;
/*
**
* Macro for use in components that are of type rmaps
*/
#define PRTE_RMAPS_BASE_VERSION_4_0_0 PRTE_MCA_BASE_VERSION_3_0_0("rmaps", 4, 0, 0)
/* define map-related directives */
#define PRTE_MAPPING_NO_USE_LOCAL 0x0100
#define PRTE_MAPPING_NO_OVERSUBSCRIBE 0x0200
#define PRTE_MAPPING_SUBSCRIBE_GIVEN 0x0400
#define PRTE_MAPPING_SPAN 0x0800
#define PRTE_MAPPING_ORDERED 0x1000
/* directives given */
#define PRTE_MAPPING_LOCAL_GIVEN 0x2000
#define PRTE_MAPPING_GIVEN 0x4000
/* macros to set/get/unset mapping directive */
#define PRTE_SET_MAPPING_DIRECTIVE(target, pol) (target) |= (pol)
#define PRTE_UNSET_MAPPING_DIRECTIVE(target, pol) (target) &= ~(pol)
#define PRTE_GET_MAPPING_DIRECTIVE(pol) ((pol) &0xff00)
/* round-robin policies */
/* start with hardware-based options
* so the values match the corresponding
* levels in src/hwloc/hwloc-internal.h
*/
#define PRTE_MAPPING_BYNODE 1
#define PRTE_MAPPING_BYNUMA 2
#define PRTE_MAPPING_BYPACKAGE 3
#define PRTE_MAPPING_BYL3CACHE 4
#define PRTE_MAPPING_BYL2CACHE 5
#define PRTE_MAPPING_BYL1CACHE 6
#define PRTE_MAPPING_BYCORE 7
#define PRTE_MAPPING_BYHWTHREAD 8
/* now take the other round-robin options */
#define PRTE_MAPPING_BYSLOT 9
#define PRTE_MAPPING_BYDIST 10
#define PRTE_MAPPING_PELIST 11
/* convenience - declare anything <= 15 to be round-robin*/
#define PRTE_MAPPING_RR 16
/* sequential policy */
#define PRTE_MAPPING_SEQ 20
#define PRTE_MAPPING_COLOCATE 21
/* rank file and other user-defined mapping */
#define PRTE_MAPPING_BYUSER 22
/* pattern-based mapping */
#define PRTE_MAPPING_PPR 23
/* macro to separate out the mapping policy
* from the directives
*/
#define PRTE_GET_MAPPING_POLICY(pol) ((pol) & 0x00ff)
/* macro to determine if mapping policy is set */
#define PRTE_MAPPING_POLICY_IS_SET(pol) ((pol) & 0x00ff)
#define PRTE_SET_MAPPING_POLICY(target, pol) (target) = (pol) | ((target) & 0xff00)
/* define ranking directives */
#define PRTE_RANKING_GIVEN 0x1000
#define PRTE_SET_RANKING_DIRECTIVE(target, pol) (target) |= (pol)
#define PRTE_UNSET_RANKING_DIRECTIVE(target, pol) (target) &= ~(pol)
#define PRTE_GET_RANKING_DIRECTIVE(pol) ((pol) & 0xf000)
/* define ranking policies */
#define PRTE_RANK_BY_NODE 1
#define PRTE_RANK_BY_SLOT 2
#define PRTE_RANK_BY_FILL 3
#define PRTE_RANK_BY_SPAN 4
#define PRTE_RANKING_BYUSER 5
#define PRTE_GET_RANKING_POLICY(pol) ((pol) &0x0fff)
/* macro to determine if ranking policy is set */
#define PRTE_RANKING_POLICY_IS_SET(pol) ((pol) & 0x0fff)
#define PRTE_SET_RANKING_POLICY(target, pol) (target) = (pol) | ((target) & 0xf000)
END_C_DECLS
#endif