ttg 1.0.0-alpha
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ttg::Env Class Reference

#include <env.h>

Public Member Functions

 ~Env ()
 
 Env (const Env &)=delete
 
 Env (Env &&)=delete
 
Envoperator= (const Env &)=delete
 
Envoperator= (Env &&)=delete
 
auto & pinned_allocator ()
 
std::size_t pinned_allocator_getActualHighWatermark ()
 

Static Public Member Functions

static std::unique_ptr< Env > & instance ()
 
static void initialize (const std::uint64_t page_size=(1ul<< 25), const std::uint64_t pinned_alloc_limit=(1ul<< 40))
 

Protected Member Functions

 Env (::umpire::Allocator pinned_alloc)
 

Detailed Description

Env maintains the runtime environment of TTG, such as device artifacts, memory allocators, etc.

Note
this is a Singleton

Definition at line 25 of file env.h.

Constructor & Destructor Documentation

◆ ~Env()

ttg::Env::~Env ( )
inline

Definition at line 27 of file env.h.

◆ Env() [1/3]

ttg::Env::Env ( const Env )
delete

◆ Env() [2/3]

ttg::Env::Env ( Env &&  )
delete

◆ Env() [3/3]

ttg::Env::Env ( ::umpire::Allocator  pinned_alloc)
inlineprotected

Definition at line 110 of file env.h.

Member Function Documentation

◆ initialize()

static void ttg::Env::initialize ( const std::uint64_t  page_size = (1ul << 25),
const std::uint64_t  pinned_alloc_limit = (1ul << 40) 
)
inlinestatic

initialize the instance using explicit params

Parameters
worldthe world to use for initialization
page_sizememory added to the pools supporting this->um_allocator(), this->device_allocator(), and this->pinned_allocator() in chunks of at least this size (bytes) [default=2^25]
pinned_alloc_limitthe maximum total amount of memory (in bytes) that allocator returned by this->pinned_allocator() can allocate [default=2^40]

Definition at line 52 of file env.h.

Here is the caller graph for this function:

◆ instance()

static std::unique_ptr< Env > & ttg::Env::instance ( )
inlinestatic

access the singleton instance; if not initialized will be initialized via Env::initialize() with the default params

Definition at line 37 of file env.h.

Here is the call graph for this function:

◆ operator=() [1/2]

Env & ttg::Env::operator= ( const Env )
delete

◆ operator=() [2/2]

Env & ttg::Env::operator= ( Env &&  )
delete

◆ pinned_allocator()

auto & ttg::Env::pinned_allocator ( )
inline
Returns
an Umpire allocator that allocates from a pinned memory pool
Warning
this is not a thread-safe allocator, should be only used when wrapped into umpire_based_allocator_impl

Definition at line 94 of file env.h.

◆ pinned_allocator_getActualHighWatermark()

std::size_t ttg::Env::pinned_allocator_getActualHighWatermark ( )
inline
Returns
the max actual amount of memory held by pinned_allocator()

returns the value provided by umpire::strategy::QuickPool::getHighWatermark()

Note
if there is only 1 Umpire allocator using PINNED memory this should be identical to the value returned by umpire::ResourceManager::getInstance().getAllocator("PINNED").getHighWatermark()

Definition at line 101 of file env.h.


The documentation for this class was generated from the following file: