PIO
2.5.4
|
Write data from a distributed array to a netCDF file in C. More...
Functions | |
int | PIOc_write_darray_multi (int ncid, const int *varids, int ioid, int nvars, PIO_Offset arraylen, void *array, const int *frame, void **fillvalue, bool flushtodisk) |
Write one or more arrays with the same IO decomposition to the file. More... | |
int | find_var_fillvalue (file_desc_t *file, int varid, var_desc_t *vdesc) |
Find the fillvalue that should be used for a variable. More... | |
int | PIOc_write_darray (int ncid, int varid, int ioid, PIO_Offset arraylen, void *array, void *fillvalue) |
Write a distributed array to the output file. More... | |
int | PIOc_put_vard_text (int ncid, int varid, int decompid, const PIO_Offset recnum, const char *op) |
Put distributed array subset of a text variable. More... | |
int | PIOc_put_vard_uchar (int ncid, int varid, int decompid, const PIO_Offset recnum, const unsigned char *op) |
Put distributed array subset of an unsigned char variable. More... | |
int | PIOc_put_vard_schar (int ncid, int varid, int decompid, const PIO_Offset recnum, const signed char *op) |
Put distributed array subset of a signed char variable. More... | |
int | PIOc_put_vard_ushort (int ncid, int varid, int decompid, const PIO_Offset recnum, const unsigned short *op) |
Put distributed array subset of an unsigned 16-bit integer variable. More... | |
int | PIOc_put_vard_short (int ncid, int varid, int decompid, const PIO_Offset recnum, const short *op) |
Put distributed array subset of a 16-bit integer variable. More... | |
int | PIOc_put_vard_uint (int ncid, int varid, int decompid, const PIO_Offset recnum, const unsigned int *op) |
Put distributed array subset of an unsigned integer variable. More... | |
int | PIOc_put_vard_int (int ncid, int varid, int decompid, const PIO_Offset recnum, const int *op) |
Put distributed array subset of an integer variable. More... | |
int | PIOc_put_vard_float (int ncid, int varid, int decompid, const PIO_Offset recnum, const float *op) |
Put distributed array subset of a floating point variable. More... | |
int | PIOc_put_vard_longlong (int ncid, int varid, int decompid, const PIO_Offset recnum, const long long *op) |
Put distributed array subset of a 64-bit unsigned integer variable. More... | |
int | PIOc_put_vard_double (int ncid, int varid, int decompid, const PIO_Offset recnum, const double *op) |
Put distributed array subset of a 64-bit floating point variable. More... | |
int | PIOc_put_vard_ulonglong (int ncid, int varid, int decompid, const PIO_Offset recnum, const unsigned long long *op) |
Put distributed array subset of an unsigned 64-bit integer variable. More... | |
int | PIOc_put_vard (int ncid, int varid, int decompid, const PIO_Offset recnum, const void *op) |
Write distributed array subset of a variable of any type. More... | |
int | nc_put_vard_text (int ncid, int varid, int decompid, const size_t recnum, const char *op) |
Put distributed array subset of a text variable. More... | |
int | nc_put_vard_uchar (int ncid, int varid, int decompid, const size_t recnum, const unsigned char *op) |
Put distributed array subset of an unsigned char variable. More... | |
int | nc_put_vard_schar (int ncid, int varid, int decompid, const size_t recnum, const signed char *op) |
Put distributed array subset of a signed char variable. More... | |
int | nc_put_vard_ushort (int ncid, int varid, int decompid, const size_t recnum, const unsigned short *op) |
Put distributed array subset of an unsigned 16-bit integer variable. More... | |
int | nc_put_vard_short (int ncid, int varid, int decompid, const size_t recnum, const short *op) |
Put distributed array subset of a 16-bit integer variable. More... | |
int | nc_put_vard_uint (int ncid, int varid, int decompid, const size_t recnum, const unsigned int *op) |
Put distributed array subset of an unsigned integer variable. More... | |
int | nc_put_vard_int (int ncid, int varid, int decompid, const size_t recnum, const int *op) |
Put distributed array subset of an integer variable. More... | |
int | nc_put_vard_float (int ncid, int varid, int decompid, const size_t recnum, const float *op) |
Put distributed array subset of a floating point variable. More... | |
int | nc_put_vard_longlong (int ncid, int varid, int decompid, const size_t recnum, const long long *op) |
Put distributed array subset of a 64-bit unsigned integer variable. More... | |
int | nc_put_vard_double (int ncid, int varid, int decompid, const size_t recnum, const double *op) |
Put distributed array subset of a 64-bit floating point variable. More... | |
int | nc_put_vard_ulonglong (int ncid, int varid, int decompid, const size_t recnum, const unsigned long long *op) |
Put distributed array subset of an unsigned 64-bit integer variable. More... | |
int | nc_put_vard (int ncid, int varid, int decompid, const size_t recnum, const void *op) |
Write distributed array subset of a variable of any type. More... | |
Write data from a distributed array to a netCDF file in C.
Write distributed arrays to a Variable in C.
int find_var_fillvalue | ( | file_desc_t * | file, |
int | varid, | ||
var_desc_t * | vdesc | ||
) |
Find the fillvalue that should be used for a variable.
file | Info about file we are writing to. |
varid | the variable ID. |
vdesc | pointer to var_desc_t info for this var. |
int nc_put_vard | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const void * | op | ||
) |
Write distributed array subset of a variable of any type.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_double | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const double * | op | ||
) |
Put distributed array subset of a 64-bit floating point variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_float | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const float * | op | ||
) |
Put distributed array subset of a floating point variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_int | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const int * | op | ||
) |
Put distributed array subset of an integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_longlong | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const long long * | op | ||
) |
Put distributed array subset of a 64-bit unsigned integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_schar | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const signed char * | op | ||
) |
Put distributed array subset of a signed char variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_short | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const short * | op | ||
) |
Put distributed array subset of a 16-bit integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_text | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const char * | op | ||
) |
Put distributed array subset of a text variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_uchar | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const unsigned char * | op | ||
) |
Put distributed array subset of an unsigned char variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_uint | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const unsigned int * | op | ||
) |
Put distributed array subset of an unsigned integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_ulonglong | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const unsigned long long * | op | ||
) |
Put distributed array subset of an unsigned 64-bit integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int nc_put_vard_ushort | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const size_t | recnum, | ||
const unsigned short * | op | ||
) |
Put distributed array subset of an unsigned 16-bit integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const void * | op | ||
) |
Write distributed array subset of a variable of any type.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_double | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const double * | op | ||
) |
Put distributed array subset of a 64-bit floating point variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_float | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const float * | op | ||
) |
Put distributed array subset of a floating point variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_int | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const int * | op | ||
) |
Put distributed array subset of an integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_longlong | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const long long * | op | ||
) |
Put distributed array subset of a 64-bit unsigned integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_schar | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const signed char * | op | ||
) |
Put distributed array subset of a signed char variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_short | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const short * | op | ||
) |
Put distributed array subset of a 16-bit integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_text | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const char * | op | ||
) |
Put distributed array subset of a text variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_uchar | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const unsigned char * | op | ||
) |
Put distributed array subset of an unsigned char variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_uint | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const unsigned int * | op | ||
) |
Put distributed array subset of an unsigned integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_ulonglong | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const unsigned long long * | op | ||
) |
Put distributed array subset of an unsigned 64-bit integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_put_vard_ushort | ( | int | ncid, |
int | varid, | ||
int | decompid, | ||
const PIO_Offset | recnum, | ||
const unsigned short * | op | ||
) |
Put distributed array subset of an unsigned 16-bit integer variable.
This routine is called collectively by all tasks in the communicator ios.union_comm.
ncid | identifies the netCDF file |
varid | the variable ID number |
decompid | the decomposition ID. |
recnum | the record number. |
op | pointer to the data to be written. |
int PIOc_write_darray | ( | int | ncid, |
int | varid, | ||
int | ioid, | ||
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.
Internally, this function will:
NOTE: The write multi buffer wmulti_buffer is the cache on compute nodes that will collect and store multiple variables before sending them to the io nodes. Aggregating variables in this way leads to a considerable savings in communication expense. Variables in the wmb array must have the same decomposition and base data size and we also need to keep track of whether each is a recordvar (has an unlimited dimension) or not.
ncid | the ncid of the open netCDF file. |
varid | the ID of the variable that these data will be written to. |
ioid | the I/O description ID as passed back by PIOc_InitDecomp(). |
arraylen | the length of the array to be written. This should be at least the length of the local component of the distrubited array. (Any values beyond length of the local component will be ignored.) |
array | pointer to an array of length arraylen with the data to be written. This is a pointer to the distributed portion of the array that is on this task. |
fillvalue | pointer to the fill value to be used for missing data. |
int PIOc_write_darray_multi | ( | int | ncid, |
const int * | varids, | ||
int | ioid, | ||
int | nvars, | ||
PIO_Offset | arraylen, | ||
void * | array, | ||
const int * | frame, | ||
void ** | fillvalue, | ||
bool | flushtodisk | ||
) |
Write one or more arrays with the same IO decomposition to the file.
This funciton is similar to PIOc_write_darray(), but allows the caller to use their own data buffering (instead of using the buffering implemented in PIOc_write_darray()).
When the user calls PIOc_write_darray() one or more times, then PIO_write_darray_multi() will be called when the buffer is flushed.
Internally, this function will:
ncid | identifies the netCDF file. |
varids | an array of length nvars containing the variable ids to be written. |
ioid | the I/O description ID as passed back by PIOc_InitDecomp(). |
nvars | the number of variables to be written with this call. |
arraylen | the 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. The same arraylen is used for all variables in the call. |
array | pointer to the data to be written. This is a pointer to an array of arrays with the distributed portion of the array that is on this processor. There are nvars arrays of data, and each array of data contains one record worth of data for that variable. |
frame | an array of length nvars with the frame or record dimension for each of the nvars variables in IOBUF. NULL if this iodesc contains non-record vars. |
fillvalue | pointer an array (of length nvars) of pointers to the fill value to be used for missing data. |
flushtodisk | non-zero to cause buffers to be flushed to disk. |