SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
Functions
SIONlib API Common

Functions

int sion_get_locations (int sid, int *ntasks, int *maxchunks, sion_int64 *globalskip, sion_int64 *start_of_varheader, sion_int64 **sion_chunksizes, sion_int64 **sion_globalranks, sion_int64 **sion_blockcount, sion_int64 **sion_blocksizes)
 Returns pointers to internal fields. More...
 
int sion_get_current_location (int sid, int *currentchunknr, sion_int64 *currentpos, int *maxchunks, sion_int64 **chunksizes)
 Returns current position in file and pointer fiels containing chunk sizes. More...
 
int sion_get_mapping (int sid, int *mapping_size, sion_int32 **mapping, int *numfiles)
 Returns pointers to the internal field mapping. More...
 
int sion_get_file_endianness (int sid)
 Returns edianness of data in file sid. More...
 
int sion_endianness_swap_needed (int sid)
 Returns whether or not byte swapping is needed for sid. More...
 
int sion_get_current_locations (int sid, int *ntasks, sion_int64 **sion_currentpos, sion_int64 **sion_currentblocknr)
 Returns current position in file and pointer fiels containing chunk sizes. More...
 
size_t sion_fwrite (const void *data, size_t size, size_t nitems, int sid)
 Write data to sion file. More...
 
size_t sion_fread (void *data, size_t size, size_t nitems, int sid)
 Read data from sion file. More...
 

Detailed Description

Common functions of the SIONlib API

Function Documentation

◆ sion_endianness_swap_needed()

int sion_endianness_swap_needed ( int  sid)

Returns whether or not byte swapping is needed for sid.

Parameters
[in]sidsion file handle
Returns
1-> swap needed, 0-> no swap needed

Definition at line 277 of file sion_common.c.

Referenced by fsion_endianness_swap_needed_c().

◆ sion_fread()

size_t sion_fread ( void *  data,
size_t  size,
size_t  nitems,
int  sid 
)

Read data from sion file.

This is the basic function for reading data from the underlying storage.

Parameters
[out]datapointer to data to be written
[in]sizesize of a single item
[in]nitemsnumber of items to be written
[in]sidsion file id to be written to
Returns
number of elements read
Examples
simple/sionpar.c, and simple/sionser.c.

Definition at line 609 of file sion_common.c.

References _sion_vcdtovcon(), _sion_vcdtype(), and SION_FILEDESCRIPTOR.

◆ sion_fwrite()

size_t sion_fwrite ( const void *  data,
size_t  size,
size_t  nitems,
int  sid 
)

Write data to sion file.

See sion_fwrite_description

Parameters
[in]datapointer to data to be written
[in]sizesize of a single item
[in]nitemsnumber of items to be written
[in]sidsion file id to be written to
Returns
number of elements written
Examples
simple/sionpar.c, and simple/sionser.c.

Definition at line 470 of file sion_common.c.

◆ sion_get_current_location()

int sion_get_current_location ( int  sid,
int *  currentchunknr,
sion_int64 *  currentpos,
int *  maxchunks,
sion_int64 **  chunksizes 
)

Returns current position in file and pointer fiels containing chunk sizes.

Returns current position in file and pointer fiels containing chunk sizes. This function is only needed if the sion file was opened for reading in parallel mode (sion_paropen..., sion_open_rank).

Parameters
[in]sidsion file handle
[out]currentchunknrnumber of current block in the file
[out]currentposposition in current block in the file
[out]maxchunksnumber of last block in the file
[out]chunksizesfield containing chunk size of each task
Returns
SION_SUCCESS if ok

Definition at line 185 of file sion_common.c.

◆ sion_get_current_locations()

int sion_get_current_locations ( int  sid,
int *  ntasks,
sion_int64 **  sion_currentpos,
sion_int64 **  sion_currentblocknr 
)

Returns current position in file and pointer fiels containing chunk sizes.

Returns current position in file and pointer fiels containing chunk sizes. This function is only needed if the sion file was opened for reading in parallel mode (sion_paropen..., sion_open_rank).

Parameters
[in]sidsion file handle
[out]ntasksnumber of tasks
[out]sion_currentposcurrent positions for all ranks
[out]sion_currentblocknrcurrent block number for all ranks
Returns
SION_SUCCESS if ok

Definition at line 307 of file sion_common.c.

◆ sion_get_file_endianness()

int sion_get_file_endianness ( int  sid)

Returns edianness of data in file sid.

Parameters
[in]sidsion file handle
Returns
1-> big endian, 0-> little endian

Definition at line 253 of file sion_common.c.

Referenced by fsion_get_file_endianness_c().

◆ sion_get_locations()

int sion_get_locations ( int  sid,
int *  ntasks,
int *  maxchunks,
sion_int64 *  globalskip,
sion_int64 *  start_of_varheader,
sion_int64 **  sion_chunksizes,
sion_int64 **  sion_globalranks,
sion_int64 **  sion_blockcount,
sion_int64 **  sion_blocksizes 
)

Returns pointers to internal fields.

See sion_get_locations_description .

Parameters
[in]sidsion file handle
[out]ntasksnumber of tasks which wrote to the sion file
[out]maxchunksmaximum number of blocks in the file
[out]globalskipdistance in bytes between the first bytes of two subsequent chunks of a task
[out]start_of_varheaderstart position of the meta data block at the end of sion file
[out]sion_chunksizesfield containing requested chunk size of each task access: sion_chunksizes[size*chunknr+rank]
[out]sion_globalranksfield containing global unique id of each task
[out]sion_blockcountfield containing number of blocks used by each task
[out]sion_blocksizesfield containing for each task and block the number of bytes used in this chunk e.g. access: sion_blocksizes[size*blocknr+rank]
Returns
SION_SUCCESS if ok

Definition at line 84 of file sion_common.c.

Referenced by fsion_get_locations_c().

◆ sion_get_mapping()

int sion_get_mapping ( int  sid,
int *  mapping_size,
sion_int32 **  mapping,
int *  numfiles 
)

Returns pointers to the internal field mapping.

This function is only needed if the sion file was opened for reading in serial mode.

Parameters
[in]sidsion file handle
[out]mapping_sizesize of mapping vector
[out]mappingpointer to mapping vector
[out]numfilespointer to mapping vector
Returns
SION_SUCCESS if ok

Definition at line 219 of file sion_common.c.