File: io.h

package info (click to toggle)
openmpi 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 202,312 kB
  • sloc: ansic: 612,441; makefile: 42,495; sh: 11,230; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,154; python: 1,856; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (383 lines) | stat: -rw-r--r-- 17,590 bytes parent folder | download | duplicates (2)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
 *                         University Research and Technology
 *                         Corporation.  All rights reserved.
 * Copyright (c) 2004-2005 The University of Tennessee and The University
 *                         of Tennessee Research Foundation.  All rights
 *                         reserved.
 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
 *                         University of Stuttgart.  All rights reserved.
 * Copyright (c) 2004-2005 The Regents of the University of California.
 *                         All rights reserved.
 * Copyright (c) 2008      Sun Microsystems, Inc.  All rights reserved.
 * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
 *                         reserved.
 * Copyright (c) 2015      University of Houston. All rights reserved.
 * Copyright (c) 2015      Research Organization for Information Science
 *                         and Technology (RIST). All rights reserved.
 * Copyright (c) 2016-2019 IBM Corporation. All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

#ifndef MCA_IO_H
#define MCA_IO_H

#include "mpi.h"
#include "ompi/mca/mca.h"
#include "ompi/request/request.h"
#include "ompi/info/info.h"

/*
 * Forward declaration for private data on io components and modules.
 */
struct ompi_file_t;
struct mca_io_base_file_t;
struct mca_io_base_delete_t;


/*
 * Forward declarations of things declared in this file
 */
struct mca_io_base_module_2_0_0_t;
union mca_io_base_modules_t;


/**
 * Version of IO component interface that we're using.
 *
 * The IO component is being designed to ensure that it can
 * simultaneously support multiple component versions in a single
 * executable.  This is because ROMIO will always be v2.x that
 * supports pretty much a 1-to-1 MPI-API-to-module-function mapping,
 * but we plan to have a v3.x series that will be "something
 * different" (as yet undefined).
 */
enum mca_io_base_version_t {
    MCA_IO_BASE_V_NONE,
    MCA_IO_BASE_V_2_0_0,

    MCA_IO_BASE_V_MAX
};
/**
 * Convenience typedef
 */
typedef enum mca_io_base_version_t mca_io_base_version_t;


/*
 * Macro for use in components that are of type io
 * 1-1 mapping of all MPI-IO functions
 */
#define MCA_IO_BASE_VERSION_2_0_0 \
    OMPI_MCA_BASE_VERSION_2_1_0("io", 2, 0, 0)

/*
 * Component
 */

struct mca_io_base_module_2_0_0_t;
typedef int (*mca_io_base_component_init_query_fn_t)
    (bool enable_progress_threads, bool enable_mpi_threads);
typedef const struct mca_io_base_module_2_0_0_t *
    (*mca_io_base_component_file_query_2_0_0_fn_t)
    (struct ompi_file_t *file, struct mca_io_base_file_t **private_data,
     int *priority);
typedef int (*mca_io_base_component_file_unquery_fn_t)
    (struct ompi_file_t *file, struct mca_io_base_file_t *private_data);

typedef int (*mca_io_base_component_file_delete_query_fn_t)
    (const char *filename, struct opal_info_t *info,
     struct mca_io_base_delete_t **private_data,
     bool *usable, int *priority);
typedef int (*mca_io_base_component_file_delete_select_fn_t)
    (const char *filename, struct opal_info_t *info,
     struct mca_io_base_delete_t *private_data);
typedef int (*mca_io_base_component_file_delete_unselect_fn_t)
    (const char *filename, struct opal_info_t *info,
     struct mca_io_base_delete_t *private_data);

typedef int (*mca_io_base_component_register_datarep_fn_t)(
                                              const char *,
                                              MPI_Datarep_conversion_function*,
                                              MPI_Datarep_conversion_function*,
                                              MPI_Datarep_extent_function*,
                                              void*);


/* IO component version and interface functions. */
struct mca_io_base_component_2_0_0_t {
    mca_base_component_t io_version;
    mca_base_component_data_t io_data;

    mca_io_base_component_init_query_fn_t io_init_query;
    mca_io_base_component_file_query_2_0_0_fn_t io_file_query;
    mca_io_base_component_file_unquery_fn_t io_file_unquery;

    mca_io_base_component_file_delete_query_fn_t io_delete_query;
    mca_io_base_component_file_delete_unselect_fn_t io_delete_unquery;
    mca_io_base_component_file_delete_select_fn_t io_delete_select;

