OpenMPI 0.1.1

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

- File List
- Globals

io.h
1 /*
2 * Copyright (c) 2004-2005 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 (c) 2008 Sun Microsystems, Inc. All rights reserved.
13 * $COPYRIGHT$
14 *
15 * Additional copyrights may follow
16 *
17 * $HEADER$
18 */
19
20 #ifndef MCA_IO_H
21 #define MCA_IO_H
22
23 #include "mpi.h"
24 #include "opal/mca/mca.h"
25 #include "ompi/request/request.h"
26
27 /*
28 * Forward declaration for private data on io components and modules.
29 */
30 struct ompi_file_t;
31 struct mca_io_base_file_t;
32 struct mca_io_base_delete_t;
33
34
35 /*
36 * Forward declarations of things declared in this file
37 */
38 struct mca_io_base_module_2_0_0_t;
39 union mca_io_base_modules_t;
40
41
42 /**
43 * Version of IO component interface that we're using.
44 *
45 * The IO component is being designed to ensure that it can
46 * simultaneously support multiple component versions in a single
47 * executable. This is because ROMIO will always be v2.x that
48 * supports pretty much a 1-to-1 MPI-API-to-module-function mapping,
49 * but we plan to have a v3.x series that will be "something
50 * different" (as yet undefined).
51 */
52 enum mca_io_base_version_t {
53 MCA_IO_BASE_V_NONE,
54 MCA_IO_BASE_V_2_0_0,
55
56 MCA_IO_BASE_V_MAX
57 };
58 /**
59 * Convenience typedef
60 */
61 typedef enum mca_io_base_version_t mca_io_base_version_t;
62
63
64 /*
65 * Macro for use in components that are of type io
66 * 1-1 mapping of all MPI-IO functions
67 */
68 #define MCA_IO_BASE_VERSION_2_0_0 \
69 MCA_BASE_VERSION_2_0_0, \
70 "io", 2, 0, 0
71
72 /*
73 * Component
74 */
75
76 struct mca_io_base_module_2_0_0_t;
77 typedef int (*mca_io_base_component_init_query_fn_t)
78 (bool enable_progress_threads, bool enable_mpi_threads);
79 typedef const struct mca_io_base_module_2_0_0_t *
80 (*mca_io_base_component_file_query_2_0_0_fn_t)
81 (struct ompi_file_t *file, struct mca_io_base_file_t **private_data,
82 int *priority);
83 typedef int (*mca_io_base_component_file_unquery_fn_t)
84 (struct ompi_file_t *file, struct mca_io_base_file_t *private_data);
85
86 typedef int (*mca_io_base_component_file_delete_query_fn_t)
87 (char *filename, struct ompi_info_t *info,
88 struct mca_io_base_delete_t **private_data,
89 bool *usable, int *priority);
90 typedef int (*mca_io_base_component_file_delete_select_fn_t)
91 (char *filename, struct ompi_info_t *info,
92 struct mca_io_base_delete_t *private_data);
93 typedef int (*mca_io_base_component_file_delete_unselect_fn_t)
94 (char *filename, struct ompi_info_t *info,
95 struct mca_io_base_delete_t *private_data);
96
97 typedef int (*mca_io_base_component_register_datarep_fn_t)(
98 char *,
99 MPI_Datarep_conversion_function*,
100 MPI_Datarep_conversion_function*,
101 MPI_Datarep_extent_function*,
102 void*);
103
104
105 /* IO component version and interface functions. */
106 struct mca_io_base_component_2_0_0_t {
107 mca_base_component_t io_version;
108 mca_base_component_data_t io_data;
109
110 mca_io_base_component_init_query_fn_t io_init_query;
111 mca_io_base_component_file_query_2_0_0_fn_t io_file_query;
112 mca_io_base_component_file_unquery_fn_t io_file_unquery;
113
114 mca_io_base_component_file_delete_query_fn_t io_delete_query;
115 mca_io_base_component_file_delete_unselect_fn_t io_delete_unquery;
116 mca_io_base_component_file_delete_select_fn_t io_delete_select;
117
118 mca_io_base_component_register_datarep_fn_t io_register_datarep;
119 };
120 typedef struct mca_io_base_component_2_0_0_t mca_io_base_component_2_0_0_t;
121
122
123 /*
124 * All component versions
125 */
126 union mca_io_base_components_t {
127 mca_io_base_component_2_0_0_t v2_0_0;
128 };
129 typedef union mca_io_base_components_t mca_io_base_components_t;
130
131
132 /*
133 * Module v2.0.0
134 */
135
136 typedef int (*mca_io_base_module_file_open_fn_t)
137 (struct ompi_communicator_t *comm, char *filename, int amode,
138 struct ompi_info_t *info, struct ompi_file_t *fh);
139 typedef int (*mca_io_base_module_file_close_fn_t)(struct ompi_file_t *fh);
140
141 typedef int (*mca_io_base_module_file_set_size_fn_t)
142 (struct ompi_file_t *fh, MPI_Offset size);
143 typedef int (*mca_io_base_module_file_preallocate_fn_t)
144 (struct ompi_file_t *fh, MPI_Offset size);
145 typedef int (*mca_io_base_module_file_get_size_fn_t)
146 (struct ompi_file_t *fh, MPI_Offset *size);
147 typedef int (*mca_io_base_module_file_get_amode_fn_t)
148 (struct ompi_file_t *fh, int *amode);
149 typedef int (*mca_io_base_module_file_set_info_fn_t)
150 (struct ompi_file_t *fh, struct ompi_info_t *info);
151 typedef int (*mca_io_base_module_file_get_info_fn_t)
152 (struct ompi_file_t *fh, struct ompi_info_t **info_used);
153
154 typedef int (*mca_io_base_module_file_set_view_fn_t)
155 (struct ompi_file_t *fh, MPI_Offset disp, struct ompi_datatype_t *etype,
156 struct ompi_datatype_t *filetype, char *datarep,
157 struct ompi_info_t *info);
158 typedef int (*mca_io_base_module_file_get_view_fn_t)
159 (struct ompi_file_t *fh, MPI_Offset *disp,
160 struct ompi_datatype_t **etype, struct ompi_datatype_t **filetype,
161 char *datarep);
162
163 typedef int (*mca_io_base_module_file_read_at_fn_t)
164 (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
165 int count, struct ompi_datatype_t *datatype,
166 struct ompi_status_public_t *status);
167 typedef int (*mca_io_base_module_file_read_at_all_fn_t)
168 (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
169 int count, struct ompi_datatype_t *datatype,
170 struct ompi_status_public_t *status);
171 typedef int (*mca_io_base_module_file_write_at_fn_t)
172 (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
173 int count, struct ompi_datatype_t *datatype,
174 struct ompi_status_public_t *status);
175 typedef int (*mca_io_base_module_file_write_at_all_fn_t)
176 (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
177 int count, struct ompi_datatype_t *datatype,
178 struct ompi_status_public_t *status);
179
180 typedef int (*mca_io_base_module_file_iread_at_fn_t)
181 (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
182 int count, struct ompi_datatype_t *datatype,
183 struct ompi_request_t **request);
184 typedef int (*mca_io_base_module_file_iwrite_at_fn_t)
185 (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
186 int count, struct ompi_datatype_t *datatype,
187 struct ompi_request_t **request);
188
189 typedef int (*mca_io_base_module_file_read_fn_t)
190 (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *
191 datatype, struct ompi_status_public_t *status);
192 typedef int (*mca_io_base_module_file_read_all_fn_t)
193 (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *
194 datatype, struct ompi_status_public_t *status);
195 typedef int (*mca_io_base_module_file_write_fn_t)
196 (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *
197 datatype, struct ompi_status_public_t *status);
198 typedef int (*mca_io_base_module_file_write_all_fn_t)
199 (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *
200 datatype, struct ompi_status_public_t *status);
201
202 typedef int (*mca_io_base_module_file_iread_fn_t)
203 (struct ompi_file_t *fh, void *buf, int count,
204 struct ompi_datatype_t *datatype, struct ompi_request_t **request);
205 typedef int (*mca_io_base_module_file_iwrite_fn_t)
206 (struct ompi_file_t *fh, void *buf, int count,
207 struct ompi_datatype_t *datatype, struct ompi_request_t **request);
208
209 typedef int (*mca_io_base_module_file_seek_fn_t)
210 (struct ompi_file_t *fh, MPI_Offset offset, int whence);
211 typedef int (*mca_io_base_module_file_get_position_fn_t)
212 (struct ompi_file_t *fh, MPI_Offset *offset);
213 typedef int (*mca_io_base_module_file_get_byte_offset_fn_t)
214 (struct ompi_file_t *fh, MPI_Offset offset, MPI_Offset *disp);
215
216 typedef int (*mca_io_base_module_file_read_shared_fn_t)
217 (struct ompi_file_t *fh, void *buf, int count,
218 struct ompi_datatype_t *datatype, struct ompi_status_public_t *status);
219 typedef int (*mca_io_base_module_file_write_shared_fn_t)
220 (struct ompi_file_t *fh, void *buf, int count,
221 struct ompi_datatype_t *datatype, struct ompi_status_public_t *status);
222 typedef int (*mca_io_base_module_file_iread_shared_fn_t)
223 (struct ompi_file_t *fh, void *buf, int count,
224 struct ompi_datatype_t *datatype, struct ompi_request_t **request);
225 typedef int (*mca_io_base_module_file_iwrite_shared_fn_t)
226 (struct ompi_file_t *fh, void *buf, int count,
227 struct ompi_datatype_t *datatype, struct ompi_request_t **request);
228 typedef int (*mca_io_base_module_file_read_ordered_fn_t)
229 (struct ompi_file_t *fh, void *buf, int count,
230 struct ompi_datatype_t *datatype, struct ompi_status_public_t *status);
231 typedef int (*mca_io_base_module_file_write_ordered_fn_t)
232 (struct ompi_file_t *fh, void *buf, int count,
233 struct ompi_datatype_t *datatype, struct ompi_status_public_t *status);
234 typedef int (*mca_io_base_module_file_seek_shared_fn_t)
235 (struct ompi_file_t *fh, MPI_Offset offset, int whence);
236 typedef int (*mca_io_base_module_file_get_position_shared_fn_t)
237 (struct ompi_file_t *fh, MPI_Offset *offset);
238
239 typedef int (*mca_io_base_module_file_read_at_all_begin_fn_t)
240 (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
241 int count, struct ompi_datatype_t *datatype);
242 typedef int (*mca_io_base_module_file_read_at_all_end_fn_t)
243 (struct ompi_file_t *fh, void *buf, struct ompi_status_public_t *status);
244 typedef int (*mca_io_base_module_file_write_at_all_begin_fn_t)
245 (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
246 int count, struct ompi_datatype_t *datatype);
247 typedef int (*mca_io_base_module_file_write_at_all_end_fn_t)
248 (struct ompi_file_t *fh, void *buf, struct ompi_status_public_t *status);
249 typedef int (*mca_io_base_module_file_read_all_begin_fn_t)
250 (struct ompi_file_t *fh, void *buf, int count,
251 struct ompi_datatype_t *datatype);
252 typedef int (*mca_io_base_module_file_read_all_end_fn_t)
253 (struct ompi_file_t *fh, void *buf, struct ompi_status_public_t *status);
254 typedef int (*mca_io_base_module_file_write_all_begin_fn_t)
255 (struct ompi_file_t *fh, void *buf, int count,
256 struct ompi_datatype_t *datatype);
257 typedef int (*mca_io_base_module_file_write_all_end_fn_t)
258 (struct ompi_file_t *fh, void *buf, struct ompi_status_public_t *status);
259 typedef int (*mca_io_base_module_file_read_ordered_begin_fn_t)
260 (struct ompi_file_t *fh, void *buf, int count,
261 struct ompi_datatype_t *datatype);
262 typedef int (*mca_io_base_module_file_read_ordered_end_fn_t)
263 (struct ompi_file_t *fh, void *buf, struct ompi_status_public_t *status);
264 typedef int (*mca_io_base_module_file_write_ordered_begin_fn_t)
265 (struct ompi_file_t *fh, void *buf, int count,
266 struct ompi_datatype_t *datatype);
267 typedef int (*mca_io_base_module_file_write_ordered_end_fn_t)
268 (struct ompi_file_t *fh, void *buf, struct ompi_status_public_t *status);
269
270 typedef int (*mca_io_base_module_file_get_type_extent_fn_t)
271 (struct ompi_file_t *fh, struct ompi_datatype_t *datatype,
272 MPI_Aint *extent);
273
274 typedef int (*mca_io_base_module_file_set_atomicity_fn_t)
275 (struct ompi_file_t *fh, int flag);
276 typedef int (*mca_io_base_module_file_get_atomicity_fn_t)
277 (struct ompi_file_t *fh, int *flag);
278 typedef int (*mca_io_base_module_file_sync_fn_t)(struct ompi_file_t *fh);
279
280 struct mca_io_base_module_2_0_0_t {
281
282 /* Back-ends to MPI API calls (pretty much a 1-to-1 mapping) */
283
284 mca_io_base_module_file_open_fn_t io_module_file_open;
285 mca_io_base_module_file_close_fn_t io_module_file_close;
286
287 mca_io_base_module_file_set_size_fn_t io_module_file_set_size;
288 mca_io_base_module_file_preallocate_fn_t io_module_file_preallocate;
289 mca_io_base_module_file_get_size_fn_t io_module_file_get_size;
290 mca_io_base_module_file_get_amode_fn_t io_module_file_get_amode;
291 mca_io_base_module_file_set_info_fn_t io_module_file_set_info;
292 mca_io_base_module_file_get_info_fn_t io_module_file_get_info;
293
294 mca_io_base_module_file_set_view_fn_t io_module_file_set_view;
295 mca_io_base_module_file_get_view_fn_t io_module_file_get_view;
296
297 mca_io_base_module_file_read_at_fn_t io_module_file_read_at;
298 mca_io_base_module_file_read_at_all_fn_t io_module_file_read_at_all;
299 mca_io_base_module_file_write_at_fn_t io_module_file_write_at;
300 mca_io_base_module_file_write_at_all_fn_t io_module_file_write_at_all;
301
302 mca_io_base_module_file_iread_at_fn_t io_module_file_iread_at;
303 mca_io_base_module_file_iwrite_at_fn_t io_module_file_iwrite_at;
304
305 mca_io_base_module_file_read_fn_t io_module_file_read;
306 mca_io_base_module_file_read_all_fn_t io_module_file_read_all;
307 mca_io_base_module_file_write_fn_t io_module_file_write;
308 mca_io_base_module_file_write_all_fn_t io_module_file_write_all;
309
310 mca_io_base_module_file_iread_fn_t io_module_file_iread;
311 mca_io_base_module_file_iwrite_fn_t io_module_file_iwrite;
312
313 mca_io_base_module_file_seek_fn_t io_module_file_seek;
314 mca_io_base_module_file_get_position_fn_t io_module_file_get_position;
315 mca_io_base_module_file_get_byte_offset_fn_t io_module_file_get_byte_offset;
316
317 mca_io_base_module_file_read_shared_fn_t io_module_file_read_shared;
318 mca_io_base_module_file_write_shared_fn_t io_module_file_write_shared;
319 mca_io_base_module_file_iread_shared_fn_t io_module_file_iread_shared;
320 mca_io_base_module_file_iwrite_shared_fn_t io_module_file_iwrite_shared;
321 mca_io_base_module_file_read_ordered_fn_t io_module_file_read_ordered;
322 mca_io_base_module_file_write_ordered_fn_t io_module_file_write_ordered;
323 mca_io_base_module_file_seek_shared_fn_t io_module_file_seek_shared;
324 mca_io_base_module_file_get_position_shared_fn_t io_module_file_get_position_shared;
325
326 mca_io_base_module_file_read_at_all_begin_fn_t io_module_file_read_at_all_begin;
327 mca_io_base_module_file_read_at_all_end_fn_t io_module_file_read_at_all_end;
328 mca_io_base_module_file_write_at_all_begin_fn_t io_module_file_write_at_all_begin;
329 mca_io_base_module_file_write_at_all_end_fn_t io_module_file_write_at_all_end;
330 mca_io_base_module_file_read_all_begin_fn_t io_module_file_read_all_begin;
331 mca_io_base_module_file_read_all_end_fn_t io_module_file_read_all_end;
332 mca_io_base_module_file_write_all_begin_fn_t io_module_file_write_all_begin;
333 mca_io_base_module_file_write_all_end_fn_t io_module_file_write_all_end;
334 mca_io_base_module_file_read_ordered_begin_fn_t io_module_file_read_ordered_begin;
335 mca_io_base_module_file_read_ordered_end_fn_t io_module_file_read_ordered_end;
336 mca_io_base_module_file_write_ordered_begin_fn_t io_module_file_write_ordered_begin;
337 mca_io_base_module_file_write_ordered_end_fn_t io_module_file_write_ordered_end;
338
339 mca_io_base_module_file_get_type_extent_fn_t io_module_file_get_type_extent;
340
341 mca_io_base_module_file_set_atomicity_fn_t io_module_file_set_atomicity;
342 mca_io_base_module_file_get_atomicity_fn_t io_module_file_get_atomicity;
343 mca_io_base_module_file_sync_fn_t io_module_file_sync;
344 };
345 typedef struct mca_io_base_module_2_0_0_t mca_io_base_module_2_0_0_t;
346
347
348 /*
349 * All module versions
350 */
351 union mca_io_base_modules_t {
352 mca_io_base_module_2_0_0_t v2_0_0;
353 };
354 typedef union mca_io_base_modules_t mca_io_base_modules_t;
355
356 #endif /* MCA_IO_H */
mca_base_component_2_0_0_t
Common type for all MCA components.
Definition: mca.h:250
ompi_datatype_t
Definition: ompi_datatype.h:68
mca_io_base_component_2_0_0_t
Definition: io.h:106
mca_io_base_components_t
Definition: io.h:126
mca_io_base_modules_t
Definition: io.h:351
mca.h
Top-level interface for all MCA components.
ompi_info_t
Definition: info.h:38
mca_io_base_module_2_0_0_t
Definition: io.h:280
request.h
Top-level description of requests.
ompi_file_t
Back-end structure for MPI_File.
Definition: file.h:42
mca_base_component_data_2_0_0_t
Meta data for MCA v2.0.0 components.
Definition: mca.h:309
ompi_status_public_t
Definition: mpi.h:337
request
Definition: evdns.c:158
ompi_communicator_t
Definition: communicator.h:118
ompi_request_t
Main top-level request struct definition.
Definition: request.h:100