Class TempLat::MemoryManager
template <typename T, size_t NDim>
ClassList > TempLat > MemoryManager
A class which holds a single lattice in memory, and tracks and moves between various ghost states. Templated for the memory type, typically float or double. All the confirm___Space() functions return a device::Idx, which counts the amount of work done. Ignore that, but it is important for testing purposes. NOTE that the memory access operators (T* and operator[]) do NOT verify if memory was allocated. More...
#include <memorymanager.h>
Public Functions
| Type | Name |
|---|---|
| MemoryManager (device::memory::host_ptr< MemoryToolBox< NDim > > toolBox, std::string name="") |
|
| device::Idx | allocate () |
| bool | areGhostsStale () const |
| size_t | bytes () const |
| device::Idx | confirmConfigSpace () |
| device::Idx | confirmFFTConfigSpace () |
| device::Idx | confirmFourierSpace () |
| device::Idx | confirmGhostsUpToDate () |
| void | deallocateHostView () |
| void | flagHostMirrorOutdated () |
| auto | getNDHostSubView (const device::IdxArray< NDim > & localSizes, const device::array< std::pair< device::Idx, device::Idx >, NDim > & slices) const |
| auto | getNDHostView (const device::IdxArray< NDim > & localSizes) const |
| auto | getNDSubView (const device::IdxArray< NDim > & localSizes, const device::array< std::pair< device::Idx, device::Idx >, NDim > & slices) const |
| auto | getNDView (const device::IdxArray< NDim > & localSizes) const |
| std::string | getName () const |
| auto | getRawHostView () const |
| auto | getRawView () const |
| bool | isConfigSpace () const Check the current state. |
| bool | isFourierSpace () const Check the current state. |
| void | pushHostView () |
| void | setGhostsAreStale () this is the only state the one may need to set from the outside: if a field is updated in the integrator. |
| void | setName (std::string newName) |
| void | updateGhosts () |
Public Static Functions
| Type | Name |
|---|---|
| device::Idx | confirmGhostsUpToDateBatch (std::span< MemoryManager< T, NDim > *const > mgrs) Coalesced confirmGhostsUpToDate over the managers of a multi-component field. Only the components whose ghosts are stale are exchanged, but they travel as one message per dimension/direction instead of one per component. Static so it may reach the private state of the sibling managers; they must all share one MemoryToolBox (oneGhostUpdater / buffer set). |
| void | updateGhostsBatch (std::span< MemoryManager< T, NDim > *const > mgrs) Coalesced forced updateGhosts over the managers of a multi-component field. Matches the per-component updateGhosts() semantics (unconditional, no state-keeper reset) but sends all components in one message per dimension/direction. |
Detailed Description
Unit test: ctest -R test-memorymanager
Public Functions Documentation
function MemoryManager
inline TempLat::MemoryManager::MemoryManager (
device::memory::host_ptr < MemoryToolBox < NDim > > toolBox,
std::string name=""
)
function allocate
function areGhostsStale
function bytes
function confirmConfigSpace
function confirmFFTConfigSpace
function confirmFourierSpace
function confirmGhostsUpToDate
function deallocateHostView
function flagHostMirrorOutdated
function getNDHostSubView
template<typename R>
inline auto TempLat::MemoryManager::getNDHostSubView (
const device::IdxArray< NDim > & localSizes,
const device::array< std::pair< device::Idx, device::Idx >, NDim > & slices
) const
function getNDHostView
template<typename R>
inline auto TempLat::MemoryManager::getNDHostView (
const device::IdxArray< NDim > & localSizes
) const
function getNDSubView
template<typename R>
inline auto TempLat::MemoryManager::getNDSubView (
const device::IdxArray< NDim > & localSizes,
const device::array< std::pair< device::Idx, device::Idx >, NDim > & slices
) const
function getNDView
template<typename R>
inline auto TempLat::MemoryManager::getNDView (
const device::IdxArray< NDim > & localSizes
) const
function getName
function getRawHostView
function getRawView
function isConfigSpace
Check the current state.
function isFourierSpace
Check the current state.
function pushHostView
function setGhostsAreStale
this is the only state the one may need to set from the outside: if a field is updated in the integrator.
function setName
function updateGhosts
Public Static Functions Documentation
function confirmGhostsUpToDateBatch
Coalesced confirmGhostsUpToDate over the managers of a multi-component field. Only the components whose ghosts are stale are exchanged, but they travel as one message per dimension/direction instead of one per component. Static so it may reach the private state of the sibling managers; they must all share one MemoryToolBox (oneGhostUpdater / buffer set).
static inline device::Idx TempLat::MemoryManager::confirmGhostsUpToDateBatch (
std::span< MemoryManager < T, NDim > *const > mgrs
)
function updateGhostsBatch
Coalesced forced updateGhosts over the managers of a multi-component field. Matches the per-component updateGhosts() semantics (unconditional, no state-keeper reset) but sends all components in one message per dimension/direction.
static inline void TempLat::MemoryManager::updateGhostsBatch (
std::span< MemoryManager < T, NDim > *const > mgrs
)
Friends Documentation
friend operator<<
inline std::ostream & TempLat::MemoryManager::operator<< (
std::ostream & ostream,
const MemoryManager & mMan
)
friend operator==
The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/lattice/memory/memorymanager.h