ParallelIO
Classes | Macros | Typedefs | Enumerations | Functions
pio.h File Reference

Public headers for the PIO C interface. More...

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <mpi.h>

Go to the source code of this file.

Classes

struct  var_desc_t
 Variable description structure. More...
 
struct  io_region
 IO region structure. More...
 
struct  io_desc_t
 IO descriptor structure. More...
 
struct  iosystem_desc_t
 IO system descriptor structure. More...
 
struct  wmulti_buffer
 multi buffer. More...
 
struct  file_desc_t
 File descriptor structure. More...
 

Macros

#define MPI_OFFSET   MPI_LONG_LONG
 MPI_OFFSET is an integer type of size sufficient to represent the size (in bytes) of the largest file supported by MPI. More...
 
#define PIO_OFFSET   MPI_OFFSET
 PIO_OFFSET is an integer type of size sufficient to represent the size (in bytes) of the largest file supported by MPI. More...
 
#define PIO_Offset   MPI_Offset
 
#define PIO_MAX_VARS   NC_MAX_VARS
 The maximum number of variables allowed in a netCDF file. More...
 
#define PIO_EINDEP   (-203)
 Define the netCDF-based error codes. More...
 
#define PIO_EBADIOTYPE   -255
 Define error codes for PIO. More...
 
#define PIO_REQ_NULL   (NC_REQ_NULL-1)
 ???
 

Typedefs

typedef struct var_desc_t var_desc_t
 Variable description structure.
 
typedef struct io_region io_region
 IO region structure. More...
 
typedef struct io_desc_t io_desc_t
 IO descriptor structure. More...
 
typedef struct iosystem_desc_t iosystem_desc_t
 IO system descriptor structure. More...
 
typedef struct wmulti_buffer wmulti_buffer
 multi buffer.
 
typedef struct file_desc_t file_desc_t
 File descriptor structure. More...
 

Enumerations

enum  PIO_IOTYPE { PIO_IOTYPE_PNETCDF = 1, PIO_IOTYPE_NETCDF = 2, PIO_IOTYPE_NETCDF4C = 3, PIO_IOTYPE_NETCDF4P = 4 }
 These are the supported methods of reading/writing netCDF files. More...
 
enum  PIO_REARRANGERS { PIO_REARR_BOX = 1, PIO_REARR_SUBSET = 2 }
 These are the supported output data rearrangement methods. More...
 
enum  PIO_ERROR_HANDLERS { PIO_INTERNAL_ERROR = (-51), PIO_BCAST_ERROR = (-52), PIO_RETURN_ERROR = (-53) }
 These are the supported error handlers. More...
 

Functions

int PIOc_strerror (int pioerr, char *errstr)
 Return a string description of an error code. More...
 
int PIOc_freedecomp (int iosysid, int ioid)
 
int PIOc_inq_att (int ncid, int varid, const char *name, nc_type *xtypep, PIO_Offset *lenp)
 The PIO-C interface for the NetCDF function nc_inq_att. More...
 
int PIOc_inq_format (int ncid, int *formatp)
 The PIO-C interface for the NetCDF function nc_inq_format.
 
int PIOc_inq_varid (int ncid, const char *name, int *varidp)
 The PIO-C interface for the NetCDF function nc_inq_varid. More...
 
int PIOc_inq_varnatts (int ncid, int varid, int *nattsp)
 The PIO-C interface for the NetCDF function nc_inq_varnatts.
 
int PIOc_def_var (int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp)
 The PIO-C interface for the NetCDF function nc_def_var. More...
 
int PIOc_def_var_deflate (int ncid, int varid, int shuffle, int deflate, int deflate_level)
 Set deflate (zlib) settings for a variable. More...
 
int PIOc_inq_var_deflate (int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp)
 This function only applies to netCDF-4 files. More...
 
