File: mca_base_alias.h

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (84 lines) | stat: -rw-r--r-- 2,729 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2020      Google, LLC. All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

#ifndef OPAL_MCA_BASE_ALIAS_H
#define OPAL_MCA_BASE_ALIAS_H

#include "opal_config.h"
#include "opal/class/opal_list.h"

BEGIN_C_DECLS

enum mca_base_alias_flags_t {
    MCA_BASE_ALIAS_FLAG_NONE = 0,
    /** The aliased name has been deprecated. */
    MCA_BASE_ALIAS_FLAG_DEPRECATED = 1,
};

typedef enum mca_base_alias_flags_t mca_base_alias_flags_t;

struct mca_base_alias_item_t {
    opal_list_item_t super;
    /** Name aias. */
    char *component_alias;
    /** Alias flags. */
    uint32_t alias_flags;
};

typedef struct mca_base_alias_item_t mca_base_alias_item_t;

OBJ_CLASS_DECLARATION(mca_base_alias_item_t);

struct mca_base_alias_t {
    opal_object_t super;
    /** List of name aliases. */
    opal_list_t component_aliases;
};

typedef struct mca_base_alias_t mca_base_alias_t;

OBJ_CLASS_DECLARATION(mca_base_alias_t);

/**
 * @brief Create a alias for a component name.
 *
 * @param[in] project         Project name (may be NULL)
 * @param[in] framework       Framework name (may be NULL)
 * @param[in] component_name  Name of component to alias (may not be NULL)
 * @param[in] component_alias Aliased name (may not be NULL)
 * @param[in] alias_flags     Flags (see mca_base_alias_flags_t)
 *
 * This function aliases one component name to another. When aliased
 * any variable registered with this project, framework, and
 * component_name will have synonyms created. For example, if
 * opal_btl_vader is aliased to sm then registers a variable
 * named btl_vader_flags then a synonym will be created with the
 * name btl_sm_flags. If an alias is registered early enough
 * (during framework registration for example) then the alias can
 * also be used for component selection. In the previous example
 * --mca btl vader and --mca btl sm would select the same
 * component if the synonym is registered in the btl framework
 * registration function.
 */
OPAL_DECLSPEC int mca_base_alias_register(const char *project, const char *framework,
                                          const char *component_name, const char *component_alias,
                                          uint32_t alias_flags);

/**
 * @brief Check for aliases for a component.
 *
 * @param[in] project        Project name (may be NULL)
 * @param[in] frameworek     Framework name (may be NULL)
 * @param[in] component_name Component name (may not be NULL)
 */
OPAL_DECLSPEC const mca_base_alias_t *
mca_base_alias_lookup(const char *project, const char *framework, const char *component_name);

#endif /* OPAL_MCA_BASE_ALIAS_H */