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

Go to the source code of this file.

Macros

#define _XOPEN_SOURCE   700
 

Functions

int _sion_cache_check_env (_sion_filedesc *sion_filedesc)
 Check if environment variables are set to use cache. More...
 
int _sion_cache_init (_sion_filedesc *sion_filedesc)
 Allocate and initalize the cache. More...
 
int _sion_cache_destroy (_sion_filedesc *sion_filedesc)
 Deallocate the cache. More...
 
int _sion_cache_create_linux (_sion_filedesc *sion_filedesc)
 Allocate cache for linux. More...
 
int _sion_cache_load_linux (_sion_filedesc *sion_filedesc)
 Load an already allocated cache for linux. More...
 
int _sion_cache_destroy_linux (_sion_filedesc *sion_filedesc)
 Deallocate cache for linux. More...
 

Detailed Description

This functions control and manage a memory based cache for sion files. Depending on a set of environment variables the cache will work as write-through or as write-back cache. On Unix systems a POSIX shared memory segment will be used, on Blue Gene/P it is persistent memory.

A cache of n MB will store the last n MB of data per task in the cache. If the cache memory is filled, the full cache will be written to disk and the cache will be exhausted.

Definition in file sion_cache.c.

Function Documentation

◆ _sion_cache_check_env()

int _sion_cache_check_env ( _sion_filedesc sion_filedesc)

Check if environment variables are set to use cache.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Returns
SION_SUCCESS if env could be checked

Definition at line 57 of file sion_cache.c.

◆ _sion_cache_create_linux()

int _sion_cache_create_linux ( _sion_filedesc sion_filedesc)

Allocate cache for linux.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Returns
SION_SUCCESS if ok

Definition at line 132 of file sion_cache.c.

◆ _sion_cache_destroy()

int _sion_cache_destroy ( _sion_filedesc sion_filedesc)

Deallocate the cache.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Returns
SION_SUCCESS if ok

Definition at line 111 of file sion_cache.c.

◆ _sion_cache_destroy_linux()

int _sion_cache_destroy_linux ( _sion_filedesc sion_filedesc)

Deallocate cache for linux.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Returns
1 if ok

Definition at line 223 of file sion_cache.c.

◆ _sion_cache_init()

int _sion_cache_init ( _sion_filedesc sion_filedesc)

Allocate and initalize the cache.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Returns
SION_SUCCESS if ok

Definition at line 79 of file sion_cache.c.

◆ _sion_cache_load_linux()

int _sion_cache_load_linux ( _sion_filedesc sion_filedesc)

Load an already allocated cache for linux.

Parameters
*sion_filedescsion file description struct (_sion_filedesc)
Returns
SION_SUCCESS if ok

Definition at line 177 of file sion_cache.c.