int PIOc_inq_var_szip (int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
 
int PIOc_def_var_chunking (int ncid, int varid, int storage, const PIO_Offset *chunksizesp)
 Set chunksizes for a variable. More...
 
int PIOc_inq_var_chunking (int ncid, int varid, int *storagep, PIO_Offset *chunksizesp)
 Inquire about chunksizes for a variable. More...
 
int PIOc_def_var_fill (int ncid, int varid, int no_fill, const void *fill_value)
 Set chunksizes for a variable. More...
 
int PIOc_inq_var_fill (int ncid, int varid, int *no_fill, void *fill_valuep)
 The PIO-C interface for the NetCDF function nc_inq_var_fill. More...
 
int PIOc_def_var_endian (int ncid, int varid, int endian)
 Set chunksizes for a variable. More...
 
int PIOc_inq_var_endian (int ncid, int varid, int *endianp)
 Inquire about chunksizes for a variable. More...
 
int PIOc_set_chunk_cache (int iosysid, int iotype, PIO_Offset size, PIO_Offset nelems, float preemption)
 Set chunk cache netCDF files to be opened/created. More...
 
int PIOc_get_chunk_cache (int iosysid, int iotype, PIO_Offset *sizep, PIO_Offset *nelemsp, float *preemptionp)
 Get current file chunk cache settings from HDF5. More...
 
int PIOc_set_var_chunk_cache (int ncid, int varid, PIO_Offset size, PIO_Offset nelems, float preemption)
 Set chunksizes for a variable. More...
 
int PIOc_get_var_chunk_cache (int ncid, int varid, PIO_Offset *sizep, PIO_Offset *nelemsp, float *preemptionp)
 Get the variable chunk cache settings. More...
 
int PIOc_inq_var (int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp)
 The PIO-C interface for the NetCDF function nc_inq_var. More...
 
int PIOc_inq_varname (int ncid, int varid, char *name)
 The PIO-C interface for the NetCDF function nc_inq_varname.
 
int PIOc_put_att_double (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const double *op)
 The PIO-C interface for the NetCDF function nc_put_att_double.
 
int PIOc_put_att_int (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const int *op)
 The PIO-C interface for the NetCDF function nc_put_att_int.
 
int PIOc_rename_att (int ncid, int varid, const char *name, const char *newname)
 The PIO-C interface for the NetCDF function nc_rename_att. More...
 
int PIOc_del_att (int ncid, int varid, const char *name)
 The PIO-C interface for the NetCDF function nc_del_att. More...
 
int PIOc_inq_natts (int ncid, int *ngattsp)
 The PIO-C interface for the NetCDF function nc_inq_natts.
 
int PIOc_inq (int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp)
 The PIO-C interface for the NetCDF function nc_inq. More...
 
int PIOc_get_att_text (int ncid, int varid, const char *name, char *ip)
 The PIO-C interface for the NetCDF function nc_get_att_text.
 
int PIOc_get_att_short (int ncid, int varid, const char *name, short *ip)
 The PIO-C interface for the NetCDF function nc_get_att_short.
 
int PIOc_put_att_long (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const long *op)
 The PIO-C interface for the NetCDF function nc_put_att_long.
 
int PIOc_redef (int ncid)
 The PIO-C interface for the NetCDF function nc_redef. More...
 
int PIOc_set_fill (int ncid, int fillmode, int *old_modep)
 The PIO-C interface for the NetCDF function nc_set_fill. More...
 
int PIOc_enddef (int ncid)
 The PIO-C interface for the NetCDF function nc_enddef. More...
 
int PIOc_rename_var (int ncid, int varid, const char *name)
 The PIO-C interface for the NetCDF function nc_rename_var. More...
 
int PIOc_put_att_short (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const short *op)
 The PIO-C interface for the NetCDF function nc_put_att_short.
 
int PIOc_put_att_text (int ncid, int varid, const char *name, PIO_Offset len, const char *op)
 The PIO-C interface for the NetCDF function nc_put_att_text.
 
int PIOc_inq_attname (int ncid, int varid, int attnum, char *name)
 The PIO-C interface for the NetCDF function nc_inq_attname. More...
 
int PIOc_get_att_ulonglong (int ncid, int varid, const char *name, unsigned long long *ip)
 The PIO-C interface for the NetCDF function nc_get_att_ulonglong.
 
int PIOc_get_att_ushort (int ncid, int varid, const char *name, unsigned short *ip)
 The PIO-C interface for the NetCDF function nc_get_att_ushort.
 
int PIOc_put_att_ulonglong (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned long long *op)
 The PIO-C interface for the NetCDF function nc_put_att_ulonglong.
 
int PIOc_inq_dimlen (int ncid, int dimid, PIO_Offset *lenp)
 The PIO-C interface for the NetCDF function nc_inq_dimlen.
 
int PIOc_get_att_uint (int ncid, int varid, const char *name, unsigned int *ip)
 The PIO-C interface for the NetCDF function nc_get_att_uint.
 
int PIOc_get_att_longlong (int ncid, int varid, const char *name, long long *ip)
 The PIO-C interface for the NetCDF function nc_get_att_longlong.
 
int PIOc_put_att_schar (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const signed char *op)
 The PIO-C interface for the NetCDF function nc_put_att_schar.
 
int PIOc_put_att_float (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const float *op)
 The PIO-C interface for the NetCDF function nc_put_att_float.
 
int PIOc_inq_nvars (int ncid, int *nvarsp)
 The PIO-C interface for the NetCDF function nc_inq_nvars.
 
int PIOc_rename_dim (int ncid, int dimid, const char *name)
 The PIO-C interface for the NetCDF function nc_rename_dim. More...
 
int PIOc_inq_varndims (int ncid, int varid, int *ndimsp)
 The PIO-C interface for the NetCDF function nc_inq_varndims.
 
int PIOc_get_att_long (int ncid, int varid, const char *name, long *ip)
 The PIO-C interface for the NetCDF function nc_get_att_long.
 
int PIOc_inq_dim (int ncid, int dimid, char *name, PIO_Offset *lenp)
 The PIO-C interface for the NetCDF function nc_inq_dim. More...
 
int PIOc_inq_dimid (int ncid, const char *name, int *idp)
 The PIO-C interface for the NetCDF function nc_inq_dimid. More...
 
int PIOc_inq_unlimdim (int ncid, int *unlimdimidp)
 The PIO-C interface for the NetCDF function nc_inq_unlimdim.
 
int PIOc_inq_vardimid (int ncid, int varid, int *dimidsp)
 The PIO-C interface for the NetCDF function nc_inq_vardimid.
 
int PIOc_inq_attlen (int ncid, int varid, const char *name, PIO_Offset *lenp)
 The PIO-C interface for the NetCDF function nc_inq_attlen.
 
int PIOc_inq_dimname (int ncid, int dimid, char *name)
 The PIO-C interface for the NetCDF function nc_inq_dimname.
 
int PIOc_put_att_ushort (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned short *op)
 The PIO-C interface for the NetCDF function nc_put_att_ushort.
 
int PIOc_get_att_float (int ncid, int varid, const char *name, float *ip)
 The PIO-C interface for the NetCDF function nc_get_att_float.
 
int PIOc_sync (int ncid)
 PIO interface to nc_sync This routine is called collectively by all tasks in the communicator ios.union_comm. More...
 
int PIOc_put_att_longlong (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const long long *op)
 The PIO-C interface for the NetCDF function nc_put_att_longlong.
 
int PIOc_put_att_uint (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned int *op)
 The PIO-C interface for the NetCDF function nc_put_att_uint.
 
int PIOc_get_att_schar (int ncid, int varid, const char *name, signed char *ip)
 The PIO-C interface for the NetCDF function nc_get_att_schar.
 
int PIOc_inq_attid (int ncid, int varid, const char *name, int *idp)
 The PIO-C interface for the NetCDF function nc_inq_attid. More...
 
int PIOc_def_dim (int ncid, const char *name, PIO_Offset len, int *idp)
 The PIO-C interface for the NetCDF function nc_def_dim. More...
 
int PIOc_inq_ndims (int ncid, int *ndimsp)
 The PIO-C interface for the NetCDF function nc_inq_ndims.
 
int PIOc_inq_vartype (int ncid, int varid, nc_type *xtypep)
 The PIO-C interface for the NetCDF function nc_inq_vartype.
 
int PIOc_get_att_int (int ncid, int varid, const char *name, int *ip)
 The PIO-C interface for the NetCDF function nc_get_att_int.
 
int PIOc_get_att_double (int ncid, int varid, const char *name, double *ip)
 The PIO-C interface for the NetCDF function nc_get_att_double.
 
int PIOc_inq_atttype (int ncid, int varid, const char *name, nc_type *xtypep)
 The PIO-C interface for the NetCDF function nc_inq_atttype.
 
int PIOc_put_att_uchar (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned char *op)
 The PIO-C interface for the NetCDF function nc_put_att_uchar.
 
int PIOc_get_att_uchar (int ncid, int varid, const char *name, unsigned char *ip)
 The PIO-C interface for the NetCDF function nc_get_att_uchar.
 
int PIOc_InitDecomp (const int iosysid, const int basetype, const int ndims, const int dims[], const int maplen, const PIO_Offset *compmap, int *ioidp, const int *rearr, const PIO_Offset *iostart, const PIO_Offset *iocount)
 C interface to the initdecomp. More...
 
int PIOc_Init_Intracomm (const MPI_Comm comp_comm, const int num_iotasks, const int stride, const int base, const int rearr, int *iosysidp)
 
int PIOc_Init_Async (MPI_Comm world, int num_io_procs, int *io_proc_list, int component_count, int *num_procs_per_comp, int **proc_list, int *iosysidp)
 Library initialization used when IO tasks are distinct from compute tasks. More...
 
int PIOc_Init_Intercomm (int component_count, MPI_Comm peer_comm, MPI_Comm *comp_comms, MPI_Comm io_comm, int *iosysidp)
 
int PIOc_closefile (int ncid)
 Close a file previously opened with PIO. More...
 
int PIOc_createfile (const int iosysid, int *ncidp, int *iotype, const char *fname, const int mode)
 
int PIOc_create (int iosysid, const char *path, int cmode, int *ncidp)
 Open a new file using pio. More...
 
int PIOc_openfile (const int iosysid, int *ncidp, int *iotype, const char *fname, const int mode)
 Open an existing file using PIO library. More...
 
int PIOc_open (const int iosysid, const char *path, int mode, int *ncidp)
 Open an existing file using PIO library. More...
 
int PIOc_write_darray (const int ncid, const int vid, const int ioid, const PIO_Offset arraylen, void *array, void *fillvalue)
 Write a distributed array to the output file. More...
 
int PIOc_write_darray_multi (const int ncid, const int vid[], const int ioid, const int nvars, const PIO_Offset arraylen, void *array, const int frame[], void *fillvalue[], bool flushtodisk)
 
int PIOc_get_att_ubyte (int ncid, int varid, const char *name, unsigned char *ip)
 The PIO-C interface for the NetCDF function nc_get_att_ubyte.
 
int PIOc_put_att_ubyte (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const unsigned char *op)
 The PIO-C interface for the NetCDF function nc_put_att_ubyte.
 
int PIOc_set_blocksize (const int newblocksize)
 Set the target blocksize for the box rearranger.
 
int PIOc_readmap (const char file[], int *ndims, int *gdims[], PIO_Offset *fmaplen, PIO_Offset *map[], const MPI_Comm comm)
 
int PIOc_readmap_from_f90 (const char file[], int *ndims, int *gdims[], PIO_Offset *maplen, PIO_Offset *map[], const int f90_comm)
 
int PIOc_writemap (const char file[], const int ndims, const int gdims[], PIO_Offset maplen, PIO_Offset map[], const MPI_Comm comm)
 
int PIOc_writemap_from_f90 (const char file[], const int ndims, const int gdims[], const PIO_Offset maplen, const PIO_Offset map[], const int f90_comm)
 
int PIOc_deletefile (const int iosysid, const char filename[])
 Delete a file. More...
 
int PIOc_File_is_Open (int ncid)
 Check to see if PIO file is open.
 
int PIOc_Set_File_Error_Handling (int ncid, int method)
 Set the error handling method to be used for subsequent pio library calls, returns the previous method setting.
 
int PIOc_advanceframe (int ncid, int varid)
 Increment the unlimited dimension of the given variable.
 
int PIOc_setframe (const int ncid, const int varid, const int frame)
 Set the unlimited dimension of the given variable. More...
 
int PIOc_get_numiotasks (int iosysid, int *numiotasks)
 Get the number of IO tasks set.
 
int PIOc_get_iorank (int iosysid, int *iorank)
 Get the IO rank on the current task.
 
int PIOc_get_local_array_size (int ioid)
 Get the local size of the variable.
 
int PIOc_Set_IOSystem_Error_Handling (int iosysid, int method)
 Set the error handling method used for subsequent calls.
 
int PIOc_set_hint (const int iosysid, char hint[], const char hintval[])
 Send a hint to the MPI-IO library. More...
 
int PIOc_finalize (const int iosysid)
 Clean up internal data structures, free MPI resources, and exit the pio library. More...
 
int PIOc_iam_iotask (const int iosysid, bool *ioproc)
 return a logical indicating whether this task is an iotask
 
int PIOc_iotask_rank (const int iosysid, int *iorank)
 return the rank of this task in the io comm or -1 if this task is not in the comm
 
int PIOc_iosystem_is_active (const int iosysid, bool *active)
 Check to see if PIO has been initialized.
 
int PIOc_put_vars_uchar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const unsigned char *op)
 
