SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
Data Structures | Macros | Typedefs | Functions
sion_filedesc.h File Reference
#include "sion_const.h"
#include "sion_datatypes.h"
#include "sion_file.h"
Include dependency graph for sion_filedesc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _sion_filedesc_struct
 Sion File Descriptor Structure. More...
 

Macros

#define _SION_FLAG1_NONE   0
 
#define _SION_FLAG2_NONE   0
 
#define _SION_FLAG1_USECACHE   2
 
#define SION_FILESTATE_UNKNOWN   -1
 
#define SION_FILESTATE_PAROPEN   0
 
#define SION_FILESTATE_SEROPEN   1
 
#define SION_FILESTATE_SEROPENRANK   2
 
#define SION_FILESTATE_SEROPENMASTER   3
 
#define SION_FILESTATE_PAROPENMAPPEDMASTER   4
 
#define SION_FILESTATE_PAROPENMAPPEDMANAGED   5
 
#define SION_FILESTATE_PAROPENMAPPED   6
 
#define SION_FILESTATE_CLOSE   10
 
#define SION_FILEMODE_UNKNOWN   -20
 
#define SION_FILEMODE_READ   20
 
#define SION_FILEMODE_WRITE   30
 
#define SION_CACHE_TODISK   40
 
#define SION_CACHE_TOMEM   41
 
#define SION_CACHE_UNKNOWN   42
 
#define SION_CACHE_FNLEN   16
 
#define SION_DESCSTATE_ORIG   200
 
#define SION_DESCSTATE_DUP   201
 
#define SION_DESCSTATE_DUP_SEL_RANK   202
 
#define SION_DESCSTATE_DUP_SEL_RANK_KEY   203
 
#define SION_HINTS_TYPE_UNKNOWN   160
 
#define SION_HINTS_TYPE_LINUX   161
 
#define SION_HINTS_TYPE_GPFS   162
 
#define SION_CAPABILITY_FULL   50
 
#define SION_CAPABILITY_ONLY_SENDER   51
 
#define SION_CAPABILITY_NONE   52
 
#define _SION_DEBUG_PRINT_ALL   1
 
#define _SION_DEBUG_PRINT_RECURSIVE   2
 

Typedefs

typedef struct _sion_filedesc_struct _sion_filedesc
 SION File Descriptor Alias.
 

Functions

_sion_filedesc_sion_alloc_filedesc (void)
 Allocates memory for internal sion structure. More...
 
int _sion_init_filedesc (_sion_filedesc *sion_filedesc)
 Initialize the sion file description. More...
 
int _sion_print_filedesc (_sion_filedesc *sion_filedesc, int level, char *desc, int all)
 Print the initialized sion file description. More...
 
int _sion_free_filedesc (_sion_filedesc *sion_filedesc)
 
int _sion_realloc_filedesc_blocklist (_sion_filedesc *sion_filedesc, sion_int32 maxchunks)
 Increase the memory used by the internal sion structure for the blocklist. More...
 
int _sion_alloc_filedesc_all_chunksizes (_sion_filedesc *sion_filedesc)
 
int _sion_alloc_filedesc_all_startpointers (_sion_filedesc *sion_filedesc)
 
int _sion_alloc_filedesc_all_globalranks (_sion_filedesc *sion_filedesc)
 
int _sion_alloc_filedesc_all_localranks (_sion_filedesc *sion_filedesc)
 
int _sion_alloc_filedesc_arrays (_sion_filedesc *sion_filedesc)
 Allocate memory for the internal sion arrays. More...
 
int _sion_alloc_filedesc_all_keyvalptr (_sion_filedesc *sion_filedesc)
 
int _sion_free_filedesc_arrays (_sion_filedesc *sion_filedesc)
 free memory for the internal sion arrays More...
 
int _sion_free_filedesc_all_chunksizes (_sion_filedesc *sion_filedesc)
 
int _sion_free_filedesc_all_globalranks (_sion_filedesc *sion_filedesc)
 
int _sion_free_filedesc_all_startpointers (_sion_filedesc *sion_filedesc)
 
int _sion_free_filedesc_all_localranks (_sion_filedesc *sion_filedesc)
 
int _sion_free_filedesc_all_keyvalptr (_sion_filedesc *sion_filedesc)
 
int _sion_alloc_filedesc_block_arrays (_sion_filedesc *sion_filedesc)
 Allocate memory for the internal sion structure, fields for all chunksizes of all tasks. More...
 
int _sion_alloc_filedesc_block_arrays_only (_sion_filedesc *sion_filedesc)
 Allocate memory for the internal sion structure, fields for all chunksizes of all tasks. More...
 
int _sion_alloc_filedesc_coll_arrays (_sion_filedesc *sion_filedesc)
 Allocate memory for the internal sion arrays. More...
 
int _sion_free_filedesc_coll_arrays (_sion_filedesc *sion_filedesc)
 free memory for the internal sion arrays More...
 
int _sion_alloc_filedesc_arrays_mapped (_sion_filedesc *sion_filedesc)
 
