17 #ifndef SION_SION_INTERNAL_H
18 #define SION_SION_INTERNAL_H
23 #include <cuda_runtime.h>
31 #define _SION_READ_MASTER_ONLY_OF_MULTI_FILES 0
32 #define _SION_READ_ALL_OF_MULTI_FILES 1
34 #define _SION_SAFE_FREE(ptr, null) {if (ptr) {free(ptr); ptr = null;}}
37 int _sion_open(
const char *fname,
38 const char* file_mode,
41 sion_int64 **chunksizes,
42 sion_int32 *fsblksize,
46 int _sion_open_rank(
const char *fname,
47 const char *file_mode,
48 sion_int64 *chunksize,
49 sion_int32 *fsblksize,
53 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);
54 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);
55 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);
56 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);
70 #define _SION_FMODE_WRITE 1024
71 #define _SION_FMODE_READ 2048
72 #define _SION_FMODE_ANSI 1
73 #define _SION_FMODE_POSIX 2
74 #define _SION_FMODE_BUFFERED 4
75 #define _SION_FMODE_COMPRESS 8
76 #define _SION_FMODE_COLLECTIVE 16
77 #define _SION_FMODE_COLLECTIVE_MERGE 32
78 #define _SION_FMODE_KEYVAL 64
79 #define _SION_FMODE_KEYVAL_INLINE 4096
80 #define _SION_FMODE_KEYVAL_META 8192
81 #define _SION_FMODE_KEYVAL_HASH 16384
82 #define _SION_FMODE_KEYVAL_NONE 32768
83 #define _SION_FMODE_KEYVAL_UNKNOWN 65536
84 #define _SION_FMODE_ENDIANNESS_SET 131072
85 #define _SION_FMODE_ENDIANNESS_BIG 262144
86 #define _SION_FMODE_BUDDY 524288
88 #if defined(_SION_SIONFWD)
89 #define _SION_FMODE_SIONFWD 1048576
92 #ifdef _SION_IME_NATIVE
93 #define _SION_FMODE_IME_NATIVE 2097152
102 #if CUDART_VERSION < 11000
103 #define _sion_cuda_ptr_is_device(attrs) (!attrs.isManaged && (attrs.memoryType == cudaMemoryTypeDevice))
105 #define _sion_cuda_ptr_is_device(attrs) (attrs.type == cudaMemoryTypeDevice)
int _sion_create_new_block(_sion_filedesc *sion_filedesc)
Create a new block for the internal data structure.
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
char * _sion_getenv(const char *name)
int _sion_free_io_info(sion_io_stat_t *p)
frees an io_info data structure
char * _sion_get_multi_filename(const char *fname, int filenumber)
generates the multi filename
int _sion_flush_block(_sion_filedesc *sion_filedesc)
Update the internal data structure.
int _sion_check_on_collective_mode(_sion_filedesc *sion_filedesc)
check if a collective operation are already called,
sion_int32 _sion_get_endianness_with_flags(sion_int64 flags)
Return endianness including possible choice via flags.
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
int _sion_update_fileposition(_sion_filedesc *sion_filedesc)
Update the internal data structure (check fileposition)
sion_io_stat_t * _sion_alloc_io_info(int nfiles)
allocates an io_info data structure for nfiles files
Sion File Descriptor Structure.