NewMadeleine

Documentation

nm_mpi_io.h
Go to the documentation of this file.
1/*
2 * NewMadeleine
3 * Copyright (C) 2015-2024 (see AUTHORS file)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 */
15
16
17#ifndef NM_MPI_IO_H
18#define NM_MPI_IO_H
19
31typedef int MPI_File;
32#define MPI_FILE_NULL ((MPI_File)0)
33#define _NM_MPI_FILE_OFFSET 1
34
36typedef int64_t nm_mpi_offset_t;
39typedef void (MPI_File_errhandler_function)(MPI_File*, int*, ...);
44#define MPI_MODE_RDONLY 0x0001
45#define MPI_MODE_RDWR 0x0002
46#define MPI_MODE_WRONLY 0x0004
47#define MPI_MODE_CREATE 0x0008
48#define MPI_MODE_EXCL 0x0010
49#define MPI_MODE_APPEND 0x0020
50#define MPI_MODE_DELETE_ON_CLOSE 0x0100
51#define MPI_MODE_UNIQUE_OPEN 0x0200
52#define MPI_MODE_SEQUENTIAL 0x0400
57#define MPI_SEEK_SET 0x0001
58#define MPI_SEEK_CUR 0x0002
59#define MPI_SEEK_END 0x0004
62#define MPI_MAX_DATAREP_STRING 256
63typedef int MPI_Datarep_extent_function(MPI_Datatype datatype, MPI_Aint*file_extent, void*extra_state);
64typedef int MPI_Datarep_conversion_function(void*userbuf,
65 MPI_Datatype datatype, int count, void*filebuf,
66 MPI_Offset position, void*extra_state);
67#define MPI_CONVERSION_FN_NULL NULL
68
69int MPI_File_open(MPI_Comm comm, const char*filename, int amode, MPI_Info info, MPI_File*fh);
71int MPI_File_delete(const char*filename, MPI_Info info);
73int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence);
81int MPI_File_get_amode(MPI_File fh, int*amode);
88int MPI_File_call_errhandler(MPI_File file, int errorcode);
91
92int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, const char*datarep, MPI_Info info);
93int MPI_File_get_view(MPI_File fh, MPI_Offset*disp, MPI_Datatype*etype, MPI_Datatype *filetype, char *datarep);
94
95int MPI_File_read(MPI_File fh, void*buf, int count, MPI_Datatype datatype, MPI_Status*status);
96int MPI_File_write(MPI_File fh, const void*buf, int count, MPI_Datatype datatype, MPI_Status*status);
97
98int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void*buf, int count, MPI_Datatype datatype, MPI_Status*status);
99int MPI_File_write_at(MPI_File fh, MPI_Offset offset, const void*buf, int count, MPI_Datatype datatype, MPI_Status*status);
100
102int MPI_File_write_all(MPI_File fh, const void*buf, int count, MPI_Datatype datatype, MPI_Status*status);
104int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void*buf, int count, MPI_Datatype datatype, MPI_Status*status);
105
106int MPI_File_read_all_begin(MPI_File fh, void*buf, int count, MPI_Datatype datatype);
108int MPI_File_write_all_begin(MPI_File fh, const void*buf, int count, MPI_Datatype datatype);
110
111int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void*buf, int count, MPI_Datatype datatype);
113int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, const void*buf, int count, MPI_Datatype datatype);
115
116/* not implemented, only stub is available */
117int MPI_Register_datarep(const char*datarep,
118 MPI_Datarep_conversion_function*read_conversion_fn,
119 MPI_Datarep_conversion_function*write_conversion_fn,
120 MPI_Datarep_extent_function*dtype_file_extent_fn,
121 void*extra_state);
122
123int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void*buf, int count, MPI_Datatype datatype, MPI_Request*request);
124int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void*buf, int count, MPI_Datatype datatype, MPI_Request*request);
125int MPI_File_iread(MPI_File fh, void*buf, int count, MPI_Datatype datatype, MPI_Request*request);
126int MPI_File_iwrite(MPI_File fh, const void*buf, int count, MPI_Datatype datatype, MPI_Request*request);
127
128int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence);
129int MPI_File_write_shared(MPI_File fh, const void*buf, int count, MPI_Datatype datatype, MPI_Status*status);
130int MPI_File_iwrite_shared(MPI_File fh, const void*buf, int count, MPI_Datatype datatype, MPI_Request*request);
132int MPI_File_iread_shared(MPI_File fh, void*buf, int count, MPI_Datatype datatype, MPI_Request*request);
133int MPI_File_write_ordered(MPI_File fh, const void*buf, int count, MPI_Datatype datatype, MPI_Status*status);
135int MPI_File_write_ordered_begin(MPI_File fh, const void*buf, int count, MPI_Datatype datatype);
139
140#ifndef NMAD_FORTRAN_TARGET_NONE
141
142MPI_File MPI_File_f2c(MPI_Fint file);
143MPI_Fint MPI_File_c2f(MPI_File file);
144
145#endif /* NMAD_FORTRAN_TARGET_NONE */
146
151#endif /* NM_MPI_IO_H */
void() MPI_File_errhandler_function(MPI_File *, int *,...)
Definition: nm_mpi_io.h:39
int MPI_File_get_info(MPI_File fh, MPI_Info *info)
int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype)
int MPI_File_get_position(MPI_File fh, MPI_Offset *offset)
int MPI_File_iread_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence)
int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler)
int MPI_File_write(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep)
MPI_File_errhandler_function MPI_File_errhandler_fn
pre MPI-2.2 compatibility type
Definition: nm_mpi_io.h:40
int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status)
int MPI_File_write_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype)
int MPI_Datarep_extent_function(MPI_Datatype datatype, MPI_Aint *file_extent, void *extra_state)
Definition: nm_mpi_io.h:63
int MPI_File_iwrite_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
int MPI_File_write_all_end(MPI_File fh, const void *buf, MPI_Status *status)
int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp)
int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype)
MPI_Fint MPI_File_c2f(MPI_File file)
int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype)
int MPI_File
File handle.
Definition: nm_mpi_io.h:31
int MPI_File_write_all_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype)
int MPI_File_get_atomicity(MPI_File fh, int *flag)
int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_get_size(MPI_File fh, MPI_Offset *size)
int MPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *fh)
int MPI_File_read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, const char *datarep, MPI_Info info)
int MPI_File_set_size(MPI_File fh, MPI_Offset size)
int MPI_Datarep_conversion_function(void *userbuf, MPI_Datatype datatype, int count, void *filebuf, MPI_Offset position, void *extra_state)
Definition: nm_mpi_io.h:64
int64_t nm_mpi_offset_t
internal type for IO offsets
Definition: nm_mpi_io.h:36
int MPI_File_write_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_write_ordered(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count, MPI_Datatype datatype)
int MPI_File_close(MPI_File *fh)
int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
int MPI_File_sync(MPI_File fh)
int MPI_File_iwrite(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_write_ordered_end(MPI_File fh, const void *buf, MPI_Status *status)
int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset)
int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence)
MPI_File MPI_File_f2c(MPI_Fint file)
int MPI_File_create_errhandler(MPI_File_errhandler_fn *function, MPI_Errhandler *errhandler)
int MPI_File_write_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_preallocate(MPI_File fh, MPI_Offset size)
int MPI_Register_datarep(const char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state)
int MPI_File_set_info(MPI_File fh, MPI_Info info)
int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status)
int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler)
nm_mpi_offset_t MPI_Offset
offsets for MPI-IO
Definition: nm_mpi_io.h:38
int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent)
int MPI_File_write_at_all_end(MPI_File fh, const void *buf, MPI_Status *status)
int MPI_File_delete(const char *filename, MPI_Info info)
int MPI_File_call_errhandler(MPI_File file, int errorcode)
int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status)
int MPI_File_get_group(MPI_File fh, MPI_Group *group)
int MPI_File_get_amode(MPI_File fh, int *amode)
int MPI_File_set_atomicity(MPI_File fh, int flag)
int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request)
void * extra_state
nm_mpi_count_t count
number of elements to be exchanged
nm_mpi_status_t status
status of request
Definition: nm_mpi_private.h:7
int MPI_Request
Request handle.
Definition: nm_mpi_types.h:214
int MPI_Errhandler
Definition: nm_mpi_types.h:497
int MPI_Group
Group handle.
Definition: nm_mpi_types.h:244
nm_mpi_aint_t MPI_Aint
type that holds an address
Definition: nm_mpi_types.h:167
int MPI_Comm
Communicator handle.
Definition: nm_mpi_types.h:268
int MPI_Info
An info opaque object.
Definition: nm_mpi_types.h:177
int MPI_Datatype
Datatype handle.
Definition: nm_mpi_types.h:305
nm_len_t size
size of the onsided data (not incuding target-side completion)
Status handle.
Definition: nm_mpi_types.h:194