SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
Macros | Functions
sion_filedesc.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <assert.h>
#include "sion.h"
#include "sion_debug.h"
#include "sion_error_handler.h"
#include "sion_internal.h"
#include "sion_filedesc.h"
#include "sion_keyvalue_keymngr.h"
Include dependency graph for sion_filedesc.c:

Go to the source code of this file.

Macros

#define _XOPEN_SOURCE   700
 
#define DFUNCTION   "_sion_init_filedesc"
 
#define DFUNCTION   "_sion_alloc_filedesc"
 
#define DFUNCTION   "_sion_realloc_filedesc_blocklist"
 
#define DFUNCTION   "_sion_alloc_filedesc_all_chunksizes"
 
#define DFUNCTION   "_sion_alloc_filedesc_all_startpointers"
 
#define DFUNCTION   "_sion_alloc_filedesc_all_globalranks"
 
#define DFUNCTION   "_sion_alloc_filedesc_all_localranks"
 
#define DFUNCTION   "_sion_alloc_filedesc_all_keyvalptr"
 
#define DFUNCTION   "_sion_alloc_filedesc_arrays"
 
#define DFUNCTION   "_sion_free_filedesc_all_chunksizes"
 
#define DFUNCTION   "_sion_free_filedesc_all_globalranks"
 
#define DFUNCTION   "_sion_free_filedesc_all_startpointers"
 
#define DFUNCTION   "_sion_free_filedesc_all_localranks"
 
#define DFUNCTION   "_sion_free_filedesc_all_keyvalptr"
 
#define DFUNCTION   "_sion_free_filedesc_arrays"
 
#define DFUNCTION   "_sion_alloc_filedesc_coll_arrays"
 
#define DFUNCTION   "_sion_free_filedesc_coll_arrays"
 
#define DFUNCTION   "_sion_alloc_filedesc_block_arrays"
 
#define DFUNCTION   "_sion_alloc_filedesc_block_arrays_only"
 
#define DFUNCTION   "_sion_free_filedesc"
 
#define DFUNCTION   "_sion_print_filedesc"
 
#define DFUNCTION   "_sion_get_size_of_filedesc"
 
#define DFUNCTION   "_sion_dup_filedesc"
 

Functions

int _sion_init_filedesc (_sion_filedesc *sion_filedesc)
 Initialize the sion file description. More...
 
_sion_filedesc_sion_alloc_filedesc (void)
 Allocates memory for internal sion structure. More...
 
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_all_keyvalptr (_sion_filedesc *sion_filedesc)
 
int _sion_alloc_filedesc_arrays (_sion_filedesc *sion_filedesc)
 Allocate 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_free_filedesc_arrays (_sion_filedesc *sion_filedesc)
 free memory for the internal sion arrays 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_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_free_filedesc (_sion_filedesc *sion_filedesc)
 
int _sion_print_filedesc (_sion_filedesc *sion_filedesc, int level, char *desc, int flag)
 Print the initialized sion file description. More...
 
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...
 

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_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.