SIONlib
1.7.7
Scalable I/O library for parallel access to task-local files
|
#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_buffer.h"
Go to the source code of this file.
Functions | |
int | _sion_buffer_check_env (_sion_filedesc *sion_filedesc) |
Checks if environment variables are set to use buffer. More... | |
int | _sion_buffer_init (_sion_filedesc *sion_filedesc) |
Allocate and initalize the buffer. More... | |
sion_int64 | _sion_buffer_push (_sion_filedesc *sion_filedesc, const void *data, sion_int64 bytes) |
Push data to buffer. More... | |
int | _sion_buffer_get_data_ptr (_sion_filedesc *sion_filedesc, void **data, sion_int64 *bytes) |
Pop all data from buffer. More... | |
int | _sion_buffer_flush (_sion_filedesc *sion_filedesc) |
Flush buffer. More... | |
This functions control and manage a memory based buffer for sion files. Depending on a set of environment variables the buffer will work as write-through or as write-back buffer. On Unix systems a POSIX shared memory segment will be used, on Blue Gene/P it is persistent memory.
A buffer of n MB will store the last n MB of data per task in the buffer. If the buffer memory is filled, the full buffer will be written to disk and the buffer will be exhausted.
Definition in file sion_buffer.c.
int _sion_buffer_check_env | ( | _sion_filedesc * | sion_filedesc | ) |
Checks if environment variables are set to use buffer.
*sion_filedesc | sion file description struct (_sion_filedesc) |
Definition at line 60 of file sion_buffer.c.
int _sion_buffer_flush | ( | _sion_filedesc * | sion_filedesc | ) |
Flush buffer.
*sion_filedesc | sion file description struct (_sion_filedesc) |
Definition at line 177 of file sion_buffer.c.
int _sion_buffer_get_data_ptr | ( | _sion_filedesc * | sion_filedesc, |
void ** | data, | ||
sion_int64 * | bytes | ||
) |
Pop all data from buffer.
*sion_filedesc | sion file description struct (_sion_filedesc) |
*data | pointer to data |
*bytes | number of bytes in buffer |
Definition at line 152 of file sion_buffer.c.
References _sion_filedesc_struct::buffer, and _sion_filedesc_struct::buffer_ptr.
int _sion_buffer_init | ( | _sion_filedesc * | sion_filedesc | ) |
Allocate and initalize the buffer.
*sion_filedesc | sion file description struct (_sion_filedesc) |
Definition at line 81 of file sion_buffer.c.
sion_int64 _sion_buffer_push | ( | _sion_filedesc * | sion_filedesc, |
const void * | data, | ||
sion_int64 | bytes | ||
) |
Push data to buffer.
*sion_filedesc | sion file description struct (_sion_filedesc) |
*data | pointer to data |
*bytes | number of bytes to push |
Definition at line 106 of file sion_buffer.c.