BDMPI - Big Data Message Passing Interface  Release 0.1
Functions for storage-backed memory allocation

Detailed Description

This set of functions provides access to BDMPI's storage-backed memory allocation subsystem, which is designed to bypass the system's swap file and achieve faster I/O performance during loading/saving of a process' address space.

Functions

void * BDMPI_sbmalloc (size_t size)
 
void * BDMPI_sbrealloc (void *oldptr, size_t size)
 
void BDMPI_sbfree (void *ptr)
 
void BDMPI_sbload (void *ptr)
 
void BDMPI_sbloadall (void)
 
void BDMPI_sbunload (void *ptr)
 
void BDMPI_sbunloadall (void)
 
void BDMPI_sbdiscard (void *ptr, size_t size)
 

Function Documentation

void* BDMPI_sbmalloc ( size_t  size)

Provides the same functionality as malloc().

void* BDMPI_sbrealloc ( void *  oldptr,
size_t  size 
)

Provides the same functionality as realloc(). The oldptr must be a pointer previously returned by either BDMPI_sbmalloc() or BDMPI_sbrealloc().

void BDMPI_sbfree ( void *  ptr)

Implementation of free(). The ptr should be a pointer previously returned by either BDMPI_sbmalloc() or BDMPI_sbrealloc().

void BDMPI_sbload ( void *  ptr)

It is used to make the memory associated with a previous BDMPI_sbmalloc() or BDMPI_sbrealloc() allocation available for accessing. If the allocation has been previously written to disk, then it will be restored from the disk.

Parameters
[in]ptris a pointer to a previous allocation. Note that this does not have to be a pointer to the start of the region; a pointer anywhere in the allocated region will work.
Note
In order to ensure correct execution of BDMPI multi-threaded programs (e.g., programs whose processes rely on pthreads or OpenMP), any memory that has been allocated with either BDMPI_sbmalloc() or BDMPI_sbrealloc() and is accessed concurrently by multiple threads needs to be loaded prior to entering the multi-threaded region (e.g., parallel region in OpenMP).
void BDMPI_sbloadall ( void  )

It is used to make all the memory associated with any previous BDMPI_sbmalloc() or BDMPI_sbrealloc() allocations available for accessing. If these allocations have been previously written to disk, they will be restored from the disk.

void BDMPI_sbunload ( void *  ptr)

It is used to remove from active memory the memory pages associated with a BDMPI_sbmalloc() or BDMPI_sbrealloc() allocation. If any of the pages have been modified since the last time there were unloaded, they are first written to disk prior to removing them from the active memory. The unloading process does not change any of the virtual memory mappings and any subsequent access of the unloaded memory will automatically load it back in active memory.

Parameters
[in]ptris a pointer to a previous allocation. Note that this does not have to be a pointer to the start of the region; a pointer anywhere in the allocated region will work.
void BDMPI_sbunloadall ( void  )

It is used to remove from active memory the memory pages that were previously allocated by any BDMPI_sbmalloc() or BDMPI_sbrealloc() calls.

void BDMPI_sbdiscard ( void *  ptr,
size_t  size 
)

It is used to remove from active memory the memory pages associated with a BDMPI_sbmalloc() or BDMPI_sbrealloc() allocation and to also discard any modifications that may have been made to them. Next time the application access any of the memory in the discarded region it will be treated as if it correspondint to freshly allocated memory (i.e., its values will be undefined).

Parameters
[in]ptris a pointer to a memory location previously allocated by BDMPI_sbmalloc() or BDMPI_sbrealloc().
[in]sizespecifies the number of bytes starting at ptr that will be discarded.