Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:47:30

0001 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
0002 /*
0003  * Copyright (c) 2015-2020 Intel, Inc.  All rights reserved.
0004  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
0005  *                         reserved.
0006  * Copyright (c) 2020      IBM Corporation.  All rights reserved.
0007  * Copyright (c) 2020      Cisco Systems, Inc.  All rights reserved
0008  * Copyright (c) 2021-2023 Nanook Consulting.  All rights reserved.
0009  * Copyright (c) 2022      Triad National Security, LLC. All rights
0010  *                         reserved.
0011  * $COPYRIGHT$
0012  *
0013  * Additional copyrights may follow
0014  *
0015  * $HEADER$
0016  */
0017 /** @file:
0018  *
0019  * The PRTE Personality Framework (schizo)
0020  *
0021  * Multi-select framework so that multiple personalities can be
0022  * simultaneously supported
0023  *
0024  */
0025 
0026 #ifndef PRTE_MCA_SCHIZO_H
0027 #define PRTE_MCA_SCHIZO_H
0028 
0029 #include "prte_config.h"
0030 #include "types.h"
0031 
0032 #include "src/class/pmix_list.h"
0033 #include "src/hwloc/hwloc-internal.h"
0034 #include "src/mca/rmaps/rmaps_types.h"
0035 #include "src/pmix/pmix-internal.h"
0036 #include "src/util/pmix_cmd_line.h"
0037 
0038 #include "src/mca/mca.h"
0039 
0040 #include "src/runtime/prte_globals.h"
0041 
0042 BEGIN_C_DECLS
0043 
0044 typedef int (*prte_schizo_convertor_fn_t)(char *option, char ***argv, int idx);
0045 
0046 /*
0047  * schizo module functions
0048  */
0049 
0050 /**
0051  * SCHIZO module functions - the modules are accessed via
0052  * the base stub functions
0053  */
0054 
0055 /* initialize the module - allow it to do whatever one-time
0056  * things it requires */
0057 typedef int (*prte_schizo_base_module_init_fn_t)(void);
0058 
0059 /* parse a tool command line */
0060 typedef int (*prte_schizo_base_module_parse_cli_fn_t)(char **argv,
0061                                                       pmix_cli_result_t *results,
0062                                                       bool silent);
0063 
0064 /* detect if we are running as a proxy
0065  * Check the environment to determine what, if any, host we are running
0066  * under. Check the argv to see if we are running as a proxy for some
0067  * other command and to see which environment we are proxying. Return
0068  * a priority indicating the level of confidence this component has
0069  * that it is the proxy, with 100 being a definitive "yes". Highest
0070  * confidence wins.
0071  */
0072 typedef int (*prte_schizo_base_detect_proxy_fn_t)(char *cmdpath);
0073 
0074 /* parse the environment of the
0075  * tool to extract any personality-specific envars that need to be
0076  * forward to the app's environment upon execution */
0077 typedef int (*prte_schizo_base_module_parse_env_fn_t)(char **srcenv,
0078                                                       char ***dstenv,
0079                                                       pmix_cli_result_t *cli);
0080 
0081 /* check if running as root is allowed in this environment */
0082 typedef void (*prte_schizo_base_module_allow_run_as_root_fn_t)(pmix_cli_result_t *results);
0083 
0084 /* Set the default mapping policy for a job */
0085 typedef int (*prte_schizo_base_module_set_default_mapping_fn_t)(prte_job_t *jdata,
0086                                                                 prte_rmaps_options_t *options);
0087 
0088 typedef int (*prte_schizo_base_module_set_default_ranking_fn_t)(prte_job_t *jdata,
0089                                                                 prte_rmaps_options_t *options);
0090 
0091 typedef int (*prte_schizo_base_module_set_default_binding_fn_t)(prte_job_t *jdata,
0092                                                                 prte_rmaps_options_t *options);
0093 
0094 typedef int (*prte_schizo_base_module_set_default_rto_fn_t)(prte_job_t *jdata,
0095                                                             prte_rmaps_options_t *options);
0096 
0097 /* do whatever preparation work
0098  * is required to setup the app for execution. This is intended to be
0099  * used by prun and other launcher tools to, for example, change
0100  * an executable's relative-path to an absolute-path, or add a command
0101  * required for starting a particular kind of application (e.g., adding
0102  * "java" to start a Java application) */
0103 typedef int (*prte_schizo_base_module_setup_app_fn_t)(prte_pmix_app_t *app);
0104 
0105 /* add any personality-specific envars required at the job level prior
0106  * to beginning to execute local procs */
0107 typedef int (*prte_schizo_base_module_setup_fork_fn_t)(prte_job_t *jdata,
0108                                                        prte_app_context_t *context);
0109 
0110 /* give the component a chance to cleanup */
0111 typedef void (*prte_schizo_base_module_finalize_fn_t)(void);
0112 
0113 /* give the components a chance to add job info */
0114 typedef void (*prte_schizo_base_module_job_info_fn_t)(pmix_cli_result_t *results,
0115                                                       void *jobinfo);
0116 
0117 /* give the component a chance to validate directives and their values */
0118 typedef int (*prte_schizo_base_module_check_sanity_fn_t)(pmix_cli_result_t *cmd_line);
0119 
0120 /*
0121  * schizo module version 1.3.0
0122  */
0123 typedef struct {
0124     char *name;
0125     prte_schizo_base_module_init_fn_t                   init;
0126     prte_schizo_base_module_parse_cli_fn_t              parse_cli;
0127     prte_schizo_base_module_parse_env_fn_t              parse_env;
0128     prte_schizo_base_detect_proxy_fn_t                  detect_proxy;
0129     prte_schizo_base_module_allow_run_as_root_fn_t      allow_run_as_root;
0130     prte_schizo_base_module_set_default_mapping_fn_t    set_default_mapping;
0131     prte_schizo_base_module_set_default_ranking_fn_t    set_default_ranking;
0132     prte_schizo_base_module_set_default_binding_fn_t    set_default_binding;
0133     prte_schizo_base_module_set_default_rto_fn_t        set_default_rto;
0134     prte_schizo_base_module_setup_app_fn_t              setup_app;
0135     prte_schizo_base_module_setup_fork_fn_t             setup_fork;
0136     prte_schizo_base_module_job_info_fn_t               job_info;
0137     prte_schizo_base_module_check_sanity_fn_t           check_sanity;
0138     prte_schizo_base_module_finalize_fn_t               finalize;
0139 } prte_schizo_base_module_t;
0140 
0141 /*
0142  * schizo component
0143  */
0144 
0145 /**
0146  * schizo component version 1.3.0
0147  */
0148 typedef pmix_mca_base_component_t prte_schizo_base_component_t;
0149 
0150 /**
0151  * Macro for use in components that are of type schizo
0152  */
0153 #define PRTE_MCA_SCHIZO_BASE_VERSION_1_0_0 PRTE_MCA_BASE_VERSION_3_0_0("schizo", 1, 0, 0)
0154 
0155 END_C_DECLS
0156 
0157 #endif