Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
0002 /*
0003  * Copyright (c) 2020      Google, LLC. All rights reserved.
0004  * Copyright (c) 2021-2022 Nanook Consulting.  All rights reserved.
0005  * $COPYRIGHT$
0006  *
0007  * Additional copyrights may follow
0008  *
0009  * $HEADER$
0010  */
0011 
0012 #ifndef PMIX_MCA_BASE_ALIAS_H
0013 #define PMIX_MCA_BASE_ALIAS_H
0014 
0015 #include "src/include/pmix_config.h"
0016 #include "src/class/pmix_list.h"
0017 
0018 BEGIN_C_DECLS
0019 
0020 enum pmix_mca_base_alias_flags_t {
0021     PMIX_MCA_BASE_ALIAS_FLAG_NONE = 0,
0022     /** The aliased name has been deprecated. */
0023     PMIX_MCA_BASE_ALIAS_FLAG_DEPRECATED = 1,
0024 };
0025 
0026 typedef enum pmix_mca_base_alias_flags_t pmix_mca_base_alias_flags_t;
0027 
0028 struct pmix_mca_base_alias_item_t {
0029     pmix_list_item_t super;
0030     /** Name aias. */
0031     char *component_alias;
0032     /** Alias flags. */
0033     uint32_t alias_flags;
0034 };
0035 
0036 typedef struct pmix_mca_base_alias_item_t pmix_mca_base_alias_item_t;
0037 
0038 PMIX_CLASS_DECLARATION(pmix_mca_base_alias_item_t);
0039 
0040 struct pmix_mca_base_alias_t {
0041     pmix_object_t super;
0042     /** List of name aliases. */
0043     pmix_list_t component_aliases;
0044 };
0045 
0046 typedef struct pmix_mca_base_alias_t pmix_mca_base_alias_t;
0047 
0048 PMIX_CLASS_DECLARATION(pmix_mca_base_alias_t);
0049 
0050 /**
0051  * @brief Create a alias for a component name.
0052  *
0053  * @param[in] project         Project name (may be NULL)
0054  * @param[in] framework       Framework name (may be NULL)
0055  * @param[in] component_name  Name of component to alias (may not be NULL)
0056  * @param[in] component_alias Aliased name (may not be NULL)
0057  * @param[in] alias_flags     Flags (see mca_base_alias_flags_t)
0058  *
0059  * This function aliases one component name to another. When aliased
0060  * any variable registered with this project, framework, and
0061  * component_name will have synonyms created. For example, if
0062  * pmix_btl_vader is aliased to sm then registers a variable
0063  * named btl_vader_flags then a synonym will be created with the
0064  * name btl_sm_flags. If an alias is registered early enough
0065  * (during framework registration for example) then the alias can
0066  * also be used for component selection. In the previous example
0067  * --mca btl vader and --mca btl sm would select the same
0068  * component if the synonym is registered in the btl framework
0069  * registration function.
0070  */
0071 PMIX_EXPORT int pmix_mca_base_alias_register(const char *project, const char *framework,
0072                                              const char *component_name,
0073                                              const char *component_alias, uint32_t alias_flags);
0074 
0075 /**
0076  * @brief Check for aliases for a component.
0077  *
0078  * @param[in] project        Project name (may be NULL)
0079  * @param[in] frameworek     Framework name (may be NULL)
0080  * @param[in] component_name Component name (may not be NULL)
0081  */
0082 PMIX_EXPORT const pmix_mca_base_alias_t *
0083 pmix_mca_base_alias_lookup(const char *project, const char *framework, const char *component_name);
0084 
0085 PMIX_EXPORT void pmix_mca_base_alias_cleanup(void);
0086 
0087 #endif /* PMIX_MCA_BASE_ALIAS_H */