|  | SIONlib
    1.7.7
    Scalable I/O library for parallel access to task-local files | 
Go to the source code of this file.
| Data Structures | |
| struct | _sion_key_stat_struct | 
| struct | _sion_io_stat_struct | 
| Macros | |
| #define | SION_SERIAL_MASTER | 
| #define | SION_MAX_FSBLOCKSIZE 32*1024*1024 | 
| #define | SION_DEFAULT_FSBLOCKSIZE 2*1024*1024 | 
| #define | SION_FILENAME_LENGTH 1024 | 
| #define | MAXCHUNKS 100 | 
| #define | WFLARGEMETABLOCK_none /* for BENCHMARKING only */ | 
| #define | _sion_stat_file _sion_file_stat_file | 
| #define | DPRINTF(A) | 
| #define | DPRINTFP(A) | 
| #define | DPRINTTS(A, B) | 
| #define | DPRINTFTS2(A, B) | 
| Typedefs | |
| typedef struct _sion_key_stat_struct | sion_key_stat_t | 
| typedef struct _sion_io_stat_struct | sion_io_stat_t | 
| Functions | |
| int | _sion_close_sid (int sid) | 
| 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... | |
| size_t | sion_fwrite_key (const void *data, uint64_t key, size_t size, size_t nitems, int sid) | 
| Writes data for key.  More... | |
| size_t | sion_fread_key (void *data, uint64_t key, size_t size, size_t nitems, int sid) | 
| Read data for key.  More... | |
| int | sion_fread_key_iterator_reset (int sid) | 
| Resets key iterator.  More... | |
| int | sion_fread_key_iterator_next (int sid, uint64_t *key, size_t *size) | 
| Forward to next key.  More... | |
| int | sion_seek_key (int sid, uint64_t key, int entrynum, sion_int64 posinentry) | 
| Seek to position in key.  More... | |
| int | sion_key_full_scan (int sid) | 
| Performs a full scan of all meta data in current file.  More... | |
| int | sion_key_list_iterator_reset (int sid) | 
| Resets key iterator.  More... | |
| int | sion_key_list_iterator_next (int sid, uint64_t *keyptr) | 
| Forward to next key.  More... | |
| int | sion_key_get_stat (int sid, uint64_t key, sion_key_stat_t *stat) | 
| get statistics about key  More... | |
| int | sion_feof (int sid) | 
| Function that indicates whether the end of file is reached for this task.  More... | |
| int | sion_ensure_free_space (int sid, sion_int64 bytes) | 
| Funtion to ensure that enough space is available for writing.  More... | |
| int | sion_flush (int sid) | 
| Flushed sion file.  More... | |
| int | sion_get_sizeof (int sid, int *numbytes, int *numfds) | 
| Function returns size of internal data structure for sid.  More... | |
| int | sion_dup (int sid, int mode, int rank, uint64_t key) | 
| Function which duplicates a sion file descriptor.  More... | |
| int | sion_dedup (int sid) | 
| Function which destroy a duplicated sion file descriptor.  More... | |
| int | sion_set_fp_closed (int sid) | 
| int | sion_set_second_fp (int sid, FILE *fp) | 
| int | sion_unset_second_fp (int sid) | 
| FILE * | sion_get_fp (int sid) | 
| int | sion_get_fd (int sid) | 
| int | sion_optimize_fp_buffer (int sid) | 
| 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... | |
| sion_int64 | sion_get_bytes_written (int sid) | 
| sion_int64 | sion_get_bytes_read (int sid) | 
| sion_int64 | sion_bytes_avail_in_block (int sid) | 
| Return the number of bytes available in the current chunk.  More... | |
| sion_int64 | sion_bytes_avail_in_chunk (int sid) | 
| Function that returns the number of bytes available in the current chunk.  More... | |
| sion_int64 | sion_get_position (int sid) | 
| Function that returns the current file position.  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_locations (int sid, int *ntasks, int *maxblocks, 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 *currentblock, sion_int64 *currentpos, int *maxchunks, sion_int64 **chunksizes) | 
| Returns current position in file and pointer fiels containing chunk sizes.  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... | |
| int | sion_get_number_of_files (int sid) | 
| int | sion_get_filenumber (int sid) | 
| int | sion_is_serial_opened (int sid) | 
| int | sion_using_hints (int sid) | 
| int | sion_get_endianness (void) | 
| Return endianness.  More... | |
| int | sion_is_thread_safe (void) | 
| int | sion_get_keyval_mode (int sid) | 
| Return selected mode for key value.  More... | |
| char * | sion_keyval_type_to_str (int type) | 
| Returns key value mode as string.  More... | |
| int | sion_get_version (int *main_version, int *sub_version, int *patch_level, int *fileformat_version) | 
| Return version numbers.  More... | |
| sion_io_stat_t * | sion_get_io_info (int sid) | 
| sion_io_stat_t * | sion_get_io_info_by_spec (int sid, int roles, int flag) | 
| int | sion_free_io_info (sion_io_stat_t *info) | 
| int | sion_seek (int sid, int rank, int currentblocknr, sion_int64 posinblk) | 
| Function to set the file pointer to a new position.  More... | |
| int | sion_seek_fp (int sid, int rank, int currentblocknr, sion_int64 posinblk, FILE **fileptr) | 
| Deprecated. Use sion_seek() instead.  More... | |
| int | sion_lock_register_lock_callbacks (int lock(void *), int unlock(void *), void *lock_data) | 
| Function which registers callback funtions for lock and unlock internal access to shared data structures.  More... | |
| int | sion_lock_user_callbacks_defined (void) | 
| Function which return flag, if user callback for locking are registered.  More... | |
| void | sion_swap (void *target, void *source, int size, int n, int do_swap) | 
| int | _sion_file_stat_file (const char *fname) | 
| Check if file exists (LARGE_FILE support on BlueGene)  More... | |
Common SIONlib functions
Definition in file sion_common.h.
| #define MAXCHUNKS 100 | 
Initial maximum number of chunks in a sion file
Definition at line 35 of file sion_common.h.
| int _sion_file_stat_file | ( | const char * | fname | ) | 
Check if file exists (LARGE_FILE support on BlueGene)
| *fname | filename to use | 
0 or 1 Definition at line 318 of file sion_file.c.
References _sion_file_stat_file2(), and SION_FILE_FLAG_POSIX.
| sion_int64 sion_bytes_avail_in_block | ( | int | sid | ) | 
Return the number of bytes available in the current chunk.
See sion_bytes_avail_in_block_description.
| [in] | sid | sion file handle | 
Definition at line 879 of file sion_common.c.
References sion_bytes_avail_in_chunk().
Referenced by fsion_bytes_avail_in_block_c().
| sion_int64 sion_bytes_avail_in_chunk | ( | int | sid | ) | 
Function that returns the number of bytes available in the current chunk.
This function returns the number of bytes remaining in the current chunk (bytes not read). It is a local function, which can be called independently from other MPI tasks.
| [in] | sid | sion file handle | 
Definition at line 894 of file sion_common.c.
Referenced by sion_bytes_avail_in_block().
| int sion_dedup | ( | int | sid | ) | 
Function which destroy a duplicated sion file descriptor.
| [in] | sid | sion file handle | 
Definition at line 1195 of file sion_common.c.
| int sion_dup | ( | int | sid, | 
| int | mode, | ||
| int | rank, | ||
| uint64_t | key | ||
| ) | 
Function which duplicates a sion file descriptor.
Restrictions:
| [in] | sid | sion file handle | 
| [in] | mode | one of SION_DUP_ALL, SION_DUP_RANK, SION_DUP_RANK_KEY | 
| [in] | rank | dup only those part of the internal data struture which are needed to read rank rank from file | 
| [in] | key | dup only those part of the internal data struture which are needed to read on the rank rank data for key key from file | 
Definition at line 1161 of file sion_common.c.
| int sion_ensure_free_space | ( | int | sid, | 
| sion_int64 | bytes | ||
| ) | 
Funtion to ensure that enough space is available for writing.
See sion_ensure_free_space_description
| [in] | sid | sion file handle | 
| [in] | bytes | number of bytes requested for the next write operation | 
Definition at line 1053 of file sion_common.c.
Referenced by fsion_ensure_free_space_c().
| int sion_feof | ( | int | sid | ) | 
Function that indicates whether the end of file is reached for this task.
| [in] | sid | sion file handle (in) | 
Definition at line 809 of file sion_common.c.
Referenced by fsion_feof_c().
| int sion_flush | ( | int | sid | ) | 
Flushed sion file.
| [in] | sid | sion file handle | 
Definition at line 1030 of file sion_common.c.
Referenced by fsion_flush_c().
| int sion_get_endianness | ( | void | ) | 
Return endianness.
Definition at line 32 of file sion_tools.c.
Referenced by fsion_get_endianness_c().
| sion_int64 sion_get_position | ( | int | sid | ) | 
Function that returns the current file position.
This function returns an sion_int64 containing the current file possition.
| [in] | sid | sion file handle (in) | 
Definition at line 930 of file sion_common.c.
References _sion_vcdtovcon(), _sion_vcdtype(), and SION_FILEDESCRIPTOR.
Referenced by fsion_get_position_c().
| int sion_get_sizeof | ( | int | sid, | 
| int * | numbytes, | ||
| int * | numfds | ||
| ) | 
Function returns size of internal data structure for sid.
| [in] | sid | sion file handle | 
| [out] | numbytes | number of bytes used | 
| [out] | numfds | number of file descriptors used | 
Definition at line 1123 of file sion_common.c.
| int sion_get_version | ( | int * | main_version, | 
| int * | sub_version, | ||
| int * | patch_level, | ||
| int * | fileformat_version | ||
| ) | 
| int sion_lock_register_lock_callbacks | ( | int | lockvoid *, | 
| int | unlockvoid *, | ||
| void * | lock_data | ||
| ) | 
Function which registers callback funtions for lock and unlock internal access to shared data structures.
| [in] | lock() | lock function | 
| [in] | unlock() | unlock function | 
| [in] | lock_data() | unlock function | 
Definition at line 1220 of file sion_common.c.
| int sion_lock_user_callbacks_defined | ( | void | ) | 
Function which return flag, if user callback for locking are registered.
Definition at line 1239 of file sion_common.c.
| int sion_seek | ( | int | sid, | 
| int | rank, | ||
| int | currentblocknr, | ||
| sion_int64 | posinblk | ||
| ) | 
Function to set the file pointer to a new position.
See sion_seek_description .
| [in] | sid | sion file handle | 
| [in] | rank | rank number of the process (SION_CURRENT_RANK to select the current rank) | 
| [in] | currentblocknr | block number (SION_CURRENT_BLK to select the current block) (SION_ABSOLUTE_POS gives an absolute position; SION_END_POS seeks relative to the end of the file) | 
| [in] | posinblk | position in the block (SION_CURRENT_POS to select the current position) | 
| SION_SUCCESS | if file pointer can be moved to new position | 
Definition at line 698 of file sion_common.c.
References sion_seek_fp().
| int sion_seek_fp | ( | int | sid, | 
| int | rank, | ||
| int | currentblocknr, | ||
| sion_int64 | posinblk, | ||
| FILE ** | fileptr | ||
| ) | 
Deprecated. Use sion_seek() instead.
See sion_seek_fp_description .
| [in] | sid | sion file handle | 
| [in] | rank | rank number of the process (SION_CURRENT_RANK to select the current rank) | 
| [in] | currentblocknr | block number (SION_CURRENT_BLK to select the current block) | 
| [in] | posinblk | position in the block (SION_CURRENT_POS to select the current position) | 
| [out] | **fileptr | file pointer to corresponding file of a multi-file set | 
| SION_SUCCESS | if file pointer can be moved to new position | 
Definition at line 721 of file sion_common.c.
Referenced by sion_seek().
| void sion_swap | ( | void * | target, | 
| void * | source, | ||
| int | size, | ||
| int | n, | ||
| int | do_swap | ||
| ) | 
@ brief Perform byte-order swapping for arrays
n elements of size bytes each are swapped if do_swap is true. In-place swapping (target == source) is allowed. If target != source, the buffers must not overlap.
| [out] | target | the byte-swapped data is written starting at this address | 
| [in] | source | the data to be byte-swapped is read starting at this address | 
| [in] | size | the size (in bytes) of a single element | 
| [in] | n | the number of elements to be byte-swapped | 
| [in] | do_swap | byte-swapping is only performed if this argument is true | 
Definition at line 44 of file sion_convert.c.
Referenced by fsion_swap_c().