SIONlib  2.0.0-rc.1
Scalable I/O library for parallel access to task-local files
Data Structures | Functions
Serial API

Open (and close) SIONlib files from a single task. More...

Data Structures

struct  sion_options
 

Functions

int sion_open (char *fname, const char *file_mode, int *ntasks, int *nfiles, int64_t **chunksizes, int32_t *fsblksize, int **globalranks, FILE **fileptr)
 Open a sion file in serial mode. More...
 
int sion_open_rank (char *fname, const char *file_mode, int64_t *chunksize, int32_t *fsblksize, int *rank, FILE **fileptr)
 Open a sion file for a specific rank. More...
 
int sion_close (int sid)
 Close a sion file. More...
 
sion_options sion_options_new ()
 
void sion_options_set_chunksizes (sion_options *options, int n, int64_t chunksizes[])
 
void sion_options_set_fsblksize (sion_options *options, int32_t fsblksize)
 
void sion_options_set_multifile_number (sion_options *options, int multifile_number)
 
void sion_options_set_keyval_mode (sion_options *options, sion_keyval_mode keyval_mode)
 
void sion_options_set_lowlevel_api (sion_options *options, sion_lowlevel_api lowlevel_api)
 
int sion_open_with_options (const char *fname, sion_open_mode mode, int n, const sion_options *options)
 

Detailed Description

Open (and close) SIONlib files from a single task.

See also
API Overview

Function Documentation

◆ sion_close()

int sion_close ( int  sid)

Close a sion file.

See sion_close_description .

Parameters
[in]sidsion file handle
Returns
SION_SUCCESS if close is ok

Definition at line 58 of file sion_serial.c.

◆ sion_open()

int sion_open ( char *  fname,
const char *  file_mode,
int *  ntasks,
int *  nfiles,
int64_t **  chunksizes,
int32_t *  fsblksize,
int **  globalranks,
FILE **  fileptr 
)

Open a sion file in serial mode.

See sion_open_description.

Parameters
[in]fnamename of file, should be equal on all tasks
[in]file_modelike the type parameter of fopen. See file_mode_description .
[in,out]ntasksnumber of tasks used to write this file
[in,out]nfilesnumber of physical files
[in,out]chunksizeschunksize for each task
[in,out]fsblksizeblocksize of filesystem, must be equal on all processors
[in]globalranksrank numbers for which the file should be opened; will be stored in sion file, useful if comm is not MPI_COMM_WORLD typical: globalrank = rank in MPI_COMM_WORLD
[out]fileptrfile pointer for this task
Return values
sidsion file handle or -1 if error occured

Definition at line 26 of file sion_serial.c.

◆ sion_open_rank()

int sion_open_rank ( char *  fname,
const char *  file_mode,
int64_t *  chunksize,
int32_t *  fsblksize,
int *  rank,
FILE **  fileptr 
)

Open a sion file for a specific rank.

See sion_open_rank_description

Parameters
[in]fnamename of file, should be equal on all tasks
[in,out]file_modelike the type parameter of fopen (currently recognized options: "rb", "wb")
[in,out]chunksizechunksize for this task
[in,out]fsblksizeblocksize of filesystem, must be equal on all processors
[in]rankrank number for which the file should be open; will be stored in sion file, usefull if comm is not MPI_COMM_WORLD typical: globalrank= rank in MPI_COMM_WORLD
[out]fileptrfile pointer for this task
Return values
sidsion file handle or -1 if error occured

Definition at line 45 of file sion_serial.c.