int _sion_alloc_filedesc_block_arrays_mapped (_sion_filedesc *sion_filedesc)
 
char * _sion_fileptrflags_to_str (unsigned int flag)
 
int _sion_get_size_of_filedesc (_sion_filedesc *sion_filedesc, int *numbytes, int *numfds)
 get size of internal data structure sion_filedesc More...
 
_sion_filedesc_sion_dup_filedesc (_sion_filedesc *sion_filedesc)
 duplicates a filedesc data structure, not copying/reopen active file pointers More...
 

Macro Definition Documentation

◆ _SION_FLAG1_NONE

#define _SION_FLAG1_NONE   0

Flag1 not used

Definition at line 21 of file sion_filedesc.h.

◆ _SION_FLAG1_USECACHE

#define _SION_FLAG1_USECACHE   2

bit mask for storing use cache flag

Definition at line 24 of file sion_filedesc.h.

◆ _SION_FLAG2_NONE

#define _SION_FLAG2_NONE   0

Flag2 not used

Definition at line 22 of file sion_filedesc.h.

◆ SION_CACHE_FNLEN

#define SION_CACHE_FNLEN   16

length of filename for segment

Definition at line 43 of file sion_filedesc.h.

◆ SION_CACHE_TODISK

#define SION_CACHE_TODISK   40

Cache will store data directly to disk (in sion_write or in sion_close if file is opened for reading and cachedata is dirty)

Definition at line 40 of file sion_filedesc.h.

◆ SION_CACHE_TOMEM

#define SION_CACHE_TOMEM   41

Cache will write only to memory

Definition at line 41 of file sion_filedesc.h.

◆ SION_CACHE_UNKNOWN

#define SION_CACHE_UNKNOWN   42

Unknown

Definition at line 42 of file sion_filedesc.h.

◆ SION_CAPABILITY_FULL

#define SION_CAPABILITY_FULL   50

Capability of a task in collective mode

Definition at line 54 of file sion_filedesc.h.

◆ SION_CAPABILITY_NONE

#define SION_CAPABILITY_NONE   52

Capability of a task in collective mode

Definition at line 56 of file sion_filedesc.h.

◆ SION_CAPABILITY_ONLY_SENDER

#define SION_CAPABILITY_ONLY_SENDER   51

Capability of a task in collective mode

Definition at line 55 of file sion_filedesc.h.

◆ SION_DESCSTATE_DUP

#define SION_DESCSTATE_DUP   201

data structure is a duplicate of another data structure

Definition at line 46 of file sion_filedesc.h.

◆ SION_DESCSTATE_DUP_SEL_RANK

#define SION_DESCSTATE_DUP_SEL_RANK   202

data structure is a duplicate of another data structure, only for one rank

Definition at line 47 of file sion_filedesc.h.

◆ SION_DESCSTATE_DUP_SEL_RANK_KEY

#define SION_DESCSTATE_DUP_SEL_RANK_KEY   203

data structure is a duplicate of another data structure, only for one rank and one key

Definition at line 48 of file sion_filedesc.h.

◆ SION_DESCSTATE_ORIG

#define SION_DESCSTATE_ORIG   200

data structure is NOT a duplicate of another data structure

Definition at line 45 of file sion_filedesc.h.

◆ SION_FILEMODE_READ

#define SION_FILEMODE_READ   20

File opened for reading

Definition at line 37 of file sion_filedesc.h.

◆ SION_FILEMODE_UNKNOWN

#define SION_FILEMODE_UNKNOWN   -20

File mode unknown (error)

Definition at line 36 of file sion_filedesc.h.

◆ SION_FILEMODE_WRITE

#define SION_FILEMODE_WRITE   30

File opened for writing

Definition at line 38 of file sion_filedesc.h.

◆ SION_FILESTATE_CLOSE

#define SION_FILESTATE_CLOSE   10

File closed

Definition at line 35 of file sion_filedesc.h.

◆ SION_FILESTATE_PAROPEN

#define SION_FILESTATE_PAROPEN   0

File opened in parallel

Definition at line 28 of file sion_filedesc.h.

◆ SION_FILESTATE_PAROPENMAPPED

#define SION_FILESTATE_PAROPENMAPPED   6

File opened in parallel with mapping task and managed by other tasks

Definition at line 34 of file sion_filedesc.h.

◆ SION_FILESTATE_PAROPENMAPPEDMANAGED

#define SION_FILESTATE_PAROPENMAPPEDMANAGED   5

File opened in parallel with mapping task and managed by this tasks

Definition at line 33 of file sion_filedesc.h.

◆ SION_FILESTATE_PAROPENMAPPEDMASTER

#define SION_FILESTATE_PAROPENMAPPEDMASTER   4

File opened in parallel with mapping task, master

Definition at line 32 of file sion_filedesc.h.

◆ SION_FILESTATE_SEROPEN

#define SION_FILESTATE_SEROPEN   1

File opened in serial

Definition at line 29 of file sion_filedesc.h.

◆ SION_FILESTATE_SEROPENMASTER

