ParallelIO
Functions
pio_nc4.c File Reference

Functions to wrap netCDF-4 functions for PIO. More...

#include <pio.h>
#include <pio_internal.h>

Functions

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_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_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...
 

Detailed Description

Functions to wrap netCDF-4 functions for PIO.

Function Documentation

§ 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_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_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_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_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.