|
MADNESS 0.10.1
|
Bounded cache of fetched exchange batches, keyed by cloud record key. More...
#include <exchangeoperator.h>
Classes | |
| struct | Slot |
Public Member Functions | |
| void | clear () |
| drop every entry; the capacity setting survives | |
| bool | contains (const keyT &key) const |
| const dataT * | find (const keyT &key) |
| const dataT & | insert (const keyT &key, dataT &&data, const bool pinned) |
Insert as most-recently-used. pinned marks a batch this rank owns. | |
| std::size_t | n_transient () const |
| void | set_transient_capacity (const std::size_t c) |
| how many non-owned entries may be resident; at least one is always allowed | |
| std::size_t | size () const |
| std::size_t | transient_capacity () const |
Private Attributes | |
| std::list< Slot > | slots_ |
| std::size_t | transient_capacity_ = 2 |
Bounded cache of fetched exchange batches, keyed by cloud record key.
A rank reuses the batches it owns across all of its tasks, so those are pinned and never evicted; only the batches fetched from elsewhere are transient and bounded. An earlier single bound over both let the churning transients evict the reusable owned batches, which re-fetched them at every owned-batch switch. Pinning the owned ones costs a fixed share of the data (orbitals per rank) and is independent of batch granularity.
Entries are held in a list, so a reference returned by find() or insert() stays valid until that entry is evicted — promotion and insertion of other entries do not move it.
|
inline |
drop every entry; the capacity setting survives
References madness::ExchangeBatchLRU< keyT, dataT >::slots_.
Referenced by madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::clear_local_caches().
|
inline |
|
inline |
References madness::ExchangeBatchLRU< keyT, dataT >::slots_.
Referenced by madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::fetch_batch(), and test_batch_cache().
|
inline |
Insert as most-recently-used. pinned marks a batch this rank owns.
References madness::ExchangeBatchLRU< keyT, dataT >::n_transient(), madness::nonlinear_vector_solver(), madness::ExchangeBatchLRU< keyT, dataT >::slots_, and madness::ExchangeBatchLRU< keyT, dataT >::transient_capacity_.
Referenced by madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::fetch_batch(), and test_batch_cache().
|
inline |
References c, madness::nonlinear_vector_solver(), and madness::ExchangeBatchLRU< keyT, dataT >::slots_.
Referenced by madness::ExchangeBatchLRU< keyT, dataT >::insert(), and test_batch_cache().
|
inline |
how many non-owned entries may be resident; at least one is always allowed
References c, and madness::ExchangeBatchLRU< keyT, dataT >::transient_capacity_.
Referenced by test_batch_cache().
|
inline |
References madness::ExchangeBatchLRU< keyT, dataT >::slots_.
Referenced by test_batch_cache().
|
inline |
|
private |
Referenced by madness::ExchangeBatchLRU< keyT, dataT >::clear(), madness::ExchangeBatchLRU< keyT, dataT >::contains(), madness::ExchangeBatchLRU< keyT, dataT >::find(), madness::ExchangeBatchLRU< keyT, dataT >::insert(), madness::ExchangeBatchLRU< keyT, dataT >::n_transient(), and madness::ExchangeBatchLRU< keyT, dataT >::size().
|
private |