ParallelIO
Macros | Functions | Variables
pioc_support.c File Reference

Support functions. More...

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

Macros

#define versno   2001
 

Functions

int PIOc_strerror (int pioerr, char *errmsg)
 Return a string description of an error code. More...
 
int PIOc_set_log_level (int level)
 Set the logging level. More...
 
void pio_get_env (void)
 Get PIO environment variables. More...
 
void print_trace (FILE *fp)
 
void piomemerror (iosystem_desc_t ios, size_t req, char *fname, const int line)
 
void piodie (const char *msg, const char *fname, const int line)
 
void pioassert (_Bool expression, const char *msg, const char *fname, const int line)
 
int check_mpi (file_desc_t *file, const int mpierr, const char *filename, const int line)
 Handle MPI errors. More...
 
int check_netcdf (file_desc_t *file, int status, const char *fname, const int line)
 Check the result of a netCDF API call. More...
 
int iotype_error (const int iotype, const char *fname, const int line)
 
io_regionalloc_region (const int ndims)
 
io_desc_tmalloc_iodesc (const int piotype, const int ndims)
 
void free_region_list (io_region *top)
 
int PIOc_freedecomp (int iosysid, int ioid)
 
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)
 

Variables

bool PIO_Save_Decomps =false
 

Detailed Description

Support functions.

Function Documentation

§ check_mpi()

int check_mpi ( file_desc_t file,
const int  mpierr,
const char *  filename,
const int  line 
)

Handle MPI errors.

An error message is sent to stderr, then the check_netcdf() function is called with PIO_EIO.

Parameters
filepointer to the file_desc_t info. May be NULL, in which case check_netcdf() is not called.
mpierrthe MPI return code to handle
filenamethe name of the code file where error occured.
linethe line of code where error occured.
Returns
PIO_NOERR for no error, otherwise PIO_EIO.

§ check_netcdf()

int check_netcdf ( file_desc_t file,
int  status,
const char *  fname,
const int  line 
)

Check the result of a netCDF API call.

Parameters
filepointer to the PIO structure describing this file.
statusthe return value from the netCDF call.
fnamethe name of the code file.
linethe line number of the netCDF call in the code.
Returns
the error code

§ pio_get_env()

void pio_get_env ( void  )

Get PIO environment variables.

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