1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #ifndef MCA_IO_OMPIO_H
25 #define MCA_IO_OMPIO_H
26
27 #include <fcntl.h>
28
29 #include "mpi.h"
30 #include "opal/class/opal_list.h"
31 #include "ompi/errhandler/errhandler.h"
32 #include "opal/threads/mutex.h"
33 #include "ompi/file/file.h"
34 #include "ompi/mca/io/io.h"
35 #include "ompi/mca/fs/fs.h"
36 #include "ompi/mca/fcoll/fcoll.h"
37 #include "ompi/mca/fbtl/fbtl.h"
38 #include "ompi/mca/sharedfp/sharedfp.h"
39 #include "ompi/communicator/communicator.h"
40 #include "ompi/info/info.h"
41 #include "opal/datatype/opal_convertor.h"
42 #include "ompi/datatype/ompi_datatype.h"
43 #include "ompi/request/request.h"
44
45 #include "ompi/mca/common/ompio/common_ompio.h"
46
47 extern int mca_io_ompio_cycle_buffer_size;
48 extern int mca_io_ompio_bytes_per_agg;
49 extern int mca_io_ompio_num_aggregators;
50 extern int mca_io_ompio_record_offset_info;
51 extern int mca_io_ompio_grouping_option;
52 extern int mca_io_ompio_max_aggregators_ratio;
53 extern int mca_io_ompio_aggregators_cutoff_threshold;
54 extern int mca_io_ompio_overwrite_amode;
55 extern int mca_io_ompio_verbose_info_parsing;
56
57 OMPI_DECLSPEC extern int mca_io_ompio_coll_timing_info;
58
59 #define QUEUESIZE 2048
60
61
62
63
64 #define OMPIO_PREALLOC_MAX_BUF_SIZE 33554432
65 #define OMPIO_DEFAULT_CYCLE_BUF_SIZE 536870912
66 #define OMPIO_TAG_GATHER -100
67 #define OMPIO_TAG_GATHERV -101
68 #define OMPIO_TAG_BCAST -102
69 #define OMPIO_TAG_SCATTERV -103
70
71
72 #define OMPIO_MODE_CREATE 1
73 #define OMPIO_MODE_RDONLY 2
74 #define OMPIO_MODE_WRONLY 4
75 #define OMPIO_MODE_RDWR 8
76 #define OMPIO_MODE_DELETE_ON_CLOSE 16
77 #define OMPIO_MODE_UNIQUE_OPEN 32
78 #define OMPIO_MODE_EXCL 64
79 #define OMPIO_MODE_APPEND 128
80 #define OMPIO_MODE_SEQUENTIAL 256
81
82
83
84 BEGIN_C_DECLS
85
86 OMPI_DECLSPEC extern mca_io_base_component_2_0_0_t mca_io_ompio_component;
87
88
89
90 extern opal_mutex_t mca_io_ompio_mutex;
91 extern mca_io_base_module_2_0_0_t mca_io_ompio_module;
92 OMPI_DECLSPEC extern mca_io_base_component_2_0_0_t mca_io_ompio_component;
93
94
95 typedef struct mca_io_ompio_offlen_array_t{
96 OMPI_MPI_OFFSET_TYPE offset;
97 MPI_Aint length;
98 int process_id;
99 }mca_io_ompio_offlen_array_t;
100
101
102 #include "ompi/mca/common/ompio/common_ompio.h"
103 #include "ompi/mca/common/ompio/common_ompio_aggregators.h"
104
105
106
107 OMPI_DECLSPEC int mca_io_ompio_get_mca_parameter_value ( char *mca_parameter_name, int name_length);
108
109
110
111
112
113 OMPI_DECLSPEC int ompi_io_ompio_sort_offlen (mca_io_ompio_offlen_array_t *io_array,
114 int num_entries,
115 int *sorted);
116
117
118 OMPI_DECLSPEC int ompi_io_ompio_generate_current_file_view (struct ompio_file_t *fh,
119 size_t max_data,
120 struct iovec **f_iov,
121 int *iov_count);
122
123 OMPI_DECLSPEC int ompi_io_ompio_generate_groups (ompio_file_t *fh,
124 int num_aggregators,
125 int *root,
126 int *procs_per_group,
127 int **ranks);
128
129
130
131
132
133
134
135 int mca_io_ompio_file_set_view (struct ompi_file_t *fh,
136 OMPI_MPI_OFFSET_TYPE disp,
137 struct ompi_datatype_t *etype,
138 struct ompi_datatype_t *filetype,
139 const char *datarep,
140 struct opal_info_t *info);
141
142 int mca_io_ompio_file_get_view (struct ompi_file_t *fh,
143 OMPI_MPI_OFFSET_TYPE *disp,
144 struct ompi_datatype_t **etype,
145 struct ompi_datatype_t **filetype,
146 char *datarep);
147 int mca_io_ompio_file_open (struct ompi_communicator_t *comm,
148 const char *filename,
149 int amode,
150 struct opal_info_t *info,
151 struct ompi_file_t *fh);
152 int mca_io_ompio_file_close (struct ompi_file_t *fh);
153 int mca_io_ompio_file_set_size (struct ompi_file_t *fh,
154 OMPI_MPI_OFFSET_TYPE size);
155 int mca_io_ompio_file_preallocate (struct ompi_file_t *fh,
156 OMPI_MPI_OFFSET_TYPE size);
157 int mca_io_ompio_file_get_size (struct ompi_file_t *fh,
158 OMPI_MPI_OFFSET_TYPE * size);
159 int mca_io_ompio_file_get_amode (struct ompi_file_t *fh,
160 int *amode);
161 int mca_io_ompio_file_sync (struct ompi_file_t *fh);
162 int mca_io_ompio_file_seek (struct ompi_file_t *fh,
163 OMPI_MPI_OFFSET_TYPE offet,
164 int whence);
165
166 int mca_io_ompio_file_set_view (struct ompi_file_t *fh,
167 OMPI_MPI_OFFSET_TYPE disp,
168 struct ompi_datatype_t *etype,
169 struct ompi_datatype_t *filetype,
170 const char *datarep,
171 struct opal_info_t *info);
172 int mca_io_ompio_file_get_view (struct ompi_file_t *fh,
173 OMPI_MPI_OFFSET_TYPE *disp,
174 struct ompi_datatype_t **etype,
175 struct ompi_datatype_t **filetype,
176 char *datarep);
177
178
179 int mca_io_ompio_file_read_at (struct ompi_file_t *fh,
180 OMPI_MPI_OFFSET_TYPE offset,
181 void *buf,
182 int count,
183 struct ompi_datatype_t *datatype,
184 ompi_status_public_t *status);
185 int mca_io_ompio_file_read_at_all (struct ompi_file_t *fh,
186 OMPI_MPI_OFFSET_TYPE offset,
187 void *buf,
188 int count,
189 struct ompi_datatype_t *datatype,
190 ompi_status_public_t *status);
191 int mca_io_ompio_file_write_at (struct ompi_file_t *fh,
192 OMPI_MPI_OFFSET_TYPE offset,
193 const void *buf,
194 int count,
195 struct ompi_datatype_t *datatype,
196 ompi_status_public_t *status);
197 int mca_io_ompio_file_write_at_all (struct ompi_file_t *fh,
198 OMPI_MPI_OFFSET_TYPE offset,
199 const void *buf,
200 int count,
201 struct ompi_datatype_t *datatype,
202 ompi_status_public_t *status);
203 int mca_io_ompio_file_iread_at (struct ompi_file_t *fh,
204 OMPI_MPI_OFFSET_TYPE offset,
205 void *buf,
206 int count,
207 struct ompi_datatype_t *datatype,
208 ompi_request_t **request);
209 int mca_io_ompio_file_iwrite_at (struct ompi_file_t *fh,
210 OMPI_MPI_OFFSET_TYPE offset,
211 const void *buf,
212 int count,
213 struct ompi_datatype_t *datatype,
214 ompi_request_t **request);
215
216
217 int mca_io_ompio_file_read (struct ompi_file_t *fh,
218 void *buf,
219 int count,
220 struct ompi_datatype_t *datatype,
221 ompi_status_public_t *status);
222 int mca_io_ompio_file_read_all (struct ompi_file_t *fh,
223 void *buf,
224 int count,
225 struct ompi_datatype_t *datatype,
226 ompi_status_public_t *status);
227 int mca_io_ompio_file_iread_all (ompi_file_t *fh,
228 void *buf,
229 int count,
230 struct ompi_datatype_t *datatype,
231 ompi_request_t **request);
232 int mca_io_ompio_file_iread_at_all (ompi_file_t *fh,
233 OMPI_MPI_OFFSET_TYPE offset,
234 void *buf,
235 int count,
236 struct ompi_datatype_t *datatype,
237 ompi_request_t **request);
238
239 int mca_io_ompio_file_write (struct ompi_file_t *fh,
240 const void *buf,
241 int count,
242 struct ompi_datatype_t *datatype,
243 ompi_status_public_t *status);
244 int mca_io_ompio_file_write_all (struct ompi_file_t *fh,
245 const void *buf,
246 int count,
247 struct ompi_datatype_t *datatype,
248 ompi_status_public_t *status);
249 int mca_io_ompio_file_iwrite_all (ompi_file_t *fh,
250 const void *buf,
251 int count,
252 struct ompi_datatype_t *datatype,
253 ompi_request_t **request);
254 int mca_io_ompio_file_iwrite_at_all (ompi_file_t *fh,
255 OMPI_MPI_OFFSET_TYPE offset,
256 const void *buf,
257 int count,
258 struct ompi_datatype_t *datatype,
259 ompi_request_t **request);
260 int mca_io_ompio_file_iread (struct ompi_file_t *fh,
261 void *buf,
262 int count,
263 struct ompi_datatype_t *datatype,
264 ompi_request_t **request);
265 int mca_io_ompio_file_iwrite (struct ompi_file_t *fh,
266 const void *buf,
267 int count,
268 struct ompi_datatype_t *datatype,
269 ompi_request_t **request);
270 int mca_io_ompio_file_seek (struct ompi_file_t *fh,
271 OMPI_MPI_OFFSET_TYPE offset,
272 int whence);
273 int mca_io_ompio_file_get_position (struct ompi_file_t *fh,
274 OMPI_MPI_OFFSET_TYPE *offset);
275 int mca_io_ompio_file_get_byte_offset (struct ompi_file_t *fh,
276 OMPI_MPI_OFFSET_TYPE offset,
277 OMPI_MPI_OFFSET_TYPE *disp);
278
279
280 int mca_io_ompio_file_read_shared (struct ompi_file_t *fh,
281 void *buf,
282 int count,
283 struct ompi_datatype_t *datatype,
284 ompi_status_public_t *status);
285 int mca_io_ompio_file_write_shared (struct ompi_file_t *fh,
286 const void *buf,
287 int count,
288 struct ompi_datatype_t *datatype,
289 ompi_status_public_t *status);
290 int mca_io_ompio_file_iread_shared (struct ompi_file_t *fh,
291 void *buf,
292 int count,
293 struct ompi_datatype_t *datatype,
294 ompi_request_t **request);
295 int mca_io_ompio_file_iwrite_shared (struct ompi_file_t *fh,
296 const void *buf,
297 int count,
298 struct ompi_datatype_t *datatype,
299 ompi_request_t **request);
300 int mca_io_ompio_file_read_ordered (struct ompi_file_t *fh,
301 void *buf,
302 int count,
303 struct ompi_datatype_t *datatype,
304 ompi_status_public_t *status);
305 int mca_io_ompio_file_write_ordered (struct ompi_file_t *fh,
306 const void *buf,
307 int count,
308 struct ompi_datatype_t *datatype,
309 ompi_status_public_t *status);
310 int mca_io_ompio_file_seek_shared (struct ompi_file_t *fh,
311 OMPI_MPI_OFFSET_TYPE offset,
312 int whence);
313 int mca_io_ompio_file_get_position_shared (struct ompi_file_t *fh,
314 OMPI_MPI_OFFSET_TYPE *offset);
315
316
317 int mca_io_ompio_file_read_at_all_begin (struct ompi_file_t *fh,
318 OMPI_MPI_OFFSET_TYPE offset,
319 void *buf,
320 int count,
321 struct ompi_datatype_t *datatype);
322 int mca_io_ompio_file_read_at_all_end (struct ompi_file_t *fh,
323 void *buf,
324 ompi_status_public_t *status);
325 int mca_io_ompio_file_write_at_all_begin (struct ompi_file_t *fh,
326 OMPI_MPI_OFFSET_TYPE offset,
327 const void *buf,
328 int count,
329 struct ompi_datatype_t *datatype);
330 int mca_io_ompio_file_write_at_all_end (struct ompi_file_t *fh,
331 const void *buf,
332 ompi_status_public_t *status);
333 int mca_io_ompio_file_read_all_begin (struct ompi_file_t *fh,
334 void *buf,
335 int count,
336 struct ompi_datatype_t *datatype);
337 int mca_io_ompio_file_read_all_end (struct ompi_file_t *fh,
338 void *buf,
339 ompi_status_public_t *status);
340 int mca_io_ompio_file_write_all_begin (struct ompi_file_t *fh,
341 const void *buf,
342 int count,
343 struct ompi_datatype_t *datatype);
344 int mca_io_ompio_file_write_all_end (struct ompi_file_t *fh,
345 const void *buf,
346 ompi_status_public_t *status);
347 int mca_io_ompio_file_read_ordered_begin (struct ompi_file_t *fh,
348 void *buf,
349 int count,
350 struct ompi_datatype_t *datatype);
351 int mca_io_ompio_file_read_ordered_end (struct ompi_file_t *fh,
352 void *buf,
353 ompi_status_public_t *status);
354 int mca_io_ompio_file_write_ordered_begin (struct ompi_file_t *fh,
355 const void *buf,
356 int count,
357 struct ompi_datatype_t *datatype);
358 int mca_io_ompio_file_write_ordered_end (struct ompi_file_t *fh,
359 const void *buf,
360 struct ompi_status_public_t *status);
361
362
363 int mca_io_ompio_file_get_type_extent (struct ompi_file_t *fh,
364 struct ompi_datatype_t *datatype,
365 MPI_Aint *extent);
366
367
368 int mca_io_ompio_file_set_atomicity (struct ompi_file_t *fh,
369 int flag);
370 int mca_io_ompio_file_get_atomicity (struct ompi_file_t *fh,
371 int *flag);
372 int mca_io_ompio_file_sync (struct ompi_file_t *fh);
373
374
375
376
377
378
379
380 END_C_DECLS
381
382 #endif