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 42 int _sion_close_sid(
int sid);
57 size_t sion_fwrite(
const void *data,
size_t size,
size_t nitems,
int sid);
72 size_t sion_fread(
void *data,
size_t size,
size_t nitems,
int sid);
136 int sion_dup(
int sid,
int mode,
int rank, uint64_t key);
149 int sion_optimize_fp_buffer(
int sid);
169 int64_t sion_get_bytes_written(
int sid);
170 int64_t sion_get_bytes_read(
int sid);
222 int sion_get_mapping(
int sid,
int *mapping_size, int32_t **mapping,
int *numfiles);
250 int sion_get_locations(
int sid,
int *ntasks,
int *maxchunks, int64_t *globalskip, int64_t *start_of_varheader,
251 int64_t **sion_chunksizes, int64_t **sion_globalranks, int64_t **sion_blockcount, int64_t **sion_blocksizes);
289 int sion_get_number_of_files(
int sid);
290 int sion_get_filenumber(
int sid);
293 int sion_is_serial_opened(
int sid);
296 int sion_using_hints(
int sid);
308 int sion_is_thread_safe(
void);
316 int sion_get_version(
int *main_version,
int *sub_version,
int *patch_level,
int *fileformat_version);
330 sion_io_stat_t *sion_get_io_info_by_spec(
int sid,
int roles,
int flag);
427 void sion_swap(
void *target,
void *source,
int size,
int n,
int do_swap);
429 char *sion_get_fname(
int sid);
430 int64_t sion_get_chunksize(
int sid);
431 int32_t sion_get_globalrank(
int sid);
620 size_t sion_fwrite_key(
const void *data, uint64_t key,
size_t size,
size_t nitems,
int sid);
638 size_t sion_fread_key(
void *data, uint64_t key,
size_t size,
size_t nitems,
int sid);
681 int sion_seek_key(
int sid, uint64_t key,
int entrynum, int64_t posinentry);
757 #define DPRINTTS(A, B) 758 #define DPRINTFTS2(A, B) int sion_dedup(int sid)
Function which destroy a duplicated sion file descriptor.
sion_seek_mode
determines how offsets are interpreted for seek operations
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_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_key_full_scan(int sid)
Performs a full scan of all meta data in current file.
int sion_get_sizeof(int sid, int *numbytes, int *numfds)
Function returns size of internal data structure for sid.
int sion_key_list_iterator_next(int sid, uint64_t *keyptr)
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(int sid, int64_t offset, sion_seek_mode whence)
moves the file pointer inside a logical file
int sion_fread_key_iterator_next(int sid, uint64_t *key, size_t *size)
Forward to next key.
int sion_feof(int sid)
Function that indicates whether the end of file is reached for this task.
int sion_endianness_swap_needed(int sid)
Returns whether or not byte swapping is needed 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...
size_t sion_fread(void *data, size_t size, size_t nitems, int sid)
Read data from sion file.
int sion_get_file_endianness(int sid)
Returns edianness of data in file sid.
char * sion_keyval_type_to_str(int type)
Returns key value mode as string.
int sion_key_list_iterator_reset(int sid)
Resets key iterator.
int sion_get_version(int *main_version, int *sub_version, int *patch_level, int *fileformat_version)
Return version numbers.
int64_t sion_bytes_avail_in_chunk(int sid)
Function that returns the number of bytes available in the current chunk.
int sion_switch_logical_file(int sid, int file_number)
moves the file pointer to a different logical file
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
int sion_flush(int sid)
Flushed sion file.
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_seek_key(int sid, uint64_t key, int entrynum, int64_t posinentry)
Seek to position in key.
void sion_swap(void *target, void *source, int size, int n, int do_swap)
Perform byte-order swapping for arrays.
int sion_ensure_free_space(int sid, int64_t bytes)
Funtion to ensure that enough space is available for writing.
size_t sion_fwrite(const void *data, size_t size, size_t nitems, int sid)
Write data to sion file.
int sion_fread_key_iterator_reset(int sid)
Resets key iterator.
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_fread_key(void *data, uint64_t key, size_t size, size_t nitems, int sid)
Read data for key.
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_lock_user_callbacks_defined(void)
Function which return flag, if user callback for locking are registered.
int64_t sion_get_position(int sid)
Function that returns the current file position.
int sion_get_endianness(void)
Return endianness.
int sion_get_keyval_mode(int sid)
Return selected mode for key value.