OpenMPI  0.1.1
base.h
1 /*
2  * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2007 The University of Tennessee and The University
6  * of Tennessee Research Foundation. All rights
7  * reserved.
8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9  * University of Stuttgart. All rights reserved.
10  * Copyright (c) 2004-2005 The Regents of the University of California.
11  * All rights reserved.
12  * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
13  * $COPYRIGHT$
14  *
15  * Additional copyrights may follow
16  *
17  * $HEADER$
18  */
19 
20 #ifndef MCA_BASE_H
21 #define MCA_BASE_H
22 
23 #include "opal_config.h"
24 
25 #include "opal/class/opal_object.h"
26 #include "opal/class/opal_list.h"
27 
28 /*
29  * These units are large enough to warrant their own .h files
30  */
31 #include "opal/mca/mca.h"
33 #include "opal/util/cmd_line.h"
34 
35 BEGIN_C_DECLS
36 
37 /*
38  * Structure for making plain lists of components
39  */
41  opal_list_item_t super;
42  const mca_base_component_t *cli_component;
43 };
46 
47 /*
48  * Structure for making priority lists of components
49  */
52  int cpli_priority;
53 };
56 
58 
59 /*
60  * Public variables
61  */
62 OPAL_DECLSPEC extern int mca_base_param_component_path;
63 OPAL_DECLSPEC extern char *mca_base_system_default_path;
64 OPAL_DECLSPEC extern char *mca_base_user_default_path;
65 
66 /*
67  * Public functions
68  */
69 
70 /**
71  * First function called in the MCA.
72  *
73  * @return OPAL_SUCCESS Upon success
74  * @return OPAL_ERROR Upon failure
75  *
76  * This function starts up the entire MCA. It initializes a bunch
77  * of built-in MCA parameters, and initialized the MCA component
78  * repository.
79  *
80  * It must be the first MCA function invoked. It is normally
81  * invoked during ompi_mpi_init() and specifically invoked in the
82  * special case of the laminfo command.
83  */
84 OPAL_DECLSPEC int mca_base_open(void);
85 
86 /**
87  * Last function called in the MCA
88  *
89  * @return OPAL_SUCCESS Upon success
90  * @return OPAL_ERROR Upon failure
91  *
92  * This function closes down the entire MCA. It clears all MCA
93  * parameters and closes down the MCA component respository.
94  *
95  * It must be the last MCA function invoked. It is normally invoked
96  * during ompi_mpi_finalize() and specifically invoked during the
97  * special case of the laminfo command.
98  */
99 OPAL_DECLSPEC int mca_base_close(void);
100 
101 /**
102  * A generic select function
103  *
104  */
105 OPAL_DECLSPEC int mca_base_select(const char *type_name, int output_id,
106  opal_list_t *components_available,
107  mca_base_module_t **best_module,
108  mca_base_component_t **best_component);
109 
110 /**
111  * A function for component query functions to discover if they have
112  * been explicitly required to or requested to be selected.
113  *
114  * exclusive: If the specified component is the only component that is
115  * available for selection.
116  *
117  */
118 OPAL_DECLSPEC int mca_base_is_component_required(opal_list_t *components_available,
119  mca_base_component_t *component,
120  bool exclusive,
121  bool *is_required);
122 
123 /* mca_base_cmd_line.c */
124 
125 OPAL_DECLSPEC int mca_base_cmd_line_setup(opal_cmd_line_t *cmd);
126 OPAL_DECLSPEC int mca_base_cmd_line_process_args(opal_cmd_line_t *cmd,
127  char ***app_env,
128  char ***global_env);
129 
130 /* mca_base_component_compare.c */
131 
132 OPAL_DECLSPEC int mca_base_component_compare_priority(mca_base_component_priority_list_item_t *a,
134 OPAL_DECLSPEC int mca_base_component_compare(const mca_base_component_t *a,
135  const mca_base_component_t *b);
136 OPAL_DECLSPEC int mca_base_component_compatible(const mca_base_component_t *a,
137  const mca_base_component_t *b);
138 OPAL_DECLSPEC char * mca_base_component_to_string(const mca_base_component_t *a);
139 
140 /* mca_base_component_find.c */
141 
142 OPAL_DECLSPEC int mca_base_component_find(const char *directory, const char *type,
143  const mca_base_component_t *static_components[],
144  char **requested_component_names,
145  bool include_mode,
146  opal_list_t *found_components,
147  bool open_dso_components);
148 
149 /* Safely release some memory allocated by mca_base_component_find()
150  (i.e., is safe to call even if you never called
151  mca_base_component_find()). */
152 OPAL_DECLSPEC int mca_base_component_find_finalize(void);
153 
154 /* mca_base_components_open.c */
155 
156 OPAL_DECLSPEC int mca_base_components_open(const char *type_name, int output_id,
157  const mca_base_component_t **static_components,
158  opal_list_t *components_available,
159  bool open_dso_components);
160 
161 /* mca_base_components_close.c */
162 
163 OPAL_DECLSPEC int mca_base_components_close(int output_id, opal_list_t *components_available,
164  const mca_base_component_t *skip);
165 
166 END_C_DECLS
167 
168 #endif /* MCA_BASE_H */
Common type for all MCA components.
Definition: mca.h:250
This file presents the MCA parameter interface.
Common type for all MCA modules.
Definition: mca.h:100
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
Top-level interface for all MCA components.
Definition: opal_list.h:98
Definition: cmd_line.h:126
General command line parsing facility for use throughout Open MPI.
Definition: base.h:40
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(mca_oob_base_info_t)
declare the association structure as a class
Definition: opal_list.h:147
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...