int PIOc_get_var1_schar (int ncid, int varid, const PIO_Offset index[], signed char *buf)
 
int PIOc_put_vars_ushort (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const unsigned short *op)
 
int pio_read_darray_nc (file_desc_t *file, io_desc_t *iodesc, const int vid, void *IOBUF)
 Read an array of data from a file to the (parallel) IO library. More...
 
int PIOc_put_vars_ulonglong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const unsigned long long *op)
 
int PIOc_get_vars_ulonglong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], unsigned long long *buf)
 
int PIOc_put_varm (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const void *buf, PIO_Offset bufcount, MPI_Datatype buftype)
 PIO interface to nc_put_varm. More...
 
int PIOc_read_darray (const int ncid, const int vid, const int ioid, const PIO_Offset arraylen, void *array)
 Read a field from a file to the IO library. More...
 
int PIOc_put_vars_uint (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const unsigned int *op)
 
int PIOc_get_varm_schar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], signed char *buf)
 
int PIOc_put_varm_uchar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const unsigned char *op)
 PIO interface to nc_put_varm_uchar. More...
 
int PIOc_put_var_ushort (int ncid, int varid, const unsigned short *op)
 Interface to netCDF data write function. More...
 
int PIOc_get_vars_short (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], short *buf)
 
int PIOc_put_var1_longlong (int ncid, int varid, const PIO_Offset index[], const long long *op)
 
int PIOc_get_var_double (int ncid, int varid, double *buf)
 
int PIOc_put_vara_uchar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const unsigned char *op)
 
int PIOc_put_varm_short (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const short *op)
 PIO interface to nc_put_varm_short. More...
 
int PIOc_get_vara_double (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], double *buf)
 
int PIOc_put_var1_long (int ncid, int varid, const PIO_Offset index[], const long *ip)
 
int PIOc_get_var_int (int ncid, int varid, int *buf)
 
int PIOc_put_vars_long (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const long *op)
 
int PIOc_put_var_short (int ncid, int varid, const short *op)
 Interface to netCDF data write function. More...
 
int PIOc_get_vara_text (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], char *buf)
 
int PIOc_put_vara_int (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const int *op)
 
int PIOc_put_var1_ushort (int ncid, int varid, const PIO_Offset index[], const unsigned short *op)
 
int PIOc_put_vara_text (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const char *op)
 
int PIOc_put_varm_text (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const char *op)
 PIO interface to nc_put_varm_text. More...
 
int PIOc_put_varm_ushort (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const unsigned short *op)
 PIO interface to nc_put_varm_ushort. More...
 
int PIOc_put_var_ulonglong (int ncid, int varid, const unsigned long long *op)
 Interface to netCDF data write function. More...
 
int PIOc_put_var_int (int ncid, int varid, const int *op)
 Interface to netCDF data write function. More...
 
int PIOc_put_var_longlong (int ncid, int varid, const long long *op)
 Interface to netCDF data write function. More...
 
int PIOc_put_var_schar (int ncid, int varid, const signed char *op)
 Interface to netCDF data write function. More...
 
int PIOc_put_var_uint (int ncid, int varid, const unsigned int *op)
 Interface to netCDF data write function. More...
 
int PIOc_put_var (int ncid, int varid, const void *buf, PIO_Offset bufcount, MPI_Datatype buftype)
 Interface to netCDF data write function. More...
 
int PIOc_put_vara_ushort (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const unsigned short *op)
 
int PIOc_put_vars_short (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const short *op)
 
int PIOc_put_vara_uint (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const unsigned int *op)
 
int PIOc_put_vara_schar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const signed char *op)
 
int PIOc_put_varm_ulonglong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const unsigned long long *op)
 PIO interface to nc_put_varm_ulonglong. More...
 
