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 (c) 2015-2017 Research Organization for Information Science
14  *                         and Technology (RIST). All rights reserved.
15  * Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
16  * $COPYRIGHT$
17  *
18  * Additional copyrights may follow
19  *
20  * $HEADER$
21  */
22 
23 #ifndef MCA_IO_ROMIO321_H
24 #define MCA_IO_ROMIO321_H
25 
26 #include "ompi_config.h"
27 #include "opal/threads/mutex.h"
28 #include "ompi/request/request.h"
29 #include "ompi/file/file.h"
30 #include "ompi/mca/io/io.h"
31 #include "romio/adio/include/romioconf.h"
32 #include "romio/include/mpio.h"
33 
34 
35 BEGIN_C_DECLS
36 
37 OMPI_DECLSPEC extern mca_io_base_component_2_0_0_t mca_io_romio321_component;
38 
39 /*
40  * global variables, instantiated in module.c
41  */
42 extern opal_mutex_t mca_io_romio321_mutex;
43 extern mca_io_base_module_2_0_0_t mca_io_romio321_module;
44 OMPI_DECLSPEC extern mca_io_base_component_2_0_0_t mca_io_romio321_component;
45 
46 /*
47  * Private data for ROMIO modules
48  */
49 struct mca_io_romio321_data_t {
50     ROMIO_PREFIX (MPI_File) romio_fh;
51 };
52 typedef struct mca_io_romio321_data_t mca_io_romio321_data_t;
53 
54 
55 /*
56  * Module functions
57  */
58 
59 
60 /*
61  *  mca->ROMIO module routines:
62  *    ROMIO_PREFIX(file_XXX)
63  *  ROMIO operations names:
64  *    ROMIO_PREFIX(MPI_File_XXX)
65  */
66 /* Section 9.2 */
67 int mca_io_romio321_file_open (struct ompi_communicator_t *comm,
68                             const char *filename,
69                             int amode,
70                             struct opal_info_t *info,
71                             ompi_file_t *fh);
72 int mca_io_romio321_file_close (struct ompi_file_t *fh);
73 int mca_io_romio321_file_delete (const char *filename,
74                               struct opal_info_t *info);
75 int mca_io_romio321_file_set_size (struct ompi_file_t *fh,
76                                 MPI_Offset size);
77 int mca_io_romio321_file_preallocate (struct ompi_file_t *fh,
78                                    MPI_Offset size);
79 int mca_io_romio321_file_get_size (struct ompi_file_t *fh,
80                                 MPI_Offset * size);
81 int mca_io_romio321_file_get_amode (struct ompi_file_t *fh,
82                                  int *amode);
83 int mca_io_romio321_file_set_info (struct ompi_file_t *fh,
84                                 struct opal_info_t *info);
85 int mca_io_romio321_file_get_info (struct ompi_file_t *fh,
86                                 struct opal_info_t ** info_used);
87 
88 /* Section 9.3 */
89 int mca_io_romio321_file_set_view (struct ompi_file_t *fh,
90                                 MPI_Offset disp,
91                                 struct ompi_datatype_t *etype,
92                                 struct ompi_datatype_t *filetype,
93                                 const char *datarep,
94                                 struct opal_info_t *info);
95 int mca_io_romio321_file_get_view (struct ompi_file_t *fh,
96                                 MPI_Offset * disp,
97                                 struct ompi_datatype_t ** etype,
98                                 struct ompi_datatype_t ** filetype,
99                                 char *datarep);
100 
101 /* Section 9.4.2 */
102 int mca_io_romio321_file_read_at (struct ompi_file_t *fh,
103                                MPI_Offset offset,
104                                void *buf,
105                                int count,
106                                struct ompi_datatype_t *datatype,
107                                ompi_status_public_t * status);
108 int mca_io_romio321_file_read_at_all (struct ompi_file_t *fh,
109                                    MPI_Offset offset,
110                                    void *buf,
111                                    int count,
112                                    struct ompi_datatype_t *datatype,
113                                    ompi_status_public_t * status);
114 int mca_io_romio321_file_write_at (struct ompi_file_t *fh,
115                                 MPI_Offset offset,
116                                 const void *buf,
117                                 int count,
118                                 struct ompi_datatype_t *datatype,
119                                 ompi_status_public_t * status);
120 int mca_io_romio321_file_write_at_all (struct ompi_file_t *fh,
121                                     MPI_Offset offset,
122                                     const void *buf,
123                                     int count,
124                                     struct ompi_datatype_t *datatype,
125                                     ompi_status_public_t * status);
126 int mca_io_romio321_file_iread_at (struct ompi_file_t *fh,
127                                 MPI_Offset offset,
128                                 void *buf,
129                                 int count,
130                                 struct ompi_datatype_t *datatype,
131                                 ompi_request_t **request);
132 int mca_io_romio321_file_iread_at_all (struct ompi_file_t *fh,
133                                        MPI_Offset offset,
134                                        void *buf,
135                                        int count,
136                                        struct ompi_datatype_t *datatype,
137                                        ompi_request_t **request);
138 int mca_io_romio321_file_iwrite_at (struct ompi_file_t *fh,
139                                  MPI_Offset offset,
140                                  const void *buf,
141                                  int count,
142                                  struct ompi_datatype_t *datatype,
143                                  ompi_request_t **request);
144 int mca_io_romio321_file_iwrite_at_all (struct ompi_file_t *fh,
145                                         MPI_Offset offset,
146                                         const void *buf,
147                                         int count,
148                                         struct ompi_datatype_t *datatype,
149                                         ompi_request_t **request);
150 
151 /* Section 9.4.3 */
152 int mca_io_romio321_file_read (struct ompi_file_t *fh,
153                             void *buf,
154                             int count,
155                             struct ompi_datatype_t *datatype,
156                             ompi_status_public_t * status);
157 int mca_io_romio321_file_read_all (struct ompi_file_t *fh,
158                                 void *buf,
159                                 int count,
160                                 struct ompi_datatype_t *datatype,
161                                 ompi_status_public_t * status);
162 int mca_io_romio321_file_write (struct ompi_file_t *fh,
163                              const void *buf,
164                              int count,
165                              struct ompi_datatype_t *datatype,
166                              ompi_status_public_t * status);
167 int mca_io_romio321_file_write_all (struct ompi_file_t *fh,
168                                  const void *buf,
169                                  int count,
170                                  struct ompi_datatype_t *datatype,
171                                  ompi_status_public_t * status);
172 int mca_io_romio321_file_iread (struct ompi_file_t *fh,
173                              void *buf,
174                              int count,
175                              struct ompi_datatype_t *datatype,
176                              ompi_request_t **request);
177 int mca_io_romio321_file_iread_all (struct ompi_file_t *fh,
178                                     void *buf,
179                                     int count,
180                                     struct ompi_datatype_t *datatype,
181                                     ompi_request_t **request);
182 int mca_io_romio321_file_iwrite (struct ompi_file_t *fh,
183                               const void *buf,
184                               int count,
185                               struct ompi_datatype_t *datatype,
186                               ompi_request_t **request);
187 int mca_io_romio321_file_iwrite_all (struct ompi_file_t *fh,
188                                      const void *buf,
189                                      int count,
190                                      struct ompi_datatype_t *datatype,
191                                      ompi_request_t **request);
192 int mca_io_romio321_file_seek (struct ompi_file_t *fh,
193                             MPI_Offset offset,
194                             int whence);
195 int mca_io_romio321_file_get_position (struct ompi_file_t *fh,
196                                     MPI_Offset * offset);
197 int mca_io_romio321_file_get_byte_offset (struct ompi_file_t *fh,
198                                        MPI_Offset offset,
199                                        MPI_Offset * disp);
200 
201 /* Section 9.4.4 */
202 int mca_io_romio321_file_read_shared (struct ompi_file_t *fh,
203                                    void *buf,
204                                    int count,
205                                    struct ompi_datatype_t *datatype,
206                                    ompi_status_public_t * status);
207 int mca_io_romio321_file_write_shared (struct ompi_file_t *fh,
208                                     const void *buf,
209                                     int count,
210                                     struct ompi_datatype_t *datatype,
211                                     ompi_status_public_t * status);
212 int mca_io_romio321_file_iread_shared (struct ompi_file_t *fh,
213                                     void *buf,
214                                     int count,
215                                     struct ompi_datatype_t *datatype,
216                                     ompi_request_t **request);
217 int mca_io_romio321_file_iwrite_shared (struct ompi_file_t *fh,
218                                      const void *buf,
219                                      int count,
220                                      struct ompi_datatype_t *datatype,
221                                      ompi_request_t **request);
222 int mca_io_romio321_file_read_ordered (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_romio321_file_write_ordered (struct ompi_file_t *fh,
228                                      const void *buf,
229                                      int count,
230                                      struct ompi_datatype_t *datatype,
231                                      ompi_status_public_t * status);
232 int mca_io_romio321_file_seek_shared (struct ompi_file_t *fh,
233                                    MPI_Offset offset,
234                                    int whence);
235 int mca_io_romio321_file_get_position_shared (struct ompi_file_t *fh,
236                                            MPI_Offset * offset);
237 
238 /* Section 9.4.5 */
239 int mca_io_romio321_file_read_at_all_begin (struct ompi_file_t *fh,
240                                          MPI_Offset offset,
241                                          void *buf,
242                                          int count,
243                                          struct ompi_datatype_t *datatype);
244 int mca_io_romio321_file_read_at_all_end (struct ompi_file_t *fh,
245                                        void *buf,
246                                        ompi_status_public_t * status);
247 int mca_io_romio321_file_write_at_all_begin (struct ompi_file_t *fh,
248                                           MPI_Offset offset,
249                                           const void *buf,
250                                           int count,
251                                           struct ompi_datatype_t *datatype);
252 int mca_io_romio321_file_write_at_all_end (struct ompi_file_t *fh,
253                                         const void *buf,
254                                         ompi_status_public_t * status);
255 int mca_io_romio321_file_read_all_begin (struct ompi_file_t *fh,
256                                       void *buf,
257                                       int count,
258                                       struct ompi_datatype_t *datatype);
259 int mca_io_romio321_file_read_all_end (struct ompi_file_t *fh,
260                                     void *buf,
261                                     ompi_status_public_t * status);
262 int mca_io_romio321_file_write_all_begin (struct ompi_file_t *fh,
263                                        const void *buf,
264                                        int count,
265                                        struct ompi_datatype_t *datatype);
266 int mca_io_romio321_file_write_all_end (struct ompi_file_t *fh,
267                                      const void *buf,
268                                      ompi_status_public_t * status);
269 int mca_io_romio321_file_read_ordered_begin (struct ompi_file_t *fh,
270                                           void *buf,
271                                           int count,
272                                           struct ompi_datatype_t *datatype);
273 int mca_io_romio321_file_read_ordered_end (struct ompi_file_t *fh,
274                                         void *buf,
275                                         ompi_status_public_t * status);
276 int mca_io_romio321_file_write_ordered_begin (struct ompi_file_t *fh,
277                                            const void *buf,
278                                            int count,
279                                            struct ompi_datatype_t *datatype);
280 int mca_io_romio321_file_write_ordered_end (struct ompi_file_t *fh,
281                                          const void *buf,
282                                          struct ompi_status_public_t * status);
283 
284 /* Section 9.5.1 */
285 int mca_io_romio321_file_get_type_extent (struct ompi_file_t *fh,
286                                        struct ompi_datatype_t *datatype,
287                                        MPI_Aint * extent);
288 
289 /* Section 9.6.1 */
290 int mca_io_romio321_file_set_atomicity (struct ompi_file_t *fh,
291                                      int flag);
292 int mca_io_romio321_file_get_atomicity (struct ompi_file_t *fh,
293                                      int *flag);
294 int mca_io_romio321_file_sync (struct ompi_file_t *fh);
295 
296 /* End Prototypes */
297 
298 END_C_DECLS
299 #endif /* MCA_IO_ROMIO321_H */
300