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.
void* BDMPI_sbmalloc |
( |
size_t |
size | ) |
|
Provides the same functionality as malloc()
.
void* BDMPI_sbrealloc |
( |
void * |
oldptr, |
|
|
size_t |
size |
|
) |
| |
void BDMPI_sbfree |
( |
void * |
ptr | ) |
|
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] | ptr | is 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] | ptr | is 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 |
| ) |
|
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] | ptr | is a pointer to a memory location previously allocated by BDMPI_sbmalloc() or BDMPI_sbrealloc(). |
[in] | size | specifies the number of bytes starting at ptr that will be discarded. |