    mca_io_base_component_register_datarep_fn_t io_register_datarep;
};
typedef struct mca_io_base_component_2_0_0_t mca_io_base_component_2_0_0_t;


/*
 * All component versions
 */
union mca_io_base_components_t {
    mca_io_base_component_2_0_0_t v2_0_0;
};
typedef union mca_io_base_components_t mca_io_base_components_t;


/*
 * Module v2.0.0
 */

typedef int (*mca_io_base_module_file_open_fn_t)
    (struct ompi_communicator_t *comm, const char *filename, int amode,
     struct opal_info_t *info, struct ompi_file_t *fh);
typedef int (*mca_io_base_module_file_close_fn_t)(struct ompi_file_t *fh);

typedef int (*mca_io_base_module_file_set_size_fn_t)
    (struct ompi_file_t *fh, MPI_Offset size);
typedef int (*mca_io_base_module_file_preallocate_fn_t)
    (struct ompi_file_t *fh, MPI_Offset size);
typedef int (*mca_io_base_module_file_get_size_fn_t)
    (struct ompi_file_t *fh, MPI_Offset *size);
typedef int (*mca_io_base_module_file_get_amode_fn_t)
    (struct ompi_file_t *fh, int *amode);
typedef int (*mca_io_base_module_file_set_info_fn_t)
    (struct ompi_file_t *fh, struct ompi_info_t *info);
typedef int (*mca_io_base_module_file_get_info_fn_t)
    (struct ompi_file_t *fh, struct ompi_info_t **info_used);

typedef int (*mca_io_base_module_file_set_view_fn_t)
    (struct ompi_file_t *fh, MPI_Offset disp, struct ompi_datatype_t *etype,
     struct ompi_datatype_t *filetype, const char *datarep,
     struct opal_info_t *info);
typedef int (*mca_io_base_module_file_get_view_fn_t)
    (struct ompi_file_t *fh, MPI_Offset *disp,
     struct ompi_datatype_t **etype, struct ompi_datatype_t **filetype,
     char *datarep);

typedef int (*mca_io_base_module_file_read_at_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
     int count, struct ompi_datatype_t *datatype,
     struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_read_at_all_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
     int count, struct ompi_datatype_t *datatype,
     struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_write_at_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, const void *buf,
     int count, struct ompi_datatype_t *datatype,
     struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_write_at_all_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, const void *buf,
     int count, struct ompi_datatype_t *datatype,
     struct ompi_status_public_t *status);

typedef int (*mca_io_base_module_file_iread_at_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
     int count, struct ompi_datatype_t *datatype,
     struct ompi_request_t **request);
typedef int (*mca_io_base_module_file_iwrite_at_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, const void *buf,
     int count, struct ompi_datatype_t *datatype,
     struct ompi_request_t **request);

typedef int (*mca_io_base_module_file_iread_at_all_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
     int count, struct ompi_datatype_t *datatype,
     struct ompi_request_t **request);
typedef int (*mca_io_base_module_file_iwrite_at_all_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, const void *buf,
     int count, struct ompi_datatype_t *datatype,
     struct ompi_request_t **request);

typedef int (*mca_io_base_module_file_read_fn_t)
    (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *
     datatype, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_read_all_fn_t)
    (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *
     datatype, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_write_fn_t)
    (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *
     datatype, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_write_all_fn_t)
    (struct ompi_file_t *fh, const void *buf, int count, struct ompi_datatype_t *
     datatype, struct ompi_status_public_t *status);

typedef int (*mca_io_base_module_file_iread_fn_t)
    (struct ompi_file_t *fh, void *buf, int count,
     struct ompi_datatype_t *datatype, struct ompi_request_t **request);
typedef int (*mca_io_base_module_file_iwrite_fn_t)
    (struct ompi_file_t *fh, const void *buf, int count,
     struct ompi_datatype_t *datatype, struct ompi_request_t **request);

typedef int (*mca_io_base_module_file_iread_all_fn_t)
    (struct ompi_file_t *fh, void *buf, int count,
     struct ompi_datatype_t *datatype, struct ompi_request_t **request);
typedef int (*mca_io_base_module_file_iwrite_all_fn_t)
    (struct ompi_file_t *fh, const void *buf, int count,
     struct ompi_datatype_t *datatype, struct ompi_request_t **request);

typedef int (*mca_io_base_module_file_seek_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, int whence);
typedef int (*mca_io_base_module_file_get_position_fn_t)
    (struct ompi_file_t *fh, MPI_Offset *offset);
