OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

filem.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2005 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$
13 *
14 * Additional copyrights may follow
15 *
16 * $HEADER$
17 */
18 /**
19 * @file
20 *
21 * Remote File Management (FileM) Interface
22 *
23 */
24
25 #ifndef MCA_FILEM_H
26 #define MCA_FILEM_H
27
28 #include "orte_config.h"
29 #include "orte/constants.h"
30 #include "orte/types.h"
31
32 #include "opal/mca/mca.h"
33 #include "opal/mca/base/base.h"
34
35 #include "opal/class/opal_object.h"
36
37 BEGIN_C_DECLS
38
39 /**
40 * A set of flags that determine the type of the file
41 * in question
42 */
43 #define ORTE_FILEM_TYPE_FILE 0
44 #define ORTE_FILEM_TYPE_DIR 1
45 #define ORTE_FILEM_TYPE_UNKNOWN 2
46
47 /**
48 * Type of moment
49 */
50 #define ORTE_FILEM_MOVE_TYPE_PUT 0
51 #define ORTE_FILEM_MOVE_TYPE_GET 1
52 #define ORTE_FILEM_MOVE_TYPE_RM 2
53 #define ORTE_FILEM_MOVE_TYPE_UNKNOWN 3
54
55 /**
56 * Hints that describe the local or remote file target for
57 * optimization purposes.
58 */
59 #define ORTE_FILEM_HINT_NONE 0
60 #define ORTE_FILEM_HINT_SHARED 1
61
62 /**
63 * Define a Process Set
64 *
65 * Source: A single source of the operation.
66 * Sink: Desitination of the operation.
67 */
68 struct orte_filem_base_process_set_1_0_0_t {
69 /** This is an object, so must have a super */
70 opal_list_item_t super;
71
72 /** Source Process */
73 orte_process_name_t source;
74
75 /** Sink Process */
76 orte_process_name_t sink;
77 };
78 typedef struct orte_filem_base_process_set_1_0_0_t orte_filem_base_process_set_1_0_0_t;
79 typedef struct orte_filem_base_process_set_1_0_0_t orte_filem_base_process_set_t;
80
81 ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_filem_base_process_set_t);
82
83 /**
84 * Define a File Pair
85 *
86 * Local: Local file reference
87 * Remove: Remote file reference
88 *
89 * Note: If multiple process sinks are used it is assumed that the
90 * file reference is the same for each of the sinks. If this is not
91 * true then more than one filem request needs to be created.
92 */
93 struct orte_filem_base_file_set_1_0_0_t {
94 /** This is an object, so must have a super */
95 opal_list_item_t super;
96
97 /* Local file reference */
98 char * local_target;
99
100 /* Local file reference hints */
101 int local_hint;
102
103 /* Remove file reference */
104 char * remote_target;
105
106 /* Remote file reference hints */
107 int remote_hint;
108
109 /* Type of file to move */
110 int target_flag;
111 };
112 typedef struct orte_filem_base_file_set_1_0_0_t orte_filem_base_file_set_1_0_0_t;
113 typedef struct orte_filem_base_file_set_1_0_0_t orte_filem_base_file_set_t;
114
115 ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_filem_base_file_set_t);
116
117 /**
118 * Definition of a file movement request
119 * This will allow:
120 * - The movement of one or more files
121 * - to/from one or more processes
122 * in a single call of the API function. Allowing the implementation
123 * to optimize the sending/receiving of data.
124 * Used for the following:
125 *
126 */
127 struct orte_filem_base_request_1_0_0_t {
128 /** This is an object, so must have a super */
129 opal_list_item_t super;
130
131 /*
132 * A list of process sets
133 */
134 opal_list_t process_sets;
135
136 /*
137 * A list of file pairings
138 */
139 opal_list_t file_sets;
140
141 /*
142 * Internal use:
143 * Number of movements
144 */
145 int num_mv;
146
147 /*
148 * Internal use:
149 * Boolean to indianate if transfer is complete
150 */
151 bool *is_done;
152
153 /*
154 * Internal use:
155 * Boolean to indianate if transfer is active
156 */
157 bool *is_active;
158
159 /*
160 * Internal use:
161 * Exit status of the copy command
162 */
163 int32_t *exit_status;
164
165 /*
166 * Internal use:
167 * Movement type
168 */
169 int movement_type;
170 };
171 typedef struct orte_filem_base_request_1_0_0_t orte_filem_base_request_1_0_0_t;
172 typedef struct orte_filem_base_request_1_0_0_t orte_filem_base_request_t;
173
174 ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_filem_base_request_t);
175
176 /**
177 * Module initialization function.
178 * Returns ORTE_SUCCESS
179 */
180 typedef int (*orte_filem_base_module_init_fn_t)
181 (void);
182
183 /**
184 * Module finalization function.
185 * Returns ORTE_SUCCESS
186 */
187 typedef int (*orte_filem_base_module_finalize_fn_t)
188 (void);
189
190 /**
191 * Put a file or directory on the remote machine
192 *
193 * Note: By using a relative path for the remote file/directory, the filem
194 * component will negotiate the correct absolute path for that file/directory
195 * for the remote machine.
196 *
197 * @param request FileM request describing the files/directories to send,
198 * the remote files/directories to use, and the processes to see the change.
199 *
200 * @return ORTE_SUCCESS on successful file transer
201 * @return ORTE_ERROR on failed file transfer
202 */
203 typedef int (*orte_filem_base_put_fn_t)
204 (orte_filem_base_request_t *request);
205
206 /**
207 * Put a file or directory on the remote machine (Async)
208 *
209 * Note: By using a relative path for the remote file/directory, the filem
210 * component will negotiate the correct absolute path for that file/directory
211 * for the remote machine.
212 *
213 * @param request FileM request describing the files/directories to send,
214 * the remote files/directories to use, and the processes to see the change.
215 *
216 * @return ORTE_SUCCESS on successful file transer
217 * @return ORTE_ERROR on failed file transfer
218 */
219 typedef int (*orte_filem_base_put_nb_fn_t)
220 (orte_filem_base_request_t *request);
221
222 /**
223 * Get a file from the remote machine
224 *
225 * Note: By using a relative path for the remote file/directory, the filem
226 * component will negotiate the correct absolute path for that file/directory
227 * for the remote machine.
228 *
229 * @param request FileM request describing the files/directories to receive,
230 * the remote files/directories to use, and the processes to see the change.
231 *
232 * @return ORTE_SUCCESS on successful file transer
233 * @return ORTE_ERROR on failed file transfer
234 */
235 typedef int (*orte_filem_base_get_fn_t)
236 (orte_filem_base_request_t *request);
237
238 /**
239 * Get a file from the remote machine (Async)
240 *
241 * Note: By using a relative path for the remote file/directory, the filem
242 * component will negotiate the correct absolute path for that file/directory
243 * for the remote machine.
244 *
245 * @param request FileM request describing the files/directories to receive,
246 * the remote files/directories to use, and the processes to see the change.
247 *
248 * @return ORTE_SUCCESS on successful file transer
249 * @return ORTE_ERROR on failed file transfer
250 */
251 typedef int (*orte_filem_base_get_nb_fn_t)
252 (orte_filem_base_request_t *request);
253
254 /**
255 * Remove a file from the remote machine
256 *
257 * Note: By using a relative path for the remote file/directory, the filem
258 * component will negotiate the correct absolute path for that file/directory
259 * for the remote machine.
260 *
261 * @param request FileM request describing the remote files/directories to remove,
262 * the processes to see the change.
263 *
264 * @return ORTE_SUCCESS on success
265 * @return ORTE_ERROR on fail
266 */
267 typedef int (*orte_filem_base_rm_fn_t)
268 (orte_filem_base_request_t *request);
269
270 /**
271 * Remove a file from the remote machine (Async)
272 *
273 * Note: By using a relative path for the remote file/directory, the filem
274 * component will negotiate the correct absolute path for that file/directory
275 * for the remote machine.
276 *
277 * @param request FileM request describing the remote files/directories to remove,
278 * the processes to see the change.
279 *
280 * @return ORTE_SUCCESS on success
281 * @return ORTE_ERROR on fail
282 */
283 typedef int (*orte_filem_base_rm_nb_fn_t)
284 (orte_filem_base_request_t *request);
285
286 /**
287 * Wait for a single file movement request to finish
288 *
289 * @param request FileM request describing the remote files/directories.
290 *
291 * The request must have been passed through one of the non-blocking functions
292 * before calling wait or wait_all otherwise ORTE_ERROR will be returned.
293 *
294 * @return ORTE_SUCCESS on success
295 * @return ORTE_ERROR on fail
296 */
297 typedef int (*orte_filem_base_wait_fn_t)
298 (orte_filem_base_request_t *request);
299
300 /**
301 * Wait for a multiple file movement requests to finish
302 *
303 * @param request_list opal_list_t of FileM requests describing the remote files/directories.
304 *
305 * The request must have been passed through one of the non-blocking functions
306 * before calling wait or wait_all otherwise ORTE_ERROR will be returned.
307 *
308 * @return ORTE_SUCCESS on success
309 * @return ORTE_ERROR on fail
310 */
311 typedef int (*orte_filem_base_wait_all_fn_t)
312 (opal_list_t *request_list);
313
314 /**
315 * Structure for FILEM components.
316 */
317 struct orte_filem_base_component_2_0_0_t {
318 /** MCA base component */
319 mca_base_component_t base_version;
320 /** MCA base data */
321 mca_base_component_data_t base_data;
322
323 /** Verbosity Level */
324 int verbose;
325 /** Output Handle for opal_output */
326 int output_handle;
327 /** Default Priority */
328 int priority;
329 };
330 typedef struct orte_filem_base_component_2_0_0_t orte_filem_base_component_2_0_0_t;
331 typedef struct orte_filem_base_component_2_0_0_t orte_filem_base_component_t;
332
333 /**
334 * Structure for FILEM modules
335 */
336 struct orte_filem_base_module_1_0_0_t {
337 /** Initialization Function */
338 orte_filem_base_module_init_fn_t filem_init;
339 /** Finalization Function */
340 orte_filem_base_module_finalize_fn_t filem_finalize;
341
342 /** Put a file on the remote machine */
343 orte_filem_base_put_fn_t put;
344 orte_filem_base_put_nb_fn_t put_nb;
345 /** Get a file from the remote machine */
346 orte_filem_base_get_fn_t get;
347 orte_filem_base_get_nb_fn_t get_nb;
348
349 /** Remove a file on the remote machine */
350 orte_filem_base_rm_fn_t rm;
351 orte_filem_base_rm_nb_fn_t rm_nb;
352
353 /** Test functions for the non-blocking versions */
354 orte_filem_base_wait_fn_t wait;
355 orte_filem_base_wait_all_fn_t wait_all;
356
357 };
358 typedef struct orte_filem_base_module_1_0_0_t orte_filem_base_module_1_0_0_t;
359 typedef struct orte_filem_base_module_1_0_0_t orte_filem_base_module_t;
360
361 ORTE_DECLSPEC extern orte_filem_base_module_t orte_filem;
362
363 /**
364 * Macro for use in components that are of type FILEM
365 */
366 #define ORTE_FILEM_BASE_VERSION_2_0_0 \
367 MCA_BASE_VERSION_2_0_0, \
368 "filem", 2, 0, 0
369
370 END_C_DECLS
371
372 #endif /* ORTE_FILEM_H */
373
orte_filem_base_component_2_0_0_t::base_data
mca_base_component_data_t base_data
MCA base data.
Definition: filem.h:321
orte_filem_base_module_init_fn_t
int(* orte_filem_base_module_init_fn_t)(void)
Module initialization function.
Definition: filem.h:181
orte_filem_base_put_nb_fn_t
int(* orte_filem_base_put_nb_fn_t)(orte_filem_base_request_t *request)
Put a file or directory on the remote machine (Async)
Definition: filem.h:220
mca_base_component_2_0_0_t
Common type for all MCA components.
Definition: mca.h:250
orte_filem_base_module_1_0_0_t::rm
orte_filem_base_rm_fn_t rm
Remove a file on the remote machine.
Definition: filem.h:350
orte_filem_base_component_2_0_0_t::priority
int priority
Default Priority.
Definition: filem.h:328
orte_filem_base_request_1_0_0_t
Definition of a file movement request This will allow:
Definition: filem.h:127
orte_filem_base_module_1_0_0_t::put
orte_filem_base_put_fn_t put
Put a file on the remote machine.
Definition: filem.h:343
orte_process_name_t
Definition: types.h:146
orte_filem_base_process_set_1_0_0_t
Define a Process Set.
Definition: filem.h:68
orte_filem_base_module_1_0_0_t::filem_init
orte_filem_base_module_init_fn_t filem_init
Initialization Function.
Definition: filem.h:338
orte_filem_base_component_2_0_0_t::base_version
mca_base_component_t base_version
MCA base component.
Definition: filem.h:319
orte_filem_base_module_1_0_0_t
Structure for FILEM modules.
Definition: filem.h:336
orte_filem_base_component_2_0_0_t
Structure for FILEM components.
Definition: filem.h:317
orte_filem_base_get_fn_t
int(* orte_filem_base_get_fn_t)(orte_filem_base_request_t *request)
Get a file from the remote machine.
Definition: filem.h:236
orte_filem_base_module_finalize_fn_t
int(* orte_filem_base_module_finalize_fn_t)(void)
Module finalization function.
Definition: filem.h:188
orte_filem_base_module_1_0_0_t::wait
orte_filem_base_wait_fn_t wait
Test functions for the non-blocking versions.
Definition: filem.h:354
orte_filem_base_file_set_1_0_0_t
Define a File Pair.
Definition: filem.h:93
mca.h
Top-level interface for all MCA components.
opal_list_item_t
Definition: opal_list.h:98
types.h
orte_filem_base_component_2_0_0_t::verbose
int verbose
Verbosity Level.
Definition: filem.h:324
orte_filem_base_process_set_1_0_0_t::sink
orte_process_name_t sink
Sink Process.
Definition: filem.h:76
orte_filem_base_component_2_0_0_t::output_handle
int output_handle
Output Handle for opal_output.
Definition: filem.h:326
orte_filem_base_process_set_1_0_0_t::source
orte_process_name_t source
Source Process.
Definition: filem.h:73
mca_base_component_data_2_0_0_t
Meta data for MCA v2.0.0 components.
Definition: mca.h:309
opal_list_t
Definition: opal_list.h:147
orte_filem_base_process_set_1_0_0_t::super
opal_list_item_t super
This is an object, so must have a super.
Definition: filem.h:70
orte_filem_base_wait_all_fn_t
int(* orte_filem_base_wait_all_fn_t)(opal_list_t *request_list)
Wait for a multiple file movement requests to finish.
Definition: filem.h:312
request
Definition: evdns.c:158
orte_filem_base_put_fn_t
int(* orte_filem_base_put_fn_t)(orte_filem_base_request_t *request)
Put a file or directory on the remote machine.
Definition: filem.h:204
orte_filem_base_module_1_0_0_t::filem_finalize
orte_filem_base_module_finalize_fn_t filem_finalize
Finalization Function.
Definition: filem.h:340
orte_filem_base_wait_fn_t
int(* orte_filem_base_wait_fn_t)(orte_filem_base_request_t *request)
Wait for a single file movement request to finish.
Definition: filem.h:298
orte_filem_base_rm_nb_fn_t
int(* orte_filem_base_rm_nb_fn_t)(orte_filem_base_request_t *request)
Remove a file from the remote machine (Async)
Definition: filem.h:284
orte_filem_base_request_1_0_0_t::super
opal_list_item_t super
This is an object, so must have a super.
Definition: filem.h:129
orte_filem_base_rm_fn_t
int(* orte_filem_base_rm_fn_t)(orte_filem_base_request_t *request)
Remove a file from the remote machine.
Definition: filem.h:268
orte_filem_base_get_nb_fn_t
int(* orte_filem_base_get_nb_fn_t)(orte_filem_base_request_t *request)
Get a file from the remote machine (Async)
Definition: filem.h:252
opal_object.h
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...
orte_filem_base_file_set_1_0_0_t::super
opal_list_item_t super
This is an object, so must have a super.
Definition: filem.h:95
OBJ_CLASS_DECLARATION
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236