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) 2014-2020 Intel, Inc.  All rights reserved.
0004  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
0005  *                         reserved.
0006  * Copyright (c) 2020      Cisco Systems, Inc.  All rights reserved
0007  * Copyright (c) 2021-2022 Nanook Consulting.  All rights reserved.
0008  * $COPYRIGHT$
0009  *
0010  * Additional copyrights may follow
0011  *
0012  * $HEADER$
0013  */
0014 /** @file:
0015  *
0016  * The PRTE Run-Time Control Framework (RTC)
0017  *
0018  */
0019 
0020 #ifndef PRTE_MCA_RTC_H
0021 #define PRTE_MCA_RTC_H
0022 
0023 #include "prte_config.h"
0024 #include "types.h"
0025 
0026 #include "src/class/pmix_list.h"
0027 #include "src/mca/mca.h"
0028 #include "src/mca/odls/base/base.h"
0029 #include "src/pmix/pmix-internal.h"
0030 #include "src/runtime/prte_globals.h"
0031 
0032 BEGIN_C_DECLS
0033 
0034 typedef struct {
0035     pmix_list_item_t super;
0036     char *component;
0037     char *category;
0038     prte_value_t control;
0039 } prte_rtc_resource_t;
0040 PRTE_EXPORT PMIX_CLASS_DECLARATION(prte_rtc_resource_t);
0041 
0042 /* Assign run-time controls for a given job. This provides each component with
0043  * an opportunity to insert attributes into the prte_job_t and/or its
0044  * associated proc structures that will be passed to backend daemons for
0045  * controlling the job. For example, if the user specified a frequency
0046  * setting for the job, then the freq component will have an opportunity
0047  * to add an attribute to the job so the freq component on the remote daemons
0048  * can "catch" it and perform the desired action
0049  */
0050 typedef void (*prte_rtc_base_module_assign_fn_t)(prte_job_t *jdata);
0051 
0052 /* Set run-time controls for a given job and/or process. This can include
0053  * controls for power, binding, memory, and any other resource on the node.
0054  * Each active plugin will be given a chance to operate on the request, setting
0055  * whatever controls that lie within its purview.
0056  *
0057  * Each module is responsible for reporting errors via the state machine. Thus,
0058  * no error code is returned. However, warnings and error messages for the user
0059  * can be output via the provided error_fd */
0060 typedef void (*prte_rtc_base_module_set_fn_t)(prte_odls_spawn_caddy_t *cd,
0061                                               int error_fd);
0062 
0063 /* Return a list of valid controls values for this component.
0064  * Each module is responsible for adding its control values
0065  * to a list of prte_value_t objects.
0066  */
0067 typedef void (*prte_rtc_base_module_get_avail_vals_fn_t)(pmix_list_t *vals);
0068 
0069 /* provide a way for the module to init during selection */
0070 typedef int (*prte_rtc_base_module_init_fn_t)(void);
0071 
0072 /* provide a chance for the module to finalize */
0073 typedef void (*prte_rtc_base_module_fini_fn_t)(void);
0074 
0075 /*
0076  * rtc module version 1.0.0
0077  */
0078 typedef struct {
0079     prte_rtc_base_module_init_fn_t init;
0080     prte_rtc_base_module_fini_fn_t finalize;
0081     prte_rtc_base_module_assign_fn_t assign;
0082     prte_rtc_base_module_set_fn_t set;
0083     prte_rtc_base_module_get_avail_vals_fn_t get_available_values;
0084 } prte_rtc_base_module_t;
0085 
0086 /* provide a public API version */
0087 typedef struct {
0088     prte_rtc_base_module_assign_fn_t assign;
0089     prte_rtc_base_module_set_fn_t set;
0090     prte_rtc_base_module_get_avail_vals_fn_t get_available_values;
0091 } prte_rtc_API_module_t;
0092 
0093 /**
0094  * rtc component version 1.0.0
0095  */
0096 typedef pmix_mca_base_component_t prte_rtc_base_component_t;
0097 
0098 /* declare the struct containing the public API */
0099 PRTE_EXPORT extern prte_rtc_API_module_t prte_rtc;
0100 
0101 /*
0102  * Macro for use in components that are of type rtc
0103  */
0104 #define PRTE_RTC_BASE_VERSION_1_0_0 PRTE_MCA_BASE_VERSION_3_0_0("rtc", 1, 0, 0)
0105 
0106 END_C_DECLS
0107 
0108 #endif