10 #ifndef SION_SION_COMMON_H
11 #define SION_SION_COMMON_H
22 #include "sion_enums.h"
27 #define SION_SERIAL_MASTER
29 #define SION_MAX_FSBLOCKSIZE 32 * 1024 * 1024
30 #define SION_DEFAULT_FSBLOCKSIZE 2 * 1024 * 1024
32 #define SION_FILENAME_LENGTH 1024
36 #define WFLARGEMETABLOCK_none
61 size_t sion_write(
const void *data,
size_t size,
size_t nitems,
int sid);
66 size_t sion_fwrite(
const void *data,
size_t size,
size_t nitems,
int sid);
88 size_t sion_read(
void *data,
size_t size,
size_t nitems,
int sid);
93 size_t sion_fread(
void *data,
size_t size,
size_t nitems,
int sid);
178 int sion_dup(
int sid,
int mode,
int rank, uint64_t key);
191 int sion_optimize_fp_buffer(
int sid);
211 int64_t sion_get_bytes_written(
int sid);
212 int64_t sion_get_bytes_read(
int sid);
273 int sion_get_mapping(
int sid,
int *mapping_size, int32_t **mapping,
int *numfiles);
308 int sion_get_locations(
int sid,
int *ntasks,
int *maxchunks, int64_t *globalskip, int64_t *start_of_varheader,
309 int64_t **sion_chunksizes, int64_t **sion_globalranks, int64_t **sion_blockcount, int64_t **sion_blocksizes);
355 int sion_get_number_of_files(
int sid);
356 int sion_get_filenumber(
int sid);
358 int sion_get_number_of_logical_files(
int sid);
360 int64_t *sion_get_chunksizes(
int sid);
362 int32_t sion_get_fsblksize(
int sid);
365 int sion_is_serial_opened(
int sid);
368 int sion_using_hints(
int sid);
380 int sion_is_thread_safe(
void);
388 int sion_get_version(
int *main_version,
int *sub_version,
int *patch_level,
int *fileformat_version);
402 sion_io_stat_t *sion_get_io_info_by_spec(
int sid,
int roles,
int flag);
506 void sion_swap(
void *target,
void *source,
int size,
int n,
int do_swap);
508 char *sion_get_fname(
int sid);
509 int64_t sion_get_chunksize(
int sid);
510 int32_t sion_get_globalrank(
int sid);
511 int32_t *sion_get_globalranks(
int sid);
700 size_t sion_write_key(
const void *data, uint64_t key,
size_t size,
size_t nitems,
int sid);
705 size_t sion_fwrite_key(
const void *data, uint64_t key,
size_t size,
size_t nitems,
int sid);
723 size_t sion_read_key(
void *data, uint64_t key,
size_t size,
size_t nitems,
int sid);
728 size_t sion_fread_key(
void *data, uint64_t key,
size_t size,
size_t nitems,
int sid);
781 int sion_seek_key(
int sid, uint64_t key,
int entrynum, int64_t posinentry);
857 #define DPRINTTS(A, B)
858 #define DPRINTFTS2(A, B)
int sion_switch_logical_file(int sid, int file_number)
moves the file pointer to a different logical file
size_t sion_write(const void *data, size_t size, size_t nitems, int sid)
Write data to a SIONlib file.
size_t sion_read(void *data, size_t size, size_t nitems, int sid)
Read data from SIONlib file.
int sion_get_mapping(int sid, int *mapping_size, int32_t **mapping, int *numfiles)
Returns pointers to the internal field mapping.
int sion_get_locations(int sid, int *ntasks, int *maxchunks, int64_t *globalskip, int64_t *start_of_varheader, int64_t **sion_chunksizes, int64_t **sion_globalranks, int64_t **sion_blockcount, int64_t **sion_blocksizes)
Returns pointers to internal fields.
int sion_flush(int sid)
Flushed sion file.
int sion_get_current_locations(int sid, int *ntasks, int64_t **sion_currentpos, int64_t **sion_currentblocknr)
Returns current position in file and pointer fiels containing chunk sizes.
int sion_feof(int sid)
Function that indicates whether the end of this logical file has been reached.
int sion_get_version(int *main_version, int *sub_version, int *patch_level, int *fileformat_version)
Return version numbers.
size_t sion_fread(void *data, size_t size, size_t nitems, int sid)
Read data from a SIONlib file.
int sion_get_endianness(void)
Return endianness.
int sion_get_file_endianness(int sid)
Returns edianness of data in file sid.
int sion_ensure_free_space(int sid, int64_t bytes)
Function to ensure that enough space is available for writing.
int64_t sion_bytes_avail_in_chunk(int sid)
Function that returns the number of bytes available in the current chunk.
int sion_eof(int sid)
Function that indicates whether the end of this logical file has been reached.
int sion_get_current_location(int sid, int *currentchunknr, int64_t *currentpos, int *maxchunks, int64_t **chunksizes)
Returns current position in file and pointer fiels containing chunk sizes.
int sion_endianness_swap_needed(int sid)
Returns whether or not byte swapping is needed for sid.
void sion_swap(void *target, void *source, int size, int n, int do_swap)
Perform byte-order swapping for arrays.
int sion_seek(int sid, int64_t offset, sion_seek_mode whence)
moves the file pointer inside a logical file
int64_t sion_tell(int sid)
Inspect position of file pointer in logical file.
int sion_dup(int sid, int mode, int rank, uint64_t key)
Function which duplicates a sion file descriptor.
int64_t sion_bytes_avail_in_block(int sid)
Return the number of bytes available in the current chunk.
int sion_seek_chunk(int sid, int32_t offset, sion_seek_mode whence)
moves the file pointer by increments of entire chunks inside the logical file
int64_t sion_get_position(int sid)
Function that returns the current file position.
int sion_lock_user_callbacks_defined(void)
Function which return flag, if user callback for locking are registered.
int sion_get_sizeof(int sid, int *numbytes, int *numfds)
Function returns size of internal data structure for sid.
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 structu...
int sion_dedup(int sid)
Function which destroy a duplicated sion file descriptor.
size_t sion_fwrite(const void *data, size_t size, size_t nitems, int sid)
Write data to a SIONlib file.
sion_seek_mode
determines how offsets are interpreted for seek operations
size_t sion_read_key(void *data, uint64_t key, size_t size, size_t nitems, int sid)
Read data for key.
char * sion_keyval_type_to_str(int type)
Returns key value mode as string.
size_t sion_fwrite_key(const void *data, uint64_t key, size_t size, size_t nitems, int sid)
Writes data for key.
size_t sion_write_key(const void *data, uint64_t key, size_t size, size_t nitems, int sid)
Writes data for key.
int sion_get_keyval_mode(int sid)
Return selected mode for key value.
int sion_key_list_iterator_reset(int sid)
Resets key iterator.
int sion_key_full_scan(int sid)
Performs a full scan of all meta data in current file.
size_t sion_fread_key(void *data, uint64_t key, size_t size, size_t nitems, int sid)
Read data for key.
int sion_fread_key_iterator_next(int sid, uint64_t *key, size_t *size)
Forward to next key.
int sion_key_get_stat(int sid, uint64_t key, sion_key_stat_t *stat)
get statistics about key
int sion_seek_key(int sid, uint64_t key, int entrynum, int64_t posinentry)
Seek to position in key.
int sion_fread_key_iterator_reset(int sid)
Resets key iterator.
int sion_key_list_iterator_next(int sid, uint64_t *keyptr)
Forward to next key.
int sion_read_key_iterator_reset(int sid)
Resets key iterator.
int sion_read_key_iterator_next(int sid, uint64_t *key, size_t *size)
Forward to next key.