int PIOc_put_var1_uchar (int ncid, int varid, const PIO_Offset index[], const unsigned char *op)
 
int PIOc_put_varm_int (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const int *op)
 PIO interface to nc_put_varm_int. More...
 
int PIOc_put_vars_schar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const signed char *op)
 
int PIOc_put_var1 (int ncid, int varid, const PIO_Offset index[], const void *buf, PIO_Offset bufcount, MPI_Datatype buftype)
 
int PIOc_put_vara_float (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const float *op)
 
int PIOc_put_var1_float (int ncid, int varid, const PIO_Offset index[], const float *op)
 
int PIOc_put_varm_float (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const float *op)
 PIO interface to nc_put_varm_float. More...
 
int PIOc_put_var1_text (int ncid, int varid, const PIO_Offset index[], const char *op)
 
int PIOc_put_vars_text (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const char *op)
 
int PIOc_put_varm_long (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const long *op)
 PIO interface to nc_put_varm_long. More...
 
int PIOc_put_vars_double (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const double *op)
 
int PIOc_put_vara_longlong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const long long *op)
 
int PIOc_put_var_double (int ncid, int varid, const double *op)
 Interface to netCDF data write function. More...
 
int PIOc_put_var_float (int ncid, int varid, const float *op)
 Interface to netCDF data write function. More...
 
int PIOc_put_var1_ulonglong (int ncid, int varid, const PIO_Offset index[], const unsigned long long *op)
 
int PIOc_put_varm_uint (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const unsigned int *op)
 PIO interface to nc_put_varm_uint. More...
 
int PIOc_put_var1_uint (int ncid, int varid, const PIO_Offset index[], const unsigned int *op)
 
int PIOc_put_var1_int (int ncid, int varid, const PIO_Offset index[], const int *op)
 
int PIOc_put_vars_float (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const float *op)
 
int PIOc_put_vara_short (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const short *op)
 
int PIOc_put_var1_schar (int ncid, int varid, const PIO_Offset index[], const signed char *op)
 
int PIOc_put_vara_ulonglong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const unsigned long long *op)
 
int PIOc_put_varm_double (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const double *op)
 PIO interface to nc_put_varm_double. More...
 
int PIOc_put_vara (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const void *buf, PIO_Offset bufcount, MPI_Datatype buftype)
 
int PIOc_put_vara_long (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const long *op)
 
int PIOc_put_var1_double (int ncid, int varid, const PIO_Offset index[], const double *op)
 
int PIOc_put_varm_schar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const signed char *op)
 PIO interface to nc_put_varm_schar. More...
 
int PIOc_put_var_text (int ncid, int varid, const char *op)
 Interface to netCDF data write function. More...
 
int PIOc_put_vars_int (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const int *op)
 
int PIOc_put_var1_short (int ncid, int varid, const PIO_Offset index[], const short *op)
 
int PIOc_put_vars_longlong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const long long *op)
 
int PIOc_put_vara_double (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const double *op)
 
int PIOc_put_vars (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const void *buf, PIO_Offset bufcount, MPI_Datatype buftype)
 
int PIOc_put_vars_tc (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], nc_type xtype, const void *buf)
 
int PIOc_put_var_uchar (int ncid, int varid, const unsigned char *op)
 Interface to netCDF data write function. More...
 
int PIOc_put_var_long (int ncid, int varid, const long *op)
 Interface to netCDF data write function. More...
 
int PIOc_put_varm_longlong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], const long long *op)
 PIO interface to nc_put_varm_longlong. More...
 
int PIOc_get_vara_int (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], int *buf)
 
int PIOc_get_var1_float (int ncid, int varid, const PIO_Offset index[], float *buf)
 
int PIOc_get_var1_short (int ncid, int varid, const PIO_Offset index[], short *buf)
 
int PIOc_get_vars_int (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], int *buf)
 
int PIOc_get_var_text (int ncid, int varid, char *buf)
 
int PIOc_get_varm_double (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], double *buf)
 
int PIOc_get_vars_schar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], signed char *buf)
 
int PIOc_get_vara_ushort (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], unsigned short *buf)
 
int PIOc_get_var1_ushort (int ncid, int varid, const PIO_Offset index[], unsigned short *buf)
 
int PIOc_get_var_float (int ncid, int varid, float *buf)
 
int PIOc_get_vars_uchar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], unsigned char *buf)
 
int PIOc_get_var (int ncid, int varid, void *buf, PIO_Offset bufcount, MPI_Datatype buftype)
 
int PIOc_get_var1_longlong (int ncid, int varid, const PIO_Offset index[], long long *buf)
 
int PIOc_get_vars_ushort (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], unsigned short *buf)
 
int PIOc_get_var_long (int ncid, int varid, long *buf)
 
int PIOc_get_var1_double (int ncid, int varid, const PIO_Offset index[], double *buf)
 
int PIOc_get_vara_uint (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], unsigned int *buf)
 
int PIOc_get_vars_longlong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], long long *buf)
 
int PIOc_get_var_longlong (int ncid, int varid, long long *buf)
 
int PIOc_get_vara_short (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], short *buf)
 
int PIOc_get_vara_long (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], long *buf)
 
int PIOc_get_var1_int (int ncid, int varid, const PIO_Offset index[], int *buf)
 
int PIOc_get_var1_ulonglong (int ncid, int varid, const PIO_Offset index[], unsigned long long *buf)
 
int PIOc_get_var_uchar (int ncid, int varid, unsigned char *buf)
 
int PIOc_get_vara_uchar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], unsigned char *buf)
 
int PIOc_get_vars_float (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], float *buf)
 
int PIOc_get_vars_long (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], long *buf)
 
int PIOc_get_var1 (int ncid, int varid, const PIO_Offset index[], void *buf, PIO_Offset bufcount, MPI_Datatype buftype)
 
int PIOc_get_var_uint (int ncid, int varid, unsigned int *buf)
 
int PIOc_get_vara (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], void *buf, PIO_Offset bufcount, MPI_Datatype buftype)
 
int PIOc_get_vara_schar (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], signed char *buf)
 
int PIOc_get_var1_uint (int ncid, int varid, const PIO_Offset index[], unsigned int *buf)
 
int PIOc_get_vars_uint (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], unsigned int *buf)
 
int PIOc_get_vara_float (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], float *buf)
 
int PIOc_get_varm_text (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], char *buf)
 
int PIOc_get_var1_text (int ncid, int varid, const PIO_Offset index[], char *buf)
 
int PIOc_get_varm_int (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], int *buf)
 
int PIOc_get_varm_uint (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], unsigned int *buf)
 
int PIOc_get_varm (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], void *buf, PIO_Offset bufcount, MPI_Datatype buftype)
 
int PIOc_get_vars_double (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], double *buf)
 
int PIOc_get_vara_longlong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], long long *buf)
 
int PIOc_get_var_ulonglong (int ncid, int varid, unsigned long long *buf)
 
int PIOc_get_vara_ulonglong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], unsigned long long *buf)
 
int PIOc_get_var_short (int ncid, int varid, short *buf)
 