typedef int (*mca_io_base_module_file_get_byte_offset_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, MPI_Offset *disp);

typedef int (*mca_io_base_module_file_read_shared_fn_t)
    (struct ompi_file_t *fh, void *buf, int count,
     struct ompi_datatype_t *datatype, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_write_shared_fn_t)
    (struct ompi_file_t *fh, const void *buf, int count,
     struct ompi_datatype_t *datatype, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_iread_shared_fn_t)
    (struct ompi_file_t *fh, void *buf, int count,
     struct ompi_datatype_t *datatype, struct ompi_request_t **request);
typedef int (*mca_io_base_module_file_iwrite_shared_fn_t)
    (struct ompi_file_t *fh, const void *buf, int count,
     struct ompi_datatype_t *datatype, struct ompi_request_t **request);
typedef int (*mca_io_base_module_file_read_ordered_fn_t)
    (struct ompi_file_t *fh, void *buf, int count,
     struct ompi_datatype_t *datatype, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_write_ordered_fn_t)
    (struct ompi_file_t *fh, const void *buf, int count,
     struct ompi_datatype_t *datatype, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_seek_shared_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, int whence);
typedef int (*mca_io_base_module_file_get_position_shared_fn_t)
    (struct ompi_file_t *fh, MPI_Offset *offset);

typedef int (*mca_io_base_module_file_read_at_all_begin_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, void *buf,
     int count, struct ompi_datatype_t *datatype);
typedef int (*mca_io_base_module_file_read_at_all_end_fn_t)
    (struct ompi_file_t *fh, void *buf, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_write_at_all_begin_fn_t)
    (struct ompi_file_t *fh, MPI_Offset offset, const void *buf,
     int count, struct ompi_datatype_t *datatype);
typedef int (*mca_io_base_module_file_write_at_all_end_fn_t)
    (struct ompi_file_t *fh, const void *buf, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_read_all_begin_fn_t)
    (struct ompi_file_t *fh, void *buf, int count,
     struct ompi_datatype_t *datatype);
typedef int (*mca_io_base_module_file_read_all_end_fn_t)
    (struct ompi_file_t *fh, void *buf, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_write_all_begin_fn_t)
    (struct ompi_file_t *fh, const void *buf, int count,
     struct ompi_datatype_t *datatype);
typedef int (*mca_io_base_module_file_write_all_end_fn_t)
    (struct ompi_file_t *fh, const void *buf, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_read_ordered_begin_fn_t)
    (struct ompi_file_t *fh, void *buf, int count,
     struct ompi_datatype_t *datatype);
typedef int (*mca_io_base_module_file_read_ordered_end_fn_t)
    (struct ompi_file_t *fh, void *buf, struct ompi_status_public_t *status);
typedef int (*mca_io_base_module_file_write_ordered_begin_fn_t)
    (struct ompi_file_t *fh, const void *buf, int count,
     struct ompi_datatype_t *datatype);
typedef int (*mca_io_base_module_file_write_ordered_end_fn_t)
    (struct ompi_file_t *fh, const void *buf, struct ompi_status_public_t *status);

typedef int (*mca_io_base_module_file_get_type_extent_fn_t)
    (struct ompi_file_t *fh, struct ompi_datatype_t *datatype,
     MPI_Aint *extent);

typedef int (*mca_io_base_module_file_set_atomicity_fn_t)
    (struct ompi_file_t *fh, int flag);
typedef int (*mca_io_base_module_file_get_atomicity_fn_t)
    (struct ompi_file_t *fh, int *flag);
typedef int (*mca_io_base_module_file_sync_fn_t)(struct ompi_file_t *fh);

struct mca_io_base_module_2_0_0_t {

    /* Back-ends to MPI API calls (pretty much a 1-to-1 mapping) */

    mca_io_base_module_file_open_fn_t        io_module_file_open;
    mca_io_base_module_file_close_fn_t       io_module_file_close;

    mca_io_base_module_file_set_size_fn_t    io_module_file_set_size;
    mca_io_base_module_file_preallocate_fn_t io_module_file_preallocate;
    mca_io_base_module_file_get_size_fn_t    io_module_file_get_size;
    mca_io_base_module_file_get_amode_fn_t   io_module_file_get_amode;
    mca_io_base_module_file_set_info_fn_t    io_module_file_set_info;
    mca_io_base_module_file_get_info_fn_t    io_module_file_get_info;