#define SION_FILESTATE_SEROPENMASTER   3

File opened in serial, master

Definition at line 31 of file sion_filedesc.h.

◆ SION_FILESTATE_SEROPENRANK

#define SION_FILESTATE_SEROPENRANK   2

File opened in serial for a specific rank

Definition at line 30 of file sion_filedesc.h.

◆ SION_FILESTATE_UNKNOWN

#define SION_FILESTATE_UNKNOWN   -1

Unknown file state(error)

Definition at line 27 of file sion_filedesc.h.

◆ SION_HINTS_TYPE_GPFS

#define SION_HINTS_TYPE_GPFS   162

use hints for GPFS filessystem

Definition at line 52 of file sion_filedesc.h.

◆ SION_HINTS_TYPE_LINUX

#define SION_HINTS_TYPE_LINUX   161

use hints for Linux filessystem

Definition at line 51 of file sion_filedesc.h.

◆ SION_HINTS_TYPE_UNKNOWN

#define SION_HINTS_TYPE_UNKNOWN   160

use hints of type UNKNOWN

Definition at line 50 of file sion_filedesc.h.

Function Documentation

◆ _sion_alloc_filedesc()

_sion_filedesc* _sion_alloc_filedesc ( void  )

Allocates memory for internal sion structure.

Return values
pointerto a new sion_filedesc structure

Definition at line 168 of file sion_filedesc.c.

Referenced by _sion_open_read().

◆ _sion_alloc_filedesc_arrays()

int _sion_alloc_filedesc_arrays ( _sion_filedesc sion_filedesc)

Allocate memory for the internal sion arrays.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Return values
SION_SUCCESSif OK

Definition at line 336 of file sion_filedesc.c.

◆ _sion_alloc_filedesc_block_arrays()

int _sion_alloc_filedesc_block_arrays ( _sion_filedesc sion_filedesc)

Allocate memory for the internal sion structure, fields for all chunksizes of all tasks.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Return values
SION_SUCCESSif OK

Definition at line 522 of file sion_filedesc.c.

◆ _sion_alloc_filedesc_block_arrays_only()

int _sion_alloc_filedesc_block_arrays_only ( _sion_filedesc sion_filedesc)

Allocate memory for the internal sion structure, fields for all chunksizes of all tasks.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Return values
SION_SUCCESSif OK

Definition at line 570 of file sion_filedesc.c.

◆ _sion_alloc_filedesc_coll_arrays()

int _sion_alloc_filedesc_coll_arrays ( _sion_filedesc sion_filedesc)

Allocate memory for the internal sion arrays.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Return values
SION_SUCCESSif OK

Definition at line 447 of file sion_filedesc.c.

References _sion_filedesc_struct::ntasks.

◆ _sion_dup_filedesc()

_sion_filedesc* _sion_dup_filedesc ( _sion_filedesc sion_filedesc)

duplicates a filedesc data structure, not copying/reopen active file pointers

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Return values
ptrto a copy of sion_filedesc, or NULL if fails

Definition at line 1032 of file sion_filedesc.c.

◆ _sion_fileptrflags_to_str()

char* _sion_fileptrflags_to_str ( unsigned int  flag)
Returns
String representation of flag

Definition at line 1550 of file sion_file.c.

◆ _sion_free_filedesc_arrays()

int _sion_free_filedesc_arrays ( _sion_filedesc sion_filedesc)

free memory for the internal sion arrays

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Return values
SION_SUCCESSif OK

Definition at line 429 of file sion_filedesc.c.

◆ _sion_free_filedesc_coll_arrays()

int _sion_free_filedesc_coll_arrays ( _sion_filedesc sion_filedesc)

free memory for the internal sion arrays

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Return values
SION_SUCCESSif OK

Definition at line 494 of file sion_filedesc.c.

◆ _sion_get_size_of_filedesc()

int _sion_get_size_of_filedesc ( _sion_filedesc sion_filedesc,
int *  numbytes,
int *  numfds 
)

get size of internal data structure sion_filedesc

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
*numbytesint, number of bytes allcated for that data structure
*numfdsint, number of open file descriptors

Definition at line 870 of file sion_filedesc.c.

◆ _sion_init_filedesc()

int _sion_init_filedesc ( _sion_filedesc sion_filedesc)

Initialize the sion file description.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Return values
SION_SUCCESSif OK

Definition at line 37 of file sion_filedesc.c.

◆ _sion_print_filedesc()

int _sion_print_filedesc ( _sion_filedesc sion_filedesc,
int  level,
char *  desc,
int  flag 
)

Print the initialized sion file description.

Return values
SION_SUCCESSif OK

Definition at line 656 of file sion_filedesc.c.

◆ _sion_realloc_filedesc_blocklist()

int _sion_realloc_filedesc_blocklist ( _sion_filedesc sion_filedesc,
sion_int32  maxchunks 
)

Increase the memory used by the internal sion structure for the blocklist.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
maxchunksmaximum number of chunks written by all tasks
Return values
SION_SUCCESSif OK

Definition at line 191 of file sion_filedesc.c.