int PIOc_get_varm_float (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], float *buf)
 
int PIOc_get_var1_long (int ncid, int varid, const PIO_Offset index[], long *buf)
 
int PIOc_get_varm_long (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], long *buf)
 
int PIOc_get_varm_ushort (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], unsigned short *buf)
 
int PIOc_get_varm_longlong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], long long *buf)
 
int PIOc_get_vars_text (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], char *buf)
 
int PIOc_get_var1_uchar (int ncid, int varid, const PIO_Offset index[], unsigned char *buf)
 
int PIOc_get_vars (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], void *buf, PIO_Offset bufcount, MPI_Datatype buftype)
 
int PIOc_get_vars_tc (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], nc_type xtype, void *buf)
 
int PIOc_get_varm_short (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], short *buf)
 
int PIOc_get_varm_ulonglong (int ncid, int varid, const PIO_Offset start[], const PIO_Offset count[], const PIO_Offset stride[], const PIO_Offset imap[], unsigned long long *buf)
 
int PIOc_get_var_schar (int ncid, int varid, signed char *buf)
 
int PIOc_iotype_available (const int iotype)
 return true if this iotype is supported in the build, 0 otherwise
 
int PIOc_set_log_level (int level)
 Set the logging level. More...
 
int PIOc_put_att (int ncid, int varid, const char *name, nc_type xtype, PIO_Offset len, const void *op)
 The PIO-C interface for the NetCDF function nc_put_att. More...
 
int PIOc_get_att (int ncid, int varid, const char *name, void *ip)
 The PIO-C interface for the NetCDF function nc_get_att. More...
 
int PIOc_inq_type (int ncid, nc_type xtype, char *name, PIO_Offset *sizep)
 The PIO-C interface for the NetCDF function nctypelen.
 

Detailed Description

Public headers for the PIO C interface.

Author
Jim Edwards
Date
2014
See also
http://code.google.com/p/parallelio/

Macro Definition Documentation

§ MPI_OFFSET

#define MPI_OFFSET   MPI_LONG_LONG

MPI_OFFSET is an integer type of size sufficient to represent the size (in bytes) of the largest file supported by MPI.

In some MPI implementations MPI_OFFSET is not properly defined.

§ PIO_EBADIOTYPE

#define PIO_EBADIOTYPE   -255

Define error codes for PIO.

§ PIO_EINDEP

#define PIO_EINDEP   (-203)

Define the netCDF-based error codes.

Define the extra error codes for the parallel-netcdf library.

§ PIO_MAX_VARS

#define PIO_MAX_VARS   NC_MAX_VARS

The maximum number of variables allowed in a netCDF file.

§ PIO_OFFSET

#define PIO_OFFSET   MPI_OFFSET

PIO_OFFSET is an integer type of size sufficient to represent the size (in bytes) of the largest file supported by MPI.

Typedef Documentation

§ file_desc_t

typedef struct file_desc_t file_desc_t

File descriptor structure.

This structure holds information associated with each open file

§ io_desc_t

typedef struct io_desc_t io_desc_t

IO descriptor structure.

This structure defines the mapping for a given variable between compute and IO decomposition.

§ io_region

typedef struct io_region io_region

IO region structure.

Each IO region is a unit of data which can be described using start and count arrays. Each IO task may in general have multiple io regions per variable. The box rearranger will have at most one io region per variable.

§ iosystem_desc_t

IO system descriptor structure.

This structure contains the general IO subsystem data and MPI structure

Enumeration Type Documentation

§ PIO_ERROR_HANDLERS

These are the supported error handlers.

Enumerator
PIO_INTERNAL_ERROR 

Errors cause abort.

PIO_BCAST_ERROR 

Error codes are broadcast to all tasks.

PIO_RETURN_ERROR 

Errors are returned to caller with no internal action.

§ PIO_IOTYPE

enum PIO_IOTYPE

These are the supported methods of reading/writing netCDF files.

(Not all methods can be used with all netCDF files.)

Enumerator
PIO_IOTYPE_PNETCDF 

Parallel Netcdf (parallel)

PIO_IOTYPE_NETCDF 

Netcdf3 Classic format (serial)

PIO_IOTYPE_NETCDF4C 

NetCDF4 (HDF5) compressed format (serial)

PIO_IOTYPE_NETCDF4P 

NetCDF4 (HDF5) parallel.

§ PIO_REARRANGERS

These are the supported output data rearrangement methods.

Enumerator
PIO_REARR_BOX 

Box rearranger.

PIO_REARR_SUBSET 

Subset rearranger.

Function Documentation

§ pio_read_darray_nc()

int pio_read_darray_nc ( file_desc_t file,
io_desc_t iodesc,
const int  vid,
void *  IOBUF 
)

Read an array of data from a file to the (parallel) IO library.

Parameters
filea pointer to the open file descriptor for the file that will be written to
iodesca pointer to the defined iodescriptor for the buffer
vidthe variable id to be read
IOBUFthe buffer to be read into from this mpi task
Returns
0 on success, error code otherwise.

§ PIOc_closefile()

int PIOc_closefile ( int  ncid)

Close a file previously opened with PIO.

Parameters
ncidthe file pointer

§ PIOc_create()

int PIOc_create ( int  iosysid,
const char *  filename,
int  cmode,
int *  ncidp 
)

Open a new file using pio.

Input parameters are read on comp task 0 and ignored elsewhere.

Parameters
iosysid: A defined pio system descriptor (input)
cmode: The netcdf mode for the create operation
filename: The filename to open
ncidp: A pio file descriptor (output)
Returns
0 for success, error code otherwise.

§ PIOc_def_dim()

int PIOc_def_dim ( int  ncid,
const char *  name,
PIO_Offset  len,
int *  idp 
)

The PIO-C interface for the NetCDF function nc_def_dim.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__dimensions.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
idpa pointer that will get the id of the variable or attribute.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_def_var()

int PIOc_def_var ( int  ncid,
const char *  name,
nc_type  xtype,
int  ndims,
const int *  dimidsp,
int *  varidp 
)

The PIO-C interface for the NetCDF function nc_def_var.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
varidpa pointer that will get the variable id
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_def_var_chunking()

int PIOc_def_var_chunking ( int  ncid,
int  varid,
int  storage,
const PIO_Offset *  chunksizesp 
)

Set chunksizes for a variable.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

Chunksizes have important performance repercussions. NetCDF attempts to choose sensible chunk sizes by default, but for best performance check chunking against access patterns.

See the netCDF variable documentation for details about the operation of this function.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
storageNC_CONTIGUOUS or NC_CHUNKED.
chunksizepan array of chunksizes. Must have a chunksize for every variable dimension.
Returns
PIO_NOERR for success, otherwise an error code.

Pointer to io system information.

Pointer to file information.

Return code from function calls.

Return code from MPI function codes.

§ PIOc_def_var_deflate()

int PIOc_def_var_deflate ( int  ncid,
int  varid,
int  shuffle,
int  deflate,
int  deflate_level 
)

Set deflate (zlib) settings for a variable.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

