![]() |
SIONlib
2.0.0-rc.3
Scalable I/O library for parallel access to task-local files
|
Open (and close) SIONlib files from a single task. More...
Typedefs | |
typedef struct sion_options | sion_options |
Holds non-essential arguments for sion_open() . More... | |
typedef struct sion_rank_options | sion_rank_options |
Holds non-essential arguments for sion_open_rank() . More... | |
Functions | |
int | sion_open (const char *fname, sion_open_mode mode, int n, const sion_options *options) |
Open a SIONlib container in serial mode. More... | |
int | sion_open_rank (const char *fname, sion_open_mode mode, int rank, const sion_rank_options *options) |
Open a single logical file in a SIONlib container. More... | |
int | sion_close (int sid) |
Close a SIONlib file. More... | |
sion_options * | sion_options_new (void) |
Allocates and initializes an instance of sion_options More... | |
void | sion_options_delete (sion_options *options) |
Delete an instance of sion_options More... | |
void | sion_options_set_chunksizes (sion_options *options, int n, const int64_t chunksizes[]) |
Set the chunk sizes of all logical files in the container. More... | |
void | sion_options_set_fsblksize (sion_options *options, int32_t fsblksize) |
Set the file system block size to assume. More... | |
void | sion_options_set_keyval_mode (sion_options *options, sion_keyval_mode keyval_mode) |
Set the key-value mode to use for a container. More... | |
void | sion_options_set_lowlevel_api (sion_options *options, sion_lowlevel_api lowlevel_api) |
Set the low-level API to use for opening a container. More... | |
void | sion_options_set_endianness (sion_options *options, sion_endianness endianness) |
Set the endianness for the contents of a container. More... | |
sion_rank_options * | sion_rank_options_new (void) |
Allocates and initializes an instance of sion_rank_options More... | |
void | sion_rank_options_delete (sion_rank_options *options) |
Delete an instance of sion_rank_options More... | |
void | sion_rank_options_set_lowlevel_api (sion_rank_options *options, sion_lowlevel_api lowlevel_api) |
Set the low-level API to use for opening a container. More... | |
Open (and close) SIONlib files from a single task.
typedef struct sion_options sion_options |
Holds non-essential arguments for sion_open()
.
These are:
Definition at line 1 of file sion_serial.h.
typedef struct sion_rank_options sion_rank_options |
Holds non-essential arguments for sion_open_rank()
.
Currently, only the low-level API to use for file system access can be selected.
Definition at line 1 of file sion_serial.h.
int sion_close | ( | int | sid | ) |
Close a SIONlib file.
This function closes a SIONlib file which was opened in serial mode with sion_open()
or sion_open_rank()
. In write mode this function will also save all meta data to the meta data block of the SIONlib file.
The function is a task local function, which can be called independently from other MPI tasks.
[in] | sid | SIONlib file handle |
Definition at line 102 of file sion_serial.c.
int sion_open | ( | const char * | fname, |
sion_open_mode | mode, | ||
int | n, | ||
const sion_options * | options | ||
) |
Open a SIONlib container in serial mode.
This function opens all logical files of a SIONlib container in serial mode. The meta-data of all logical files will be loaded into memory, which allows accessing different logical files by using sion_switch_logical_file()
. Default position of the file pointer is in front of the first byte of the first logical file
In the case of multi-file containers sion_open()
internally opens each physical file with sion_open()
recursively. For each physical file SIONlib manages an individual file descriptor and data structure.
[in] | fname | name of the container to open |
[in] | mode | mode in which to open the container |
[in] | n | number of logical files in the container (only significant upon container creation) |
[in] | options | provide additional options, or NULL |
Definition at line 61 of file sion_serial.c.
int sion_open_rank | ( | const char * | fname, |
sion_open_mode | mode, | ||
int | rank, | ||
const sion_rank_options * | options | ||
) |
Open a single logical file in a SIONlib container.
This function opens single logical file in a container. It can be used to open the container independently from each task (e.g. if no MPI is available or only a subset of tasks need access).
Using this function the meta data at the beginning of the container is read by each task instead of just once and distributed (sion_paropen_XYZ
). sion_open_rank()
only reads the meta data that pertains to the selected logical file.
[in] | fname | name of the container to open |
[in] | mode | mode in which to open the container |
[in] | rank | number of logical file to open in the container |
[in] | options | provide additional options, or NULL |
Definition at line 97 of file sion_serial.c.
void sion_options_delete | ( | sion_options * | options | ) |
Delete an instance of sion_options
[in] | options | a pointer to the instance to delete |
Definition at line 30 of file sion_serial.c.
sion_options* sion_options_new | ( | void | ) |
Allocates and initializes an instance of sion_options
NULL
if allocation failed Definition at line 21 of file sion_serial.c.
void sion_options_set_chunksizes | ( | sion_options * | options, |
int | n, | ||
const int64_t | chunksizes[] | ||
) |
Set the chunk sizes of all logical files in the container.
[in,out] | options | an options object |
[in] | n | number of logical files in the container |
[in] | chunksizes | chunk sizes for all logical files in the container |
Definition at line 35 of file sion_serial.c.
void sion_options_set_endianness | ( | sion_options * | options, |
sion_endianness | endianness | ||
) |
Set the endianness for the contents of a container.
[in,out] | options | an options object |
[in] | endianness | the endianness of the contents |
Definition at line 56 of file sion_serial.c.
void sion_options_set_fsblksize | ( | sion_options * | options, |
int32_t | fsblksize | ||
) |
Set the file system block size to assume.
[in,out] | options | an options object |
[in] | fsblksize | the file system block size |
Definition at line 41 of file sion_serial.c.
void sion_options_set_keyval_mode | ( | sion_options * | options, |
sion_keyval_mode | keyval_mode | ||
) |
Set the key-value mode to use for a container.
[in,out] | options | an options object |
[in] | keyval_mode | the key-value mode to use |
Definition at line 46 of file sion_serial.c.
void sion_options_set_lowlevel_api | ( | sion_options * | options, |
sion_lowlevel_api | lowlevel_api | ||
) |
Set the low-level API to use for opening a container.
[in,out] | options | an options object |
[in] | lowlevel_api | the low-level API to use |
Definition at line 51 of file sion_serial.c.
void sion_rank_options_delete | ( | sion_rank_options * | options | ) |
Delete an instance of sion_rank_options
[in] | options | a pointer to the instance to delete |
Definition at line 87 of file sion_serial.c.
sion_rank_options* sion_rank_options_new | ( | void | ) |
Allocates and initializes an instance of sion_rank_options
NULL
if allocation failed Definition at line 78 of file sion_serial.c.
void sion_rank_options_set_lowlevel_api | ( | sion_rank_options * | options, |
sion_lowlevel_api | lowlevel_api | ||
) |
Set the low-level API to use for opening a container.
[in,out] | options | an options object |
[in] | lowlevel_api | the low-level API to use |
Definition at line 92 of file sion_serial.c.