    mca_io_base_module_file_set_view_fn_t    io_module_file_set_view;
    mca_io_base_module_file_get_view_fn_t    io_module_file_get_view;

    mca_io_base_module_file_read_at_fn_t     io_module_file_read_at;
    mca_io_base_module_file_read_at_all_fn_t io_module_file_read_at_all;
    mca_io_base_module_file_write_at_fn_t    io_module_file_write_at;
    mca_io_base_module_file_write_at_all_fn_t  io_module_file_write_at_all;

    mca_io_base_module_file_iread_at_fn_t      io_module_file_iread_at;
    mca_io_base_module_file_iwrite_at_fn_t     io_module_file_iwrite_at;
    mca_io_base_module_file_iread_at_all_fn_t  io_module_file_iread_at_all;
    mca_io_base_module_file_iwrite_at_all_fn_t io_module_file_iwrite_at_all;

    mca_io_base_module_file_read_fn_t        io_module_file_read;
    mca_io_base_module_file_read_all_fn_t    io_module_file_read_all;
    mca_io_base_module_file_write_fn_t       io_module_file_write;
    mca_io_base_module_file_write_all_fn_t   io_module_file_write_all;

    mca_io_base_module_file_iread_fn_t       io_module_file_iread;
    mca_io_base_module_file_iwrite_fn_t      io_module_file_iwrite;
    mca_io_base_module_file_iread_all_fn_t   io_module_file_iread_all;
    mca_io_base_module_file_iwrite_all_fn_t  io_module_file_iwrite_all;

    mca_io_base_module_file_seek_fn_t        io_module_file_seek;
    mca_io_base_module_file_get_position_fn_t io_module_file_get_position;
    mca_io_base_module_file_get_byte_offset_fn_t io_module_file_get_byte_offset;

    mca_io_base_module_file_read_shared_fn_t   io_module_file_read_shared;
    mca_io_base_module_file_write_shared_fn_t  io_module_file_write_shared;
    mca_io_base_module_file_iread_shared_fn_t  io_module_file_iread_shared;
    mca_io_base_module_file_iwrite_shared_fn_t io_module_file_iwrite_shared;
    mca_io_base_module_file_read_ordered_fn_t  io_module_file_read_ordered;
    mca_io_base_module_file_write_ordered_fn_t io_module_file_write_ordered;
    mca_io_base_module_file_seek_shared_fn_t   io_module_file_seek_shared;
    mca_io_base_module_file_get_position_shared_fn_t  io_module_file_get_position_shared;

    mca_io_base_module_file_read_at_all_begin_fn_t    io_module_file_read_at_all_begin;
    mca_io_base_module_file_read_at_all_end_fn_t      io_module_file_read_at_all_end;
    mca_io_base_module_file_write_at_all_begin_fn_t   io_module_file_write_at_all_begin;
    mca_io_base_module_file_write_at_all_end_fn_t     io_module_file_write_at_all_end;
    mca_io_base_module_file_read_all_begin_fn_t       io_module_file_read_all_begin;
    mca_io_base_module_file_read_all_end_fn_t         io_module_file_read_all_end;
    mca_io_base_module_file_write_all_begin_fn_t      io_module_file_write_all_begin;
    mca_io_base_module_file_write_all_end_fn_t        io_module_file_write_all_end;
    mca_io_base_module_file_read_ordered_begin_fn_t   io_module_file_read_ordered_begin;
    mca_io_base_module_file_read_ordered_end_fn_t     io_module_file_read_ordered_end;
    mca_io_base_module_file_write_ordered_begin_fn_t  io_module_file_write_ordered_begin;
    mca_io_base_module_file_write_ordered_end_fn_t    io_module_file_write_ordered_end;

    mca_io_base_module_file_get_type_extent_fn_t      io_module_file_get_type_extent;

    mca_io_base_module_file_set_atomicity_fn_t        io_module_file_set_atomicity;
    mca_io_base_module_file_get_atomicity_fn_t        io_module_file_get_atomicity;
    mca_io_base_module_file_sync_fn_t                 io_module_file_sync;
};
typedef struct mca_io_base_module_2_0_0_t mca_io_base_module_2_0_0_t;


/*
 * All module versions
 */
union mca_io_base_modules_t {
    mca_io_base_module_2_0_0_t v2_0_0;
};
typedef union mca_io_base_modules_t mca_io_base_modules_t;

#endif /* MCA_IO_H */