See the netCDF variable documentation for details about the operation of this function.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable.
shufflenon-zero to turn on shuffle filter (can be good for integer data).
deflatenon-zero to turn on zlib compression for this variable.
deflate_level1 to 9, with 1 being faster and 9 being more compressed.
Returns
PIO_NOERR for success, otherwise an error code.

§ PIOc_def_var_endian()

int PIOc_def_var_endian ( int  ncid,
int  varid,
int  endian 
)

Set chunksizes for a variable.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

See the netCDF variable documentation for details about the operation of this function.

Chunksizes have important performance repercussions. NetCDF attempts to choose sensible chunk sizes by default, but for best performance check chunking against access patterns.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
storageNC_CONTIGUOUS or NC_CHUNKED.
chunksizepan array of chunksizes. Must have a chunksize for every variable dimension.
Returns
PIO_NOERR for success, otherwise an error code.

§ PIOc_def_var_fill()

int PIOc_def_var_fill ( int  ncid,
int  varid,
int  no_fill,
const void *  fill_value 
)

Set chunksizes for a variable.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

See the netCDF variable documentation for details about the operation of this function.

Chunksizes have important performance repercussions. NetCDF attempts to choose sensible chunk sizes by default, but for best performance check chunking against access patterns.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
storageNC_CONTIGUOUS or NC_CHUNKED.
chunksizepan array of chunksizes. Must have a chunksize for every variable dimension.
Returns
PIO_NOERR for success, otherwise an error code.

§ PIOc_del_att()

int PIOc_del_att ( int  ncid,
int  varid,
const char *  name 
)

The PIO-C interface for the NetCDF function nc_del_att.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_deletefile()

int PIOc_deletefile ( const int  iosysid,
const char  filename[] 
)

Delete a file.

Parameters
iosysid: a pio system handle
filename: a filename

§ PIOc_enddef()

int PIOc_enddef ( int  ncid)

The PIO-C interface for the NetCDF function nc_enddef.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__datasets.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_finalize()

int PIOc_finalize ( const int  iosysid)

Clean up internal data structures, free MPI resources, and exit the pio library.

Parameters
iosysidthe io system ID provided by PIOc_Init_Intracomm().
Returns
0 for success or non-zero for error.

§ PIOc_get_att()

int PIOc_get_att ( int  ncid,
int  varid,
const char *  name,
void *  ip 
)

The PIO-C interface for the NetCDF function nc_get_att.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_get_chunk_cache()

int PIOc_get_chunk_cache ( int  iosysid,
int  iotype,
PIO_Offset *  sizep,
PIO_Offset *  nelemsp,
float *  preemptionp 
)

Get current file chunk cache settings from HDF5.

This function has no effect on netCDF classic files. Calling this function with iotype of PIO_IOTYPE_PNETCDF or PIO_IOTYPE_NETCDF returns an error.

The file chunk cache for HDF5 can be set, and will apply for any files opened or created until the program ends, or the settings are changed again. The cache settings apply only to the open file. They do not persist with the file, and must be set each time the file is opened, before it is opened, if they are to have effect.

See the netCDF variable documentation for details about the operation of this function.

Chunksizes have important performance repercussions. NetCDF attempts to choose sensible chunk sizes by default, but for best performance check chunking against access patterns.

Parameters
iotypethe iotype of files to be created or opened.
sizepgets the size of file cache.
nelemspgets the number of elements in file cache.
preemptionpgets the preemption setting for file cache.
Returns
PIO_NOERR for success, otherwise an error code.

§ PIOc_get_var_chunk_cache()

int PIOc_get_var_chunk_cache ( int  ncid,
int  varid,
PIO_Offset *  sizep,
PIO_Offset *  nelemsp,
float *  preemptionp 
)

Get the variable chunk cache settings.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

Note that these settings are not part of the data file - they apply only to the open file as long as it is open.

See the netCDF variable documentation for details about the operation of this function.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
sizepwill get the size of the cache in bytes.
nelemspwill get the number of elements in the cache.
preemptionpwill get the cache preemption value.
Returns
PIO_NOERR for success, otherwise an error code.

§ PIOc_Init_Async()

int PIOc_Init_Async ( MPI_Comm  world,
int  num_io_procs,
int *  io_proc_list,
int  component_count,
int *  num_procs_per_comp,
int **  proc_list,
int *  iosysidp 
)

Library initialization used when IO tasks are distinct from compute tasks.

This is a collective call. Input parameters are read on comp_rank=0 values on other tasks are ignored. This variation of PIO_init sets up a distinct set of tasks to handle IO, these tasks do not return from this call. Instead they go to an internal loop and wait to receive further instructions from the computational tasks.

Sequence of Events to do Asynch I/O

Here is the sequence of events that needs to occur when an IO operation is called from the collection of compute tasks. I'm going to use pio_put_var because write_darray has some special characteristics that make it a bit more complicated...

Compute tasks call pio_put_var with an integer argument

The MPI_Send sends a message from comp_rank=0 to io_rank=0 on union_comm (a comm defined as the union of io and compute tasks) msg is an integer which indicates the function being called, in this case the msg is PIO_MSG_PUT_VAR_INT

The iotasks now know what additional arguments they should expect to receive from the compute tasks, in this case a file handle, a variable id, the length of the array and the array itself.

The iotasks now have the information they need to complete the operation and they call the pio_put_var routine. (In pio1 this bit of code is in pio_get_put_callbacks.F90.in)

After the netcdf operation is completed (in the case of an inq or get operation) the result is communicated back to the compute tasks.

Parameters
worldthe communicator containing all the available tasks.
num_io_procsthe number of processes for the IO component.
io_proc_listan array of lenth num_io_procs with the processor number for each IO processor. If NULL then the IO processes are assigned starting at processes 0.
component_countnumber of computational components
num_procs_per_compan array of int, of length component_count, with the number of processors in each computation component.
proc_listan array of arrays containing the processor numbers for each computation component. If NULL then the computation components are assigned processors sequentially starting with processor num_io_procs.
iosysidppointer to array of length component_count that gets the iosysid for each component.
Returns
PIO_NOERR on success, error code otherwise.

§ PIOc_InitDecomp()

int PIOc_InitDecomp ( const int  iosysid,
const int  basetype,
const int  ndims,
const int  dims[],
const int  maplen,
const PIO_Offset *  compmap,
int *  ioidp,
const int *  rearranger,
const PIO_Offset *  iostart,
const PIO_Offset *  iocount 
)

C interface to the initdecomp.

Parameters
iosysidIO system descriptor structure. (input) This structure contains the general IO subsystem data and MPI structure (input)
basetypethe basic PIO data type used (input)
ndimsthe number of dimensions in the variable (input)
dims[]the global size of each dimension (input)
maplenthe local length of the compmap array (input)
compmap[]a 1 based array of offsets into the array record on file. A 0 in this array indicates a value which should not be transfered. (input)
ioidpthe io description pointer (output)
rearrangerthe rearranger to be used for this decomp or NULL to use the default (optional input)
iostartAn optional array of start values for block cyclic decompositions (optional input)
iocountAn optional array of count values for block cyclic decompositions (optional input)

