15 #if defined(__cplusplus)
23 #if defined(__cplusplus)
28 #include "pio_config.h"
44 #if PIO_USE_MICRO_TIMING
45 #define PIO_MICRO_TIMING 1
47 #if PIO_ENABLE_IO_STATS
48 #define SPIO_IO_STATS 1
54 #include <netcdf_par.h>
62 #include <sys/types.h>
68 #define MAX_ADIOS_BUFFER_COUNT (PIO_MAX_CACHED_STEPS_FOR_ADIOS + 16)
69 #define BLOCK_MAX_BUFFER ((unsigned long)INT_MAX)
71 #define BLOCK_COUNT_THRESHOLD ((unsigned long)(1024 * 1024 * 1024 * 1.9))
72 #define BLOCK_METADATA_SIZE 70
87 #define PIO_IODESC_START_ID 512
88 #define PIO_IODESC_MAX_IDS 65536
91 #define PIO_MAX_VARS_UB 8192
92 #if NC_MAX_VARS > PIO_MAX_VARS_UB
93 #define PIO_MAX_VARS PIO_MAX_VARS_UB
95 #define PIO_MAX_VARS NC_MAX_VARS
99 #define PIO_MAX_DIMS_UB 1024
100 #if NC_MAX_DIMS > PIO_MAX_DIMS_UB
101 #define PIO_MAX_DIMS PIO_MAX_DIMS_UB
103 #define PIO_MAX_DIMS NC_MAX_DIMS
107 #define PIO_MAX_ATTRS_UB 8192
108 #if NC_MAX_ATTRS > PIO_MAX_ATTRS_UB
109 #define PIO_MAX_ATTRS PIO_MAX_ATTRS_UB
111 #define PIO_MAX_ATTRS NC_MAX_ATTRS
116 #define PIO_DEFAULT (-1)
121 #define DECOMP_VERSION_ATT_NAME "version"
124 #define DECOMP_MAX_MAPLEN_ATT_NAME "max_maplen"
127 #define DECOMP_TITLE_ATT_NAME "title"
130 #define DECOMP_HISTORY_ATT_NAME "history"
133 #define DECOMP_SOURCE_ATT_NAME "source"
136 #define DECOMP_ORDER_ATT_NAME "array_order"
139 #define DECOMP_BACKTRACE_ATT_NAME "backtrace"
142 #define DECOMP_DIM_DIM "dims"
145 #define DECOMP_TASK_DIM_NAME "task"
148 #define DECOMP_MAPELEM_DIM_NAME "map_element"
150 #define DECOMP_NDIMS "ndims"
153 #define DECOMP_GLOBAL_SIZE_VAR_NAME "global_size"
157 #define DECOMP_MAPLEN_VAR_NAME "maplen"
160 #define DECOMP_MAP_VAR_NAME "map"
164 #define DECOMP_C_ORDER_STR "C"
168 #define DECOMP_FORTRAN_ORDER_STR "Fortran"
170 #if defined( _PNETCDF) || defined(_NETCDF)
172 #define PIO_GLOBAL NC_GLOBAL
173 #define PIO_UNLIMITED NC_UNLIMITED
176 #define PIO_NAT NC_NAT
177 #define PIO_BYTE NC_BYTE
178 #define PIO_CHAR NC_CHAR
179 #define PIO_SHORT NC_SHORT
180 #define PIO_INT NC_INT
181 #define PIO_FLOAT NC_FLOAT
182 #define PIO_REAL NC_FLOAT
183 #define PIO_DOUBLE NC_DOUBLE
184 #define PIO_UBYTE NC_UBYTE
185 #define PIO_USHORT NC_USHORT
186 #define PIO_UINT NC_UINT
187 #define PIO_INT64 NC_INT64
188 #define PIO_UINT64 NC_UINT64
189 #define PIO_STRING NC_STRING
192 #define PIO_WRITE NC_WRITE
193 #define PIO_NOWRITE NC_NOWRITE
194 #define PIO_CLOBBER NC_CLOBBER
195 #define PIO_NOCLOBBER NC_NOCLOBBER
196 #define PIO_FILL NC_FILL
197 #define PIO_NOFILL NC_NOFILL
198 #define PIO_MAX_NAME_UB 1024
199 #if NC_MAX_NAME > PIO_MAX_NAME_UB
200 #define PIO_MAX_NAME PIO_MAX_NAME_UB
202 #define PIO_MAX_NAME NC_MAX_NAME
204 #define PIO_MAX_VAR_DIMS_UB 1024
205 #if NC_MAX_VAR_DIMS > PIO_MAX_VAR_DIMS_UB
206 #define PIO_MAX_VAR_DIMS PIO_MAX_VAR_DIMS_UB
208 #define PIO_MAX_VAR_DIMS NC_MAX_VAR_DIMS
210 #define PIO_64BIT_OFFSET NC_64BIT_OFFSET
211 #define PIO_64BIT_DATA NC_64BIT_DATA
214 #define PIO_NOERR NC_NOERR
215 #define PIO_EBADID NC_EBADID
216 #define PIO_ENFILE NC_ENFILE
217 #define PIO_EEXIST NC_EEXIST
218 #define PIO_EINVAL NC_EINVAL
219 #define PIO_EPERM NC_EPERM
220 #define PIO_ENOTINDEFINE NC_ENOTINDEFINE
221 #define PIO_EINDEFINE NC_EINDEFINE
222 #define PIO_EINVALCOORDS NC_EINVALCOORDS
223 #define PIO_EMAXDIMS NC_EMAXDIMS
224 #define PIO_ENAMEINUSE NC_ENAMEINUSE
225 #define PIO_ENOTATT NC_ENOTATT
226 #define PIO_EMAXATTS NC_EMAXATTS
227 #define PIO_EBADTYPE NC_EBADTYPE
228 #define PIO_EBADDIM NC_EBADDIM
229 #define PIO_EUNLIMPOS NC_EUNLIMPOS
230 #define PIO_EMAXVARS NC_EMAXVARS
231 #define PIO_ENOTVAR NC_ENOTVAR
232 #define PIO_EGLOBAL NC_EGLOBAL
233 #define PIO_ENOTNC NC_ENOTNC
234 #define PIO_ESTS NC_ESTS
235 #define PIO_EMAXNAME NC_EMAXNAME
236 #define PIO_EUNLIMIT NC_EUNLIMIT
237 #define PIO_ENORECVARS NC_ENORECVARS
238 #define PIO_ECHAR NC_ECHAR
239 #define PIO_EEDGE NC_EEDGE
240 #define PIO_ESTRIDE NC_ESTRIDE
241 #define PIO_EBADNAME NC_EBADNAME
242 #define PIO_ERANGE NC_ERANGE
243 #define PIO_ENOMEM NC_ENOMEM
244 #define PIO_EVARSIZE NC_EVARSIZE
245 #define PIO_EDIMSIZE NC_EDIMSIZE
246 #define PIO_ETRUNC NC_ETRUNC
247 #define PIO_EAXISTYPE NC_EAXISTYPE
248 #define PIO_EDAP NC_EDAP
249 #define PIO_ECURL NC_ECURL
250 #define PIO_EIO NC_EIO
251 #define PIO_ENODATA NC_ENODATA
252 #define PIO_EDAPSVC NC_EDAPSVC
253 #define PIO_EDAS NC_EDAS
254 #define PIO_EDDS NC_EDDS
255 #define PIO_EDATADDS NC_EDATADDS
256 #define PIO_EDAPURL NC_EDAPURL
257 #define PIO_EDAPCONSTRAINT NC_EDAPCONSTRAINT
258 #define PIO_ETRANSLATION NC_ETRANSLATION
259 #define PIO_EHDFERR NC_EHDFERR
260 #define PIO_ECANTREAD NC_ECANTREAD
261 #define PIO_ECANTWRITE NC_ECANTWRITE
262 #define PIO_ECANTCREATE NC_ECANTCREATE
263 #define PIO_EFILEMETA NC_EFILEMETA
264 #define PIO_EDIMMETA NC_EDIMMETA
265 #define PIO_EATTMETA NC_EATTMETA
266 #define PIO_EVARMETA NC_EVARMETA
267 #define PIO_ENOCOMPOUND NC_ENOCOMPOUND
268 #define PIO_EATTEXISTS NC_EATTEXISTS
269 #define PIO_ENOTNC4 NC_ENOTNC4
270 #define PIO_ESTRICTNC3 NC_ESTRICTNC3
271 #define PIO_ENOTNC3 NC_ENOTNC3
272 #define PIO_ENOPAR NC_ENOPAR
273 #define PIO_EPARINIT NC_EPARINIT
274 #define PIO_EBADGRPID NC_EBADGRPID
275 #define PIO_EBADTYPID NC_EBADTYPID
276 #define PIO_ETYPDEFINED NC_ETYPDEFINED
277 #define PIO_EBADFIELD NC_EBADFIELD
278 #define PIO_EBADCLASS NC_EBADCLASS
279 #define PIO_EMAPTYPE NC_EMAPTYPE
280 #define PIO_ELATEFILL NC_ELATEFILL
281 #define PIO_ELATEDEF NC_ELATEDEF
282 #define PIO_EDIMSCALE NC_EDIMSCALE
283 #define PIO_ENOGRP NC_ENOGRP
284 #define PIO_ESTORAGE NC_ESTORAGE
285 #define PIO_EBADCHUNK NC_EBADCHUNK
286 #define PIO_ENOTBUILT NC_ENOTBUILT
287 #define PIO_EDISKLESS NC_EDISKLESS
290 #define PIO_FILL_BYTE NC_FILL_BYTE
291 #define PIO_FILL_CHAR NC_FILL_CHAR
292 #define PIO_FILL_SHORT NC_FILL_SHORT
293 #define PIO_FILL_INT NC_FILL_INT
294 #define PIO_FILL_FLOAT NC_FILL_FLOAT
295 #define PIO_FILL_DOUBLE NC_FILL_DOUBLE
296 #define PIO_FILL_UBYTE NC_FILL_UBYTE
297 #define PIO_FILL_USHORT NC_FILL_USHORT
298 #define PIO_FILL_UINT NC_FILL_UINT
299 #define PIO_FILL_INT64 NC_FILL_INT64
300 #define PIO_FILL_UINT64 NC_FILL_UINT64
305 #define PIO_EINDEP NC_EINDEP
306 #define PIO_REQ_NULL NC_REQ_NULL
308 #define PIO_EINDEP (-203)
309 #define PIO_REQ_NULL (-1)
313 #define PIO_FIRST_ERROR_CODE (-500)
314 #define PIO_EBADIOTYPE (-500)
315 #define PIO_EINTERNAL (-501)
319 #define PIO_EADIOSREAD (-300)
320 #define PIO_EADIOS2ERR (-301)
325 #define PIO_EHDF5ERR (-700)
361 #define PIO_REARR_COMM_UNLIMITED_PEND_REQ -1
PIO_OFFSET_C_TYPENAME PIO_Offset
Definition: pio.h:82
struct rearr_opt rearr_opt_t
Rearranger options.
struct rearr_comm_fc_opt rearr_comm_fc_opt_t
Rearranger comm flow control options.
PIO_REARR_COMM_FC_DIR
Rearranger comm flow control direction.
Definition: pio.h:346
@ PIO_REARR_COMM_FC_2D_DISABLE
Disable flow control.
Definition: pio.h:357
@ PIO_REARR_COMM_FC_1D_IO2COMP
IO procs to comp procs only.
Definition: pio.h:354
@ PIO_REARR_COMM_FC_1D_COMP2IO
Comp procs to io procs only.
Definition: pio.h:351
@ PIO_REARR_COMM_FC_2D_ENABLE
Comp procs to io procs and vice versa.
Definition: pio.h:348
PIO_ERROR_HANDLERS
These are the supported error handlers.
Definition: pio.h:459
@ PIO_INTERNAL_ERROR
Errors cause abort.
Definition: pio.h:461
@ PIO_REDUCE_ERROR
Error codes are reduced across all processes.
Definition: pio.h:468
@ PIO_RETURN_ERROR
Errors are returned to caller with no internal action.
Definition: pio.h:471
@ PIO_BCAST_ERROR
Error codes from io process with rank 0 is broadcasted to all processes.
Definition: pio.h:465
PIO_IOTYPE
These are the supported methods of reading/writing input/output files.
Definition: pio.h:408
@ PIO_IOTYPE_NETCDF4P_NCZARR
NetCDF library (Parallel I/O, NCZarr file format)
Definition: pio.h:422
@ PIO_IOTYPE_NETCDF4P
NetCDF library (Parallel I/O, NetCDF4/HDF5 file format)
Definition: pio.h:419
@ PIO_IOTYPE_HDF5
HDF5 library (Parallel I/O, NetCDF4/HDF5 file format)
Definition: pio.h:431
@ PIO_IOTYPE_NETCDF4C
NetCDF library (Serial I/O, NetCDF4/HDF5 compressed file format)
Definition: pio.h:416
@ PIO_IOTYPE_HDF5C
HDF5 library (Parallel I/O, NetCDF4/HDF5 compressed file format)
Definition: pio.h:434
@ PIO_IOTYPE_ADIOS
ADIOS library (Parallel I/O, ADIOS BP file format)
Definition: pio.h:425
@ PIO_IOTYPE_ADIOSC
ADIOS library (Parallel I/O, ADIOS BP compressed file format)
Definition: pio.h:428
@ PIO_IOTYPE_NETCDF
NetCDF library (Serial I/O, NetCDF3 classic file format)
Definition: pio.h:413
@ PIO_IOTYPE_PNETCDF
Parallel NetCDF library (Parallel I/O, NetCDF3 classic file format)
Definition: pio.h:410
PIO_REARRANGERS
These are the supported output data rearrangement methods.
Definition: pio.h:441
@ PIO_REARR_CONTIG
Contig rearranger (data aggregation + contiguous data)
Definition: pio.h:452
@ PIO_REARR_BOX
Box rearranger.
Definition: pio.h:443
@ PIO_REARR_SUBSET
Subset rearranger.
Definition: pio.h:446
@ PIO_REARR_ANY
Let the library choose the rearranger.
Definition: pio.h:449
PIO_REARR_COMM_TYPE
Rearranger comm type.
Definition: pio.h:333
@ PIO_REARR_COMM_COLL
Collective.
Definition: pio.h:338
@ PIO_REARR_COMM_P2P
Point to point.
Definition: pio.h:335
Rearranger comm flow control options.
Definition: pio.h:367
bool isend
Enable isends - if false use blocking sends.
Definition: pio.h:372
bool hs
Enable handshake.
Definition: pio.h:369
int max_pend_req
Max pending requests (PIO_REARR_COMM_UNLIMITED_PEND_REQ => unlimited pend req).
Definition: pio.h:380
Rearranger options.
Definition: pio.h:387
int comm_type
Comm type - see PIO_REARR_COMM_TYPE.
Definition: pio.h:389
int fcd
Comm flow control dir - see PIO_REARR_COMM_FC_DIR.
Definition: pio.h:392
rearr_comm_fc_opt_t io2comp
flow control opts, io to comp procs
Definition: pio.h:398
rearr_comm_fc_opt_t comp2io
flow control opts, comp to io procs
Definition: pio.h:395