|
|
|||
File indexing completed on 2026-10-04 09:17:33
0001 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ 0002 /* 0003 * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana 0004 * University Research and Technology 0005 * Corporation. All rights reserved. 0006 * Copyright (c) 2004-2006 The University of Tennessee and The University 0007 * of Tennessee Research Foundation. All rights 0008 * reserved. 0009 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 0010 * University of Stuttgart. All rights reserved. 0011 * Copyright (c) 2004-2005 The Regents of the University of California. 0012 * All rights reserved. 0013 * Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved. 0014 * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights 0015 * reserved. 0016 * Copyright (c) 2016-2020 Intel, Inc. All rights reserved. 0017 * Copyright (c) 2021-2026 Nanook Consulting All rights reserved. 0018 * $COPYRIGHT$ 0019 * 0020 * Additional copyrights may follow 0021 * 0022 * $HEADER$ 0023 */ 0024 0025 /** @file 0026 * This file presents the MCA variable interface. 0027 * 0028 * Note that there are two scopes for MCA variables: "normal" and 0029 * attributes. Specifically, all MCA variables are "normal" -- some 0030 * are special and may also be found on attributes on communicators, 0031 * datatypes, or windows. 0032 * 0033 * In general, these functions are intended to be used as follows: 0034 * 0035 * - Creating MCA variables 0036 * -# Register a variable, get an index back 0037 * - Using MCA variables 0038 * -# Lookup a "normal" variable value on a specific index, or 0039 * -# Lookup an attribute variable on a specific index and 0040 * communicator / datatype / window. 0041 * 0042 * MCA variables can be defined in multiple different places. As 0043 * such, variables are \em resolved to find their value. The order 0044 * of resolution is as follows: 0045 * 0046 * - An "override" location that is only available to be set via the 0047 * pmix_mca_base_param API. 0048 * - Look for an environment variable corresponding to the MCA 0049 * variable. 0050 * - See if a file contains the MCA variable (MCA variable files are 0051 * read only once -- when the first time any mca_param_t function is 0052 * invoked). 0053 * - If nothing else was found, use the variable's default value. 0054 * 0055 * Note that there is a second header file (pmix_mca_base_vari.h) 0056 * that contains several internal type declarations for the variable 0057 * system. The internal file is only used within the variable system 0058 * itself; it should not be required by any other PMIX entities. 0059 */ 0060 0061 #ifndef PMIX_MCA_BASE_VAR_H 0062 #define PMIX_MCA_BASE_VAR_H 0063 0064 #include "src/include/pmix_config.h" 0065 0066 #include "src/class/pmix_list.h" 0067 #include "src/class/pmix_value_array.h" 0068 #include "src/mca/base/pmix_mca_base_framework.h" 0069 #include "src/mca/base/pmix_mca_base_var_enum.h" 0070 #include "src/mca/base/pmix_mca_base_var_group.h" 0071 #include "src/mca/mca.h" 0072 0073 /** 0074 * The types of MCA variables. 0075 */ 0076 typedef enum { 0077 /** The variable is of type int. */ 0078 PMIX_MCA_BASE_VAR_TYPE_INT, 0079 /** The variable is of type unsigned int */ 0080 PMIX_MCA_BASE_VAR_TYPE_UNSIGNED_INT, 0081 /** The variable is of type unsigned long */ 0082 PMIX_MCA_BASE_VAR_TYPE_UNSIGNED_LONG, 0083 /** The variable is of type unsigned long long */ 0084 PMIX_MCA_BASE_VAR_TYPE_UNSIGNED_LONG_LONG, 0085 /** The variable is of type size_t */ 0086 PMIX_MCA_BASE_VAR_TYPE_SIZE_T, 0087 /** The variable is of type string. */ 0088 PMIX_MCA_BASE_VAR_TYPE_STRING, 0089 /** The variable is of type string and contains version. */ 0090 PMIX_MCA_BASE_VAR_TYPE_VERSION_STRING, 0091 /** The variable is of type bool */ 0092 PMIX_MCA_BASE_VAR_TYPE_BOOL, 0093 /** The variable is of type double */ 0094 PMIX_MCA_BASE_VAR_TYPE_DOUBLE, 0095 /** Maximum variable type. */ 0096 PMIX_MCA_BASE_VAR_TYPE_MAX 0097 } pmix_mca_base_var_type_t; 0098 0099 PMIX_EXPORT extern const char *pmix_var_type_names[]; 0100 0101 /** 0102 * Source of an MCA variable's value 0103 */ 0104 typedef enum { 0105 /** The default value */ 0106 PMIX_MCA_BASE_VAR_SOURCE_DEFAULT, 0107 /** The value came from the command line */ 0108 PMIX_MCA_BASE_VAR_SOURCE_COMMAND_LINE, 0109 /** The value came from the environment */ 0110 PMIX_MCA_BASE_VAR_SOURCE_ENV, 0111 /** The value came from a file */ 0112 PMIX_MCA_BASE_VAR_SOURCE_FILE, 0113 /** The value came a "set" API call */ 0114 PMIX_MCA_BASE_VAR_SOURCE_SET, 0115 /** The value came from the override file */ 0116 PMIX_MCA_BASE_VAR_SOURCE_OVERRIDE, 0117 0118 /** Maximum source type */ 0119 PMIX_MCA_BASE_VAR_SOURCE_MAX 0120 } pmix_mca_base_var_source_t; 0121 0122 typedef enum { 0123 PMIX_MCA_BASE_VAR_SYN_FLAG_DEPRECATED = 0x0001 0124 } pmix_mca_base_var_syn_flag_t; 0125 0126 typedef enum { 0127 /** Variable is internal (hidden from *_info) */ 0128 PMIX_MCA_BASE_VAR_FLAG_INTERNAL = 0x0001, 0129 /** Variable will always be the default value. Implies 0130 !PMIX_MCA_BASE_VAR_FLAG_SETTABLE */ 0131 PMIX_MCA_BASE_VAR_FLAG_DEFAULT_ONLY = 0x0002, 0132 /** Variable can be set with mca_base_var_set() */ 0133 PMIX_MCA_BASE_VAR_FLAG_SETTABLE = 0x0004, 0134 /** Variable is deprecated */ 0135 PMIX_MCA_BASE_VAR_FLAG_DEPRECATED = 0x0008, 0136 /** Variable has been overridden */ 0137 PMIX_MCA_BASE_VAR_FLAG_OVERRIDE = 0x0010, 0138 /** Variable may not be set from a file */ 0139 PMIX_MCA_BASE_VAR_FLAG_ENVIRONMENT_ONLY = 0x0020, 0140 /** Variable should be deregistered when the group is deregistered 0141 (DWG = "deregister with group"). This flag is set 0142 automatically when you register a variable with 0143 mca_base_component_var_register(), but can also be set 0144 manually when you register a variable with 0145 mca_base_var_register(). Analogous to the 0146 MCA_BASE_PVAR_FLAG_IWG. */ 0147 PMIX_MCA_BASE_VAR_FLAG_DWG = 0x0040, 0148 /** Variable has a default value of "unset". Meaning to only 0149 * be set when the user explicitly asks for it */ 0150 PMIX_MCA_BASE_VAR_FLAG_DEF_UNSET = 0x0080, 0151 } pmix_mca_base_var_flag_t; 0152 0153 typedef enum { 0154 PMIX_MCA_BASE_VAR_FLAG_NONE = 0x0000, 0155 /** Variable is valid */ 0156 PMIX_MCA_BASE_VAR_FLAG_VALID = 0x00010000, 0157 /** Variable is a synonym */ 0158 PMIX_MCA_BASE_VAR_FLAG_SYNONYM = 0x00020000, 0159 /** mbv_source_file needs to be freed */ 0160 PMIX_MCA_BASE_VAR_FLAG_SOURCE_FILE_NEEDS_FREE = 0x00040000 0161 } pmix_mca_base_var_flag_internal_t; 0162 0163 /** 0164 * Types for MCA parameters. 0165 */ 0166 typedef union { 0167 /** integer value */ 0168 int intval; 0169 /** unsigned int value */ 0170 unsigned int uintval; 0171 /** string value */ 0172 char *stringval; 0173 /** boolean value */ 0174 bool boolval; 0175 /** unsigned long value */ 0176 unsigned long ulval; 0177 /** unsigned long long value */ 0178 unsigned long long ullval; 0179 /** size_t value */ 0180 size_t sizetval; 0181 /** double value */ 0182 double lfval; 0183 } pmix_mca_base_var_storage_t; 0184 0185 /** 0186 * Entry for holding information about an MCA variable. 0187 */ 0188 struct pmix_mca_base_var_t { 0189 /** Allow this to be an PMIX OBJ */ 0190 pmix_object_t super; 0191 0192 /** Variable index. This will remain constant until pmix_mca_base_var_finalize() 0193 is called. */ 0194 int mbv_index; 0195 /** Group index. This will remain constant until pmix_mca_base_var_finalize() 0196 is called. This variable will be deregistered if the associated group 0197 is deregistered with pmix_mca_base_var_group_deregister() */ 0198 int mbv_group_index; 0199 0200 /** Enum indicating the type of the variable (integer, string, boolean) */ 0201 pmix_mca_base_var_type_t mbv_type; 0202 0203 /** String of the variable name */ 0204 char *mbv_variable_name; 0205 /** Full variable name, in case it is not <framework>_<component>_<param> */ 0206 char *mbv_full_name; 0207 /** Long variable name <project>_<framework>_<component>_<name> */ 0208 char *mbv_long_name; 0209 char *mbv_prefix; 0210 0211 /** List of synonym names for this variable. This *must* be a 0212 pointer (vs. a plain pmix_list_t) because we copy this whole 0213 struct into a new var for permanent storage 0214 (pmix_vale_array_append_item()), and the internal pointers in 0215 the pmix_list_t will be invalid when that happens. Hence, we 0216 simply keep a pointer to an external pmix_list_t. Synonyms 0217 are uncommon enough that this is not a big performance hit. */ 0218 pmix_value_array_t mbv_synonyms; 0219 0220 /** Variable flags */ 0221 pmix_mca_base_var_flag_internal_t mbv_flags; 0222 0223 /** Source of the current value */ 0224 pmix_mca_base_var_source_t mbv_source; 0225 0226 /** Synonym for */ 0227 int mbv_synonym_for; 0228 0229 /** Variable description */ 0230 char *mbv_description; 0231 0232 /** File the value came from */ 0233 char *mbv_source_file; 0234 0235 /** Value enumerator (only valid for integer variables) */ 0236 pmix_mca_base_var_enum_t *mbv_enumerator; 0237 0238 /** Bind value for this variable (0 - none) */ 0239 int mbv_bind; 0240 0241 /** Storage for this variable */ 0242 pmix_mca_base_var_storage_t *mbv_storage; 0243 0244 /** File value structure */ 0245 void *mbv_file_value; 0246 }; 0247 /** 0248 * Convenience typedef. 0249 */ 0250 typedef struct pmix_mca_base_var_t pmix_mca_base_var_t; 0251 0252 /* 0253 * Global functions for MCA 0254 */ 0255 0256 BEGIN_C_DECLS 0257 0258 /** 0259 * Object declarayion for pmix_mca_base_var_t 0260 */ 0261 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_mca_base_var_t); 0262 0263 /** 0264 * Initialize the MCA variable system. 0265 * 0266 * @retval PMIX_SUCCESS 0267 * 0268 * This function initializes the MCA variable system. It is 0269 * invoked internally (by pmix_mca_base_open()) and is only documented 0270 * here for completeness. 0271 */ 0272 PMIX_EXPORT int pmix_mca_base_var_init(void); 0273 0274 /** 0275 * Register an MCA variable 0276 * 0277 * @param[in] project_name The name of the project associated with 0278 * this variable 0279 * @param[in] framework_name The name of the framework associated with 0280 * this variable 0281 * @param[in] component_name The name of the component associated with 0282 * this variable 0283 * @param[in] variable_name The name of this variable 0284 * @param[in] description A string describing the use and valid 0285 * values of the variable (string). 0286 * @param[in] type The type of this variable (string, int, bool). 0287 * @param[in] enumerator Enumerator describing valid values. 0288 * @param[in] bind Hint for MPIT to specify type of binding (0 = none) 0289 * @param[in] flags Flags for this variable. 0290 * @param[in] info_lvl Info level of this variable 0291 * @param[in] scope Indicates the scope of this variable 0292 * @param[in,out] storage Pointer to the value's location. 0293 * 0294 * @retval index Index value representing this variable. 0295 * @retval PMIX_ERR_OUT_OF_RESOURCE Upon failure to allocate memory. 0296 * @retval PMIX_ERROR Upon failure to register the variable. 0297 * 0298 * This function registers an MCA variable and associates it 0299 * with a specific group. 0300 * 0301 * {description} is a string of arbitrary length (verbose is good!) 0302 * for explaining what the variable is for and what its valid values 0303 * are. This message is used in help messages, such as the output 0304 * from the ompi_info executable. The {description} string is copied 0305 * internally; the caller can free {description} upon successful 0306 * return. 0307 * 0308 * {enumerator} is either NULL or a handle that was created via 0309 * pmix_mca_base_var_enum_create(), and describes the valid values of an 0310 * integer variable (i.e., one with type MCA_BASE_VAR_TYPE_INT). When 0311 * a non-NULL {enumerator} is used, the value set for this variable by 0312 * the user will be compared against the values in the enumerator. 0313 * The MCA variable system will allow the parameter to be set to 0314 * either one of the enumerator values (0, 1, 2, etc) or a string 0315 * representing one of those values. {enumerator} is retained until 0316 * either the variable is deregistered using 0317 * pmix_mca_base_var_deregister(), pmix_mca_base_var_group_deregister(), or 0318 * pmix_mca_base_var_finalize(). {enumerator} should be NULL for 0319 * parameters that do not support enumerated values. 0320 * 0321 * {flags} indicate attributes of this variable (internal, settable, 0322 * default only, etc.), as listed below. 0323 * 0324 * If MCA_BASE_VAR_FLAG_INTERNAL is set in {flags}, this variable 0325 * is not shown by default in the output of ompi_info. That is, 0326 * this variable is considered internal to the PMIX implementation 0327 * and is not supposed to be viewed / changed by the user. 0328 * 0329 * If MCA_BASE_VAR_FLAG_DEFAULT_ONLY is set in {flags}, then the value 0330 * provided in storage will not be modified by the MCA variable system 0331 * (i.e., users cannot set the value of this variable via CLI 0332 * parameter, environment variable, file, etc.). It is up to the 0333 * caller to specify (using the scope) if this value may change 0334 * (MCA_BASE_VAR_SCOPE_READONLY) or remain constant 0335 * (MCA_BASE_VAR_SCOPE_CONSTANT). MCA_BASE_VAR_FLAG_DEFAULT_ONLY must 0336 * not be specified with MCA_BASE_VAR_FLAG_SETTABLE. 0337 * 0338 * Set MCA_BASE_VAR_FLAG_DEPRECATED in {flags} to indicate that 0339 * this variable name is deprecated. The user will get a warning 0340 * if they set this variable. 0341 * 0342 * {scope} is for informational purposes to indicate how this variable 0343 * can be set, or if it is considered constant or readonly (which, by 0344 * MPI_T's definitions, are different things). See the comments in 0345 * the description of pmix_mca_base_var_scope_t for information about the 0346 * different scope meanings. 0347 * 0348 * {storage} points to a (char *), (int), or (bool) where the value of 0349 * this variable is stored ({type} indicates the type of this 0350 * pointer). The location pointed to by {storage} must exist until 0351 * the variable is deregistered. Note that the initial value in 0352 * {storage} may be overwritten if the MCA_BASE_VAR_FLAG_DEFAULT_ONLY 0353 * flag is not set (e.g., if the user sets this variable via CLI 0354 * option, environment variable, or file value). If input value of 0355 * {storage} points to a (char *), the pointed-to string will be 0356 * duplicated and maintained internally by the MCA variable system; 0357 * the caller may free the original string after this function returns 0358 * successfully. 0359 */ 0360 PMIX_EXPORT int pmix_mca_base_var_register(const char *project_name, const char *framework_name, 0361 const char *component_name, const char *variable_name, 0362 const char *description, pmix_mca_base_var_type_t type, 0363 void *storage); 0364 0365 /** 0366 * Convenience function for registering a variable associated with a 0367 * component. 0368 * 0369 * While quite similar to pmix_mca_base_var_register(), there is one key 0370 * difference: vars registered this this function will automatically 0371 * be unregistered / made unavailable when that component is closed by 0372 * its framework. 0373 */ 0374 PMIX_EXPORT int pmix_mca_base_component_var_register( 0375 const pmix_mca_base_component_t *component, const char *variable_name, const char *description, 0376 pmix_mca_base_var_type_t type, void *storage); 0377 0378 /** 0379 * Convenience function for registering a variable associated with a framework. This 0380 * function is equivalent to pmix_mca_base_var_register with component_name = "base" and 0381 * with the MCA_BASE_VAR_FLAG_DWG set. See pmix_mca_base_var_register(). 0382 */ 0383 PMIX_EXPORT int pmix_mca_base_framework_var_register( 0384 const pmix_mca_base_framework_t *framework, const char *variable_name, const char *help_msg, 0385 pmix_mca_base_var_type_t type, void *storage); 0386 0387 /** 0388 * Register a synonym name for an MCA variable. 0389 * 0390 * @param[in] synonym_for The index of the original variable. This index 0391 * must not refer to a synonym. 0392 * @param[in] project_name The project this synonym belongs to. Should 0393 * not be NULL (except for legacy reasons). 0394 * @param[in] framework_name The framework this synonym belongs to. 0395 * @param[in] component_name The component this synonym belongs to. 0396 * @param[in] synonym_name The synonym name. 0397 * @param[in] flags Flags for this synonym. 0398 * 0399 * @returns index Variable index for new synonym on success. 0400 * @returns PMIX_ERR_BAD_VAR If synonym_for does not reference a valid 0401 * variable. 0402 * @returns PMIX_ERR_OUT_OF_RESOURCE If memory could not be allocated. 0403 * @returns PMIX_ERROR For all other errors. 0404 * 0405 * Upon success, this function creates a synonym MCA variable 0406 * that will be treated almost exactly like the original. The 0407 * type (int or string) is irrelevant; this function simply 0408 * creates a new name that by which the same variable value is 0409 * accessible. 0410 * 0411 * Note that the original variable name has precedence over all 0412 * synonyms. For example, consider the case if variable is 0413 * originally registered under the name "A" and is later 0414 * registered with synonyms "B" and "C". If the user sets values 0415 * for both MCA variable names "A" and "B", the value associated 0416 * with the "A" name will be used and the value associated with 0417 * the "B" will be ignored (and will not even be visible by the 0418 * pmix_mca_base_var_*() API). If the user sets values for both MCA 0419 * variable names "B" and "C" (and does *not* set a value for 0420 * "A"), it is undefined as to which value will be used. 0421 */ 0422 PMIX_EXPORT int pmix_mca_base_var_register_synonym(int synonym_for, const char *project_name, 0423 const char *framework_name, 0424 const char *component_name, 0425 const char *synonym_name, 0426 pmix_mca_base_var_syn_flag_t flags); 0427 0428 /** 0429 * Deregister a MCA variable or synonym 0430 * 0431 * @param vari Index returned from pmix_mca_base_var_register() or 0432 * pmix_mca_base_var_register_synonym(). 0433 * 0434 * Deregistering a variable does not free the variable or any memory associated 0435 * with it. All memory will be freed and the variable index released when 0436 * pmix_mca_base_var_finalize() is called. 0437 * 0438 * If an enumerator is associated with this variable it will be dereferenced. 0439 */ 0440 PMIX_EXPORT int pmix_mca_base_var_deregister(int vari); 0441 0442 /** 0443 * Get the current value of an MCA variable. 0444 * 0445 * @param[in] vari Index of variable 0446 * @param[in,out] value Pointer to copy the value to. Can be NULL. 0447 * @param[in,out] value_size Size of memory pointed to by value. 0448 * copied size will be returned in value_size. 0449 * @param[out] source Source of current value. Can be NULL. 0450 * @param[out] source_file Source file for the current value if 0451 * it was set from a file. 0452 * 0453 * @return PMIX_ERROR Upon failure. The contents of value are 0454 * undefined. 0455 * @return PMIX_SUCCESS Upon success. value (if not NULL) will be filled 0456 * with the variable's current value. value_size will contain the size 0457 * copied. source (if not NULL) will contain the source of the variable. 0458 * 0459 * Note: The value can be changed by the registering code without using 0460 * the pmix_mca_base_var_* interface so the source may be incorrect. 0461 */ 0462 PMIX_EXPORT int pmix_mca_base_var_get_value(int vari, void *value, 0463 pmix_mca_base_var_source_t *source, 0464 const char **source_file); 0465 0466 /** 0467 * Find the index for an MCA variable based on its names. 0468 * 0469 * @param project_name Name of the project 0470 * @param type_name Name of the type containing the variable. 0471 * @param component_name Name of the component containing the variable. 0472 * @param param_name Name of the variable. 0473 * 0474 * @retval PMIX_ERROR If the variable was not found. 0475 * @retval vari If the variable was found. 0476 * 0477 * It is not always convenient to widely propagate a variable's index 0478 * value, or it may be necessary to look up the variable from a 0479 * different component. This function can be used to look up the index 0480 * of any registered variable. The returned index can be used with 0481 * pmix_mca_base_var_get() and pmix_mca_base_var_get_value(). 0482 */ 0483 PMIX_EXPORT int pmix_mca_base_var_find(const char *project_name, const char *type_name, 0484 const char *component_name, const char *param_name); 0485 0486 /** 0487 * Find the index for a variable based on its full name 0488 * 0489 * @param full_name [in] Full name of the variable 0490 * @param vari [out] Index of the variable 0491 * 0492 * See pmix_mca_base_var_find(). 0493 */ 0494 PMIX_EXPORT int pmix_mca_base_var_find_by_name(const char *full_name, int *vari); 0495 0496 /** 0497 * Check that two MCA variables were not both set to non-default 0498 * values. 0499 * 0500 * @param type_a [in] Framework name of variable A (string). 0501 * @param component_a [in] Component name of variable A (string). 0502 * @param param_a [in] Variable name of variable A (string. 0503 * @param type_b [in] Framework name of variable A (string). 0504 * @param component_b [in] Component name of variable A (string). 0505 * @param param_b [in] Variable name of variable A (string. 0506 * 0507 * This function is useful for checking that the user did not set both 0508 * of 2 mutually-exclusive MCA variables. 0509 * 0510 * This function will print an pmix_show_help() message and return 0511 * PMIX_ERR_BAD_VAR if it finds that the two variables both have 0512 * value sources that are not MCA_BASE_VAR_SOURCE_DEFAULT. This 0513 * means that both variables have been set by the user (i.e., they're 0514 * not default values). 0515 * 0516 * Note that pmix_show_help() allows itself to be hooked, so if this 0517 * happens after the aggregated pmix_show_help() system is 0518 * initialized, the messages will be aggregated (w00t). 0519 * 0520 * @returns PMIX_ERR_BAD_VAR if the two variables have sources that 0521 * are not MCA_BASE_VAR_SOURCE_DEFAULT. 0522 * @returns PMIX_SUCCESS otherwise. 0523 */ 0524 PMIX_EXPORT int pmix_mca_base_var_check_exclusive(const char *project, const char *type_a, 0525 const char *component_a, const char *param_a, 0526 const char *type_b, const char *component_b, 0527 const char *param_b); 0528 0529 /** 0530 * Obtain basic info on a single variable (name, help message, etc) 0531 * 0532 * @param[in] vari Valid variable index. 0533 * @param[out] var Storage for the variable pointer. 0534 * 0535 * @retval PMIX_SUCCESS Upon success. 0536 * @retval pmix error code Upon failure. 0537 * 0538 * The returned pointer belongs to the MCA variable system. Do not 0539 * modify/free/retain the pointer. 0540 */ 0541 PMIX_EXPORT int pmix_mca_base_var_get(int vari, const pmix_mca_base_var_t **var); 0542 0543 /** 0544 * Obtain the number of variables that have been registered. 0545 * 0546 * @retval count on success 0547 * @return pmix error code on error 0548 * 0549 * Note: This function does not return the number of valid MCA variables as 0550 * pmix_mca_base_var_deregister() has no impact on the variable count. The count 0551 * returned is equal to the number of calls to pmix_mca_base_var_register with 0552 * unique names. ie. two calls with the same name will not affect the count. 0553 */ 0554 PMIX_EXPORT int pmix_mca_base_var_get_count(void); 0555 0556 /** 0557 * Obtain a list of environment variables describing the all 0558 * valid (non-default) MCA variables and their sources. 0559 * 0560 * @param[out] env A pointer to an argv-style array of key=value 0561 * strings, suitable for use in an environment 0562 * @param[out] num_env A pointer to an int, containing the length 0563 * of the env array (not including the final NULL entry). 0564 * 0565 * @retval PMIX_SUCCESS Upon success. 0566 * @retval PMIX_ERROR Upon failure. 0567 * 0568 * This function is similar to pmix_mca_base_var_dump() except that 0569 * its output is in terms of an argv-style array of key=value 0570 * strings, suitable for using in an environment. 0571 */ 0572 PMIX_EXPORT int pmix_mca_base_var_build_env(char ***env, int *num_env); 0573 0574 /** 0575 * Shut down the MCA variable system (normally only invoked by the 0576 * MCA framework itself). 0577 * 0578 * @returns PMIX_SUCCESS This function never fails. 0579 * 0580 * This function shuts down the MCA variable repository and frees all 0581 * associated memory. No other pmix_mca_base_var*() functions can be 0582 * invoked after this function. 0583 * 0584 * This function is normally only invoked by the MCA framework itself 0585 * when the process is shutting down (e.g., during MPI_FINALIZE). It 0586 * is only documented here for completeness. 0587 */ 0588 PMIX_EXPORT int pmix_mca_base_var_finalize(void); 0589 0590 typedef enum { 0591 /* Dump human-readable strings */ 0592 PMIX_MCA_BASE_VAR_DUMP_READABLE = 0, 0593 /* Dump easily parsable strings */ 0594 PMIX_MCA_BASE_VAR_DUMP_PARSABLE = 1, 0595 /* Dump simple name=value string */ 0596 PMIX_MCA_BASE_VAR_DUMP_SIMPLE = 2, 0597 /* Dump in color */ 0598 PMIX_MCA_BASE_VAR_DUMP_READABLE_COLOR = 3 0599 } pmix_mca_base_var_dump_type_t; 0600 0601 /* Supported color configuration keys 0602 * for dumping MCA variables with colors */ 0603 typedef enum { 0604 PMIX_VAR_DUMP_COLOR_VAR_NAME = 0, 0605 PMIX_VAR_DUMP_COLOR_VAR_VALUE = 1, 0606 PMIX_VAR_DUMP_COLOR_VALID_VALUES = 2, 0607 PMIX_VAR_DUMP_COLOR_KEY_COUNT 0608 } pmix_var_dump_color_key_t; 0609 0610 extern char *pmix_var_dump_color[PMIX_VAR_DUMP_COLOR_KEY_COUNT]; 0611 0612 0613 /** 0614 * Dump strings describing the MCA variable at an index. 0615 * 0616 * @param[in] vari Variable index 0617 * @param[out] out Array of strings describing this variable 0618 * @param[in] output_type Type of output desired 0619 * 0620 * This function returns an array of strings describing the variable. All strings 0621 * and the array must be freed by the caller. 0622 */ 0623 PMIX_EXPORT int pmix_mca_base_var_dump(int vari, char ***out, 0624 pmix_mca_base_var_dump_type_t output_type); 0625 0626 #define MCA_COMPILETIME_VER "print_compiletime_version" 0627 #define MCA_RUNTIME_VER "print_runtime_version" 0628 0629 PMIX_EXPORT int pmix_mca_base_var_cache_files(bool rel_path_search); 0630 0631 END_C_DECLS 0632 0633 #endif /* PMIX_MCA_BASE_VAR_H */
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|