§ PIOc_inq()

int PIOc_inq ( int  ncid,
int *  ndimsp,
int *  nvarsp,
int *  ngattsp,
int *  unlimdimidp 
)

The PIO-C interface for the NetCDF function nc_inq.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__datasets.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_att()

int PIOc_inq_att ( int  ncid,
int  varid,
const char *  name,
nc_type *  xtypep,
PIO_Offset *  lenp 
)

The PIO-C interface for the NetCDF function nc_inq_att.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
xtypepa pointer that will get the type of the attribute.
lenpa pointer that will get the number of values
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_attid()

int PIOc_inq_attid ( int  ncid,
int  varid,
const char *  name,
int *  idp 
)

The PIO-C interface for the NetCDF function nc_inq_attid.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
idpa pointer that will get the id of the variable or attribute.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_attname()

int PIOc_inq_attname ( int  ncid,
int  varid,
int  attnum,
char *  name 
)

The PIO-C interface for the NetCDF function nc_inq_attname.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
attnumthe attribute ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_dim()

int PIOc_inq_dim ( int  ncid,
int  dimid,
char *  name,
PIO_Offset *  lenp 
)

The PIO-C interface for the NetCDF function nc_inq_dim.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__dimensions.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
lenpa pointer that will get the number of values
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_dimid()

int PIOc_inq_dimid ( int  ncid,
const char *  name,
int *  idp 
)

The PIO-C interface for the NetCDF function nc_inq_dimid.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__dimensions.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
idpa pointer that will get the id of the variable or attribute.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_var()

int PIOc_inq_var ( int  ncid,
int  varid,
char *  name,
nc_type *  xtypep,
int *  ndimsp,
int *  dimidsp,
int *  nattsp 
)

The PIO-C interface for the NetCDF function nc_inq_var.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
xtypepa pointer that will get the type of the attribute.
nattspa pointer that will get the number of attributes
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_var_chunking()

int PIOc_inq_var_chunking ( int  ncid,
int  varid,
int *  storagep,
PIO_Offset *  chunksizesp 
)

Inquire about chunksizes for a variable.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

See the netCDF variable documentation for details about the operation of this function.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
storageppointer to int which will be set to either NC_CONTIGUOUS or NC_CHUNKED.
chunksizeppointer to memory where chunksizes will be set. There are the same number of chunksizes as there are dimensions.
Returns
PIO_NOERR for success, otherwise an error code.

§ PIOc_inq_var_deflate()

int PIOc_inq_var_deflate ( int  ncid,
int  varid,
int *  shufflep,
int *  deflatep,
int *  deflate_levelp 
)

This function only applies to netCDF-4 files.

When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

Inquire about deflate (zlib compression) settings for a variable.

See the netCDF variable documentation for details about the operation of this function.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
shuffleppointer to an int that will get the status of the shuffle filter.
deflateppointer to an int that will be set to non-zero if deflation is in use for this variable.
deflate_levelppointer to an int that will get the deflation level (from 1-9) if deflation is in use for this variable.
Returns
PIO_NOERR for success, otherwise an error code.

§ PIOc_inq_var_endian()

int PIOc_inq_var_endian ( int  ncid,
int  varid,
int *  endianp 
)

Inquire about chunksizes for a variable.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

See the netCDF variable documentation for details about the operation of this function.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
storageppointer to int which will be set to either NC_CONTIGUOUS or NC_CHUNKED.
chunksizeppointer to memory where chunksizes will be set. There are the same number of chunksizes as there are dimensions.
Returns
PIO_NOERR for success, otherwise an error code.

§ PIOc_inq_var_fill()

int PIOc_inq_var_fill ( int  ncid,
int  varid,
int *  no_fill,
void *  fill_valuep 
)

The PIO-C interface for the NetCDF function nc_inq_var_fill.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_inq_varid()

int PIOc_inq_varid ( int  ncid,
const char *  name,
int *  varidp 
)

The PIO-C interface for the NetCDF function nc_inq_varid.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
varidpa pointer that will get the variable id
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_open()

int PIOc_open ( int  iosysid,
const char *  path,
int  mode,
int *  ncidp 
)

Open an existing file using PIO library.

Input parameters are read on comp task 0 and ignored elsewhere.

Parameters
iosysidA defined pio system descriptor
pathThe filename to open
modeThe netcdf mode for the open operation
ncidppointer to int where ncid will go
Returns
0 for success, error code otherwise.

§ PIOc_openfile()

int PIOc_openfile ( const int  iosysid,
int *  ncidp,
int *  iotype,
const char *  filename,
const int  mode 
)

Open an existing file using PIO library.

Input parameters are read on comp task 0 and ignored elsewhere.

Parameters
iosysid: A defined pio system descriptor (input)
ncidp: A pio file descriptor (output)
iotype: A pio output format (input)
filename: The filename to open
mode: The netcdf mode for the open operation
Returns
0 for success, error code otherwise.

§ PIOc_put_att()

int PIOc_put_att ( int  ncid,
int  varid,
const char *  name,
nc_type  xtype,
PIO_Offset  len,
const void *  op 
)

The PIO-C interface for the NetCDF function nc_put_att.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_put_var()

int PIOc_put_var ( int  ncid,
int  varid,
const void *  buf,
PIO_Offset  bufcount,
MPI_Datatype  buftype 
)

Interface to netCDF data write function.

§ PIOc_put_var_double()

int PIOc_put_var_double ( int  ncid,
int  varid,
const double *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_float()

int PIOc_put_var_float ( int  ncid,
int  varid,
const float *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_int()

int PIOc_put_var_int ( int  ncid,
int  varid,
const int *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_long()

int PIOc_put_var_long ( int  ncid,
int  varid,
const long *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_longlong()

int PIOc_put_var_longlong ( int  ncid,
int  varid,
const long long *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_schar()

int PIOc_put_var_schar ( int  ncid,
int  varid,
const signed char *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_short()

int PIOc_put_var_short ( int  ncid,
int  varid,
const short *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_text()

int PIOc_put_var_text ( int  ncid,
int  varid,
const char *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_uchar()

int PIOc_put_var_uchar ( int  ncid,
int  varid,
const unsigned char *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_uint()

int PIOc_put_var_uint ( int  ncid,
int  varid,
const unsigned int *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_ulonglong()

int PIOc_put_var_ulonglong ( int  ncid,
int  varid,
const unsigned long long *  op 
)

Interface to netCDF data write function.

§ PIOc_put_var_ushort()

int PIOc_put_var_ushort ( int  ncid,
int  varid,
const unsigned short *  op 
)

Interface to netCDF data write function.

§ PIOc_put_varm()

int PIOc_put_varm ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const void *  buf,
PIO_Offset  bufcount,
MPI_Datatype  buftype 
)

PIO interface to nc_put_varm.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_double()

int PIOc_put_varm_double ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const double *  op 
)

PIO interface to nc_put_varm_double.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_float()

int PIOc_put_varm_float ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const float *  op 
)

PIO interface to nc_put_varm_float.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_int()

int PIOc_put_varm_int ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const int *  op 
)

PIO interface to nc_put_varm_int.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_long()

int PIOc_put_varm_long ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const long *  op 
)

PIO interface to nc_put_varm_long.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_longlong()

int PIOc_put_varm_longlong ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const long long *  op 
)

PIO interface to nc_put_varm_longlong.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_schar()

int PIOc_put_varm_schar ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const signed char *  op 
)

PIO interface to nc_put_varm_schar.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_short()

int PIOc_put_varm_short ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const short *  op 
)

PIO interface to nc_put_varm_short.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_text()

int PIOc_put_varm_text ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const char *  op 
)

PIO interface to nc_put_varm_text.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_uchar()

int PIOc_put_varm_uchar ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const unsigned char *  op 
)

