SIONlib
1.7.7
Scalable I/O library for parallel access to task-local files
|
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include "sion.h"
#include "sion_debug.h"
#include "sion_error_handler.h"
#include "sion_internal.h"
#include "sion_metadata.h"
#include "sion_filedesc.h"
#include "sion_tools.h"
#include "sion_fd.h"
#include "sion_file.h"
#include "sion_hints.h"
#include "sion_printts.h"
#include "sion_keyvalue.h"
#include "sion_buffer.h"
#include "sion_flags.h"
#include "sion_internal_startptr.h"
Go to the source code of this file.
Macros | |
#define | _XOPEN_SOURCE 700 |
#define | DFUNCTION "_sion_getenv" |
Functions | |
int | _sion_open (const char *fname, const char *file_mode, int *ntasks, int *nfiles, sion_int64 **chunksizes, sion_int32 *fsblksize, int **globalranks, FILE **fileptr) |
int | _sion_open_write (const char *fname, sion_int64 file_mode_flags, int *ntasks, int *nfiles, sion_int64 **chunksizes, sion_int32 *fsblksize, int **globalranks, FILE **fileptr) |
internal sion serial open function for writing on one file More... | |
int | _sion_open_read (const char *fname, sion_int64 file_mode_flags, int read_all, int *ntasks, int *nfiles, sion_int64 **chunksizes, sion_int32 *fsblksize, int **globalranks, FILE **fileptr) |
internal sion serial open function for reading on one or more files More... | |
int | _sion_open_read_single (const char *fname, sion_int64 file_mode_flags, int *ntasks, int *nfiles, sion_int64 **chunksizes, sion_int32 *fsblksize, int **globalranks, FILE **fileptr, _sion_filedesc *sion_filedesc) |
int | _sion_open_read_master (const char *fname, sion_int64 file_mode_flags, int *ntasks, int *nfiles, sion_int64 **chunksizes, sion_int32 *fsblksize, int **globalranks, FILE **fileptr, _sion_filedesc *sion_filedesc) |
int | _sion_open_rank (const char *fname, const char *file_mode, sion_int64 *chunksize, sion_int32 *fsblksize, int *rank, FILE **fileptr) |
int | _sion_close (_sion_filedesc *sion_filedesc) |
char * | _sion_get_multi_filename (const char *fname, int filenumber) |
generates the multi filename More... | |
int | _sion_flush_file (int sid) |
Flush the data to the disk for the current task. More... | |
int | _sion_update_fileposition (_sion_filedesc *sion_filedesc) |
Update the internal data structure (check fileposition) More... | |
int | _sion_check_on_collective_mode (_sion_filedesc *sion_filedesc) |
check if a collective operation are already called, More... | |
int | _sion_flush_block (_sion_filedesc *sion_filedesc) |
Update the internal data structure. More... | |
int | _sion_create_new_block (_sion_filedesc *sion_filedesc) |
Create a new block for the internal data structure. More... | |
sion_int32 | _sion_get_endianness_with_flags (sion_int64 flags) |
Return endianness including possible choice via flags. More... | |
char * | _sion_getenv (const char *name) |
sion_io_stat_t * | _sion_alloc_io_info (int p_nf) |
allocates an io_info data structure for nfiles files More... | |
int | _sion_free_io_info (sion_io_stat_t *p) |
frees an io_info data structure More... | |
sion_io_stat_t* _sion_alloc_io_info | ( | int | p_nf | ) |
allocates an io_info data structure for nfiles files
return flags
Definition at line 1211 of file sion_internal.c.
int _sion_check_on_collective_mode | ( | _sion_filedesc * | sion_filedesc | ) |
check if a collective operation are already called,
*sion_filedesc | sion file description struct (_sion_filedesc) |
SION_SUCCESS | if OK |
Definition at line 1017 of file sion_internal.c.
int _sion_create_new_block | ( | _sion_filedesc * | sion_filedesc | ) |
Create a new block for the internal data structure.
sion_filedesc | sion file handle |
SION_SUCCESS | if OK |
Definition at line 1089 of file sion_internal.c.
int _sion_flush_block | ( | _sion_filedesc * | sion_filedesc | ) |
Update the internal data structure.
*sion_filedesc | sion file description struct (_sion_filedesc) |
1 | if OK |
Definition at line 1050 of file sion_internal.c.
int _sion_flush_file | ( | int | sid | ) |
Flush the data to the disk for the current task.
sid | sion file handle |
SION_SUCCESS | if OK |
Definition at line 960 of file sion_internal.c.
int _sion_free_io_info | ( | sion_io_stat_t * | p | ) |
sion_int32 _sion_get_endianness_with_flags | ( | sion_int64 | flags | ) |
Return endianness including possible choice via flags.
return endianness
Definition at line 1158 of file sion_internal.c.
char* _sion_get_multi_filename | ( | const char * | fname, |
int | filenumber | ||
) |
generates the multi filename
fname | file name |
filenumber | file number |
pointer | to new filename |
Definition at line 929 of file sion_internal.c.
char* _sion_getenv | ( | const char * | name | ) |
encapsulate getenv
Definition at line 1187 of file sion_internal.c.
int _sion_open_read | ( | const char * | fname, |
sion_int64 | file_mode_flags, | ||
int | read_all, | ||
int * | ntasks, | ||
int * | nfiles, | ||
sion_int64 ** | chunksizes, | ||
sion_int32 * | fsblksize, | ||
int ** | globalranks, | ||
FILE ** | fileptr | ||
) |
internal sion serial open function for reading on one or more files
[in] | fname | name of file, should equal on all tasks |
[in,out] | file_mode_flags | like the type parameter of fopen (currently recognized options: "rb", "wb") |
[in,out] | read_all | 1 all files of a multi-file will be read, 0 only the master will read, incl. mapping |
[in,out] | ntasks | number of tasks used to write this file |
[in,out] | nfiles | number of physical files |
[in,out] | chunksizes | chunksize for each task |
[in,out] | fsblksize | blocksize of filesystem, must be equal on all processors |
[in] | globalranks | rank numbers for which the file should be open; will be stored in sion file, useful if comm is not MPI_COMM_WORLD typical: globalrank= rank in MPI_COMM_WORLD |
[out] | fileptr | filepointer for this task |
Definition at line 266 of file sion_internal.c.
References _sion_alloc_filedesc().
int _sion_open_write | ( | const char * | fname, |
sion_int64 | file_mode_flags, | ||
int * | ntasks, | ||
int * | nfiles, | ||
sion_int64 ** | chunksizes, | ||
sion_int32 * | fsblksize, | ||
int ** | globalranks, | ||
FILE ** | fileptr | ||
) |
internal sion serial open function for writing on one file
[in] | fname | name of file, should equal on all tasks |
[in,out] | file_mode_flags | like the type parameter of fopen (currently recognized options: "rb", "wb") |
[in,out] | ntasks | number of tasks used to write this file |
[in,out] | nfiles | number of physical files |
[in,out] | chunksizes | chunksize for each task |
[in,out] | fsblksize | blocksize of filesystem, must be equal on all processors |
[in] | globalranks | rank numbers for which the file should be open; will be stored in sion file, useful if comm is not MPI_COMM_WORLD typical: globalrank= rank in MPI_COMM_WORLD |
[out] | fileptr | filepointer for this task |
sid | sion file handle or -1 if error occured |
Definition at line 106 of file sion_internal.c.
int _sion_update_fileposition | ( | _sion_filedesc * | sion_filedesc | ) |
Update the internal data structure (check fileposition)
Update is only performed if file pointer is exported. The body of the function is skipped otherwise.
*sion_filedesc | sion file description struct (_sion_filedesc) |
SION_SUCCESS | if OK |
Definition at line 984 of file sion_internal.c.