PIO interface to nc_put_varm_uchar.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_uint()

int PIOc_put_varm_uint ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const unsigned int *  op 
)

PIO interface to nc_put_varm_uint.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_ulonglong()

int PIOc_put_varm_ulonglong ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const unsigned long long *  op 
)

PIO interface to nc_put_varm_ulonglong.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_put_varm_ushort()

int PIOc_put_varm_ushort ( int  ncid,
int  varid,
const PIO_Offset  start[],
const PIO_Offset  count[],
const PIO_Offset  stride[],
const PIO_Offset  imap[],
const unsigned short *  op 
)

PIO interface to nc_put_varm_ushort.

This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_read_darray()

int PIOc_read_darray ( const int  ncid,
const int  vid,
const int  ioid,
const PIO_Offset  arraylen,
void *  array 
)

Read a field from a file to the IO library.

Parameters
ncididentifies the netCDF file
vidthe variable ID to be read
ioidthe I/O description ID as passed back by PIOc_InitDecomp().
arraylenthe length of the array to be read. This is the length of the distrubited array. That is, the length of the portion of the data that is on the processor.
arraypointer to the data to be read. This is a pointer to the distributed portion of the array that is on this processor.
Returns
0 for success, error code otherwise.

§ PIOc_redef()

int PIOc_redef ( int  ncid)

The PIO-C interface for the NetCDF function nc_redef.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__datasets.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_rename_att()

int PIOc_rename_att ( int  ncid,
int  varid,
const char *  name,
const char *  newname 
)

The PIO-C interface for the NetCDF function nc_rename_att.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__attributes.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_rename_dim()

int PIOc_rename_dim ( int  ncid,
int  dimid,
const char *  name 
)

The PIO-C interface for the NetCDF function nc_rename_dim.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__dimensions.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_rename_var()

int PIOc_rename_var ( int  ncid,
int  varid,
const char *  name 
)

The PIO-C interface for the NetCDF function nc_rename_var.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
varidthe variable ID.
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_set_chunk_cache()

int PIOc_set_chunk_cache ( int  iosysid,
int  iotype,
PIO_Offset  size,
PIO_Offset  nelems,
float  preemption 
)

Set chunk cache netCDF files to be opened/created.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

The file chunk cache for HDF5 can be set, and will apply for any files opened or created until the program ends, or the settings are changed again. The cache settings apply only to the open file. They do not persist with the file, and must be set each time the file is opened, before it is opened, if they are to have effect.

See the netCDF variable documentation for details about the operation of this function.

Parameters
iotypethe iotype of files to be created or opened.
sizesize of file cache.
nelemsnumber of elements in file cache.
preemptionpreemption setting for file cache.
Returns
PIO_NOERR for success, otherwise an error code.

§ PIOc_set_fill()

int PIOc_set_fill ( int  ncid,
int  fillmode,
int *  old_modep 
)

The PIO-C interface for the NetCDF function nc_set_fill.

This routine is called collectively by all tasks in the communicator ios.union_comm. For more information on the underlying NetCDF commmand please read about this function in the NetCDF documentation at: http://www.unidata.ucar.edu/software/netcdf/docs/group__datasets.html

Parameters
ncidthe ncid of the open file, obtained from PIOc_openfile() or PIOc_createfile().
Returns
PIO_NOERR for success, error code otherwise. See PIOc_Set_File_Error_Handling

§ PIOc_set_hint()

int PIOc_set_hint ( const int  iosysid,
char  hint[],
const char  hintval[] 
)

Send a hint to the MPI-IO library.

§ PIOc_set_log_level()

int PIOc_set_log_level ( int  level)

Set the logging level.

Set to -1 for nothing, 0 for errors only, 1 for important logging, and so on. Log levels below 1 are only printed on the io/component root. If the library is not built with logging, this function does nothing.

§ PIOc_set_var_chunk_cache()

int PIOc_set_var_chunk_cache ( int  ncid,
int  varid,
PIO_Offset  size,
PIO_Offset  nelems,
float  preemption 
)

Set chunksizes for a variable.

This function only applies to netCDF-4 files. When used with netCDF classic files, the error PIO_ENOTNC4 will be returned.

See the netCDF variable documentation for details about the operation of this function.

Chunksizes have important performance repercussions. NetCDF attempts to choose sensible chunk sizes by default, but for best performance check chunking against access patterns.

Parameters
ncidthe ncid of the open file.
varidthe ID of the variable to set chunksizes for.
storageNC_CONTIGUOUS or NC_CHUNKED.
chunksizepan array of chunksizes. Must have a chunksize for every variable dimension.
Returns
PIO_NOERR for success, otherwise an error code.

§ PIOc_setframe()

int PIOc_setframe ( const int  ncid,
const int  varid,
const int  frame 
)

Set the unlimited dimension of the given variable.

Parameters
ncidthe ncid of the file.
varidthe varid of the variable
framethe value of the unlimited dimension. In c 0 for the first record, 1 for the second
Returns
PIO_NOERR for no error, or error code.

§ PIOc_strerror()

int PIOc_strerror ( int  pioerr,
char *  errmsg 
)

Return a string description of an error code.

If zero is passed, a null is returned.

Parameters
pioerrthe error code returned by a PIO function call.
errmsgPointer that will get the error message. It will be PIO_MAX_NAME chars or less.
Returns
0 on success

§ PIOc_sync()

int PIOc_sync ( int  ncid)

PIO interface to nc_sync This routine is called collectively by all tasks in the communicator ios.union_comm.

Refer to the netcdf documentation.

§ PIOc_write_darray()

int PIOc_write_darray ( const int  ncid,
const int  vid,
const int  ioid,
const PIO_Offset  arraylen,
void *  array,
void *  fillvalue 
)

Write a distributed array to the output file.

This routine aggregates output on the compute nodes and only sends it to the IO nodes when the compute buffer is full or when a flush is triggered.

Parameters
ncidthe ncid of the open netCDF file.
vidthe variable ID returned by PIOc_def_var().
ioidthe I/O description ID as passed back by PIOc_InitDecomp().
arraylenthe length of the array to be written. This is the length of the distrubited array. That is, the length of the portion of the data that is on the processor.
arraypointer to the data to be written. This is a pointer to the distributed portion of the array that is on this processor.
fillvaluepointer to the fill value to be used for missing data.
Returns
0 for success, non-zero error code for failure.