|
UMPIRE
Umpire: resource management and provision
|
Namespaces | |
| alloc | |
| detail | |
| event | |
| numa | |
| op | |
| resource | |
| strategy | |
| util | |
Classes | |
| class | Allocator |
| Provides a unified interface to allocate and free data. More... | |
| class | DeviceAllocator |
| Lightweight allocator for use in GPU code. More... | |
| class | ResourceManager |
| class | TypedAllocator |
| Allocator for objects of type T. More... | |
| class | runtime_error |
| class | out_of_memory_error |
| class | unknown_pointer_error |
| class | resource_error |
| struct | MemoryResourceTraits |
Typedefs | |
| using | Platform = camp::resources::Platform |
Enumerations | |
| enum class | Tracking { Tracked , Untracked } |
Functions | |
| std::ostream & | operator<< (std::ostream &os, const Allocator &allocator) |
| std::string | to_string (const Allocator &a) |
| __host__ __device__ DeviceAllocator | get_device_allocator (const char *name) |
| __host__ __device__ DeviceAllocator | get_device_allocator (int da_id) |
| __host__ __device__ bool | is_device_allocator (const char *name) |
| __host__ __device__ bool | is_device_allocator (int da_id) |
| __host__ DeviceAllocator | make_device_allocator (Allocator allocator, size_t size, const std::string &name) |
| Construct a new DeviceAllocator. Calls the private Device Allocator constructor that records the associated id. More... | |
| __host__ void | destroy_device_allocator () |
| template<typename U , typename V > | |
| bool | operator== (const TypedAllocator< U > &, const TypedAllocator< V > &) |
| template<typename U , typename V > | |
| bool | operator!= (const TypedAllocator< U > &, const TypedAllocator< V > &) |
| void | print_allocator_records (Allocator allocator, std::ostream &os=std::cout) |
| Print the allocations from a specific allocator in a human-readable format. More... | |
| std::vector< util::AllocationRecord > | get_allocator_records (Allocator allocator) |
| Returns vector of AllocationRecords created by the allocator. More... | |
| bool | pointer_overlaps (void *left, void *right) |
| Check whether the right allocation overlaps the left. More... | |
| bool | pointer_contains (void *left, void *right) |
| Check whether the left allocation contains the right. More... | |
| bool | is_accessible (Platform p, Allocator a) |
| Check whether or not an Allocator is accessible from a given platform. More... | |
| std::string | get_backtrace (void *ptr) |
| Get the backtrace associated with the allocation of ptr. More... | |
| std::size_t | get_process_memory_usage_hwm () |
| Get high watermark memory usage of the current process (uses underlying system-dependent calls) More... | |
| std::size_t | get_process_memory_usage () |
| Get memory usage of the current process (uses underlying system-dependent calls) More... | |
| std::size_t | get_internal_memory_usage () |
| Get the current memory usage for internal Umpire data structures. More... | |
| void | mark_event (const std::string &event) |
| Mark an application-specific event string within Umpire life cycle. More... | |
| std::size_t | get_total_bytes_allocated () |
| Get the total umpire memory usage in bytes across all memory resources. More... | |
| std::size_t | get_device_memory_usage (int device_id) |
| Get memory usage of device device_id, using appropriate underlying vendor API. More... | |
| std::vector< util::AllocationRecord > | get_leaked_allocations (Allocator allocator) |
| Get all the leaked (active) allocations associated with allocator. More... | |
| umpire::MemoryResourceTraits | get_default_resource_traits (const std::string &name) |
| Return the default traits for the given allocator string. More... | |
| void * | find_pointer_from_name (Allocator allocator, const std::string &name) |
| Return the pointer of an allocation for the given allocator and name. More... | |
| void | register_external_allocation (void *ptr, util::AllocationRecord record) |
| util::AllocationRecord | deregister_external_allocation (void *ptr) |
| camp::resources::Resource | get_resource (Allocator a, void *ptr) |
| Returns the Camp resource associated with a particular allocation This function is used mainly for testing purposes. More... | |
| std::size_t | get_num_pending (Allocator a) |
| Returns the number of pending chunks associated with a ResourceAwarePool Allocator This function is used mainly for testing purposes. More... | |
| bool | try_coalesce (Allocator a) |
| Attempt to coalesce Allocator a, return true if a coalesce was performed. More... | |
| void | coalesce (Allocator a) |
| Attempt to coalesce Allocator a, throw if a does not support coalescing. More... | |
| void | initialize () |
| void | finalize () |
| void * | malloc (std::size_t size) |
| Allocate memory in the default space, with the default allocator. More... | |
| void | free (void *ptr) |
| Free any memory allocated with Umpire. More... | |
| int | get_major_version () |
| int | get_minor_version () |
| int | get_patch_version () |
| std::string | get_rc_version () |
| MemoryResourceTraits::vendor_type | cpu_vendor_type () noexcept |
| std::ostream & | log () |
| std::ostream & | error () |
| std::string | to_string (const MemoryResourceTraits::shared_scope &scope) |
| std::string | to_string (const MemoryResourceTraits::optimized_for &value) |
| std::string | to_string (const MemoryResourceTraits::vendor_type &vendor) |
| std::string | to_string (const MemoryResourceTraits::memory_type &type) |
| std::string | to_string (const MemoryResourceTraits::resource_type &resource) |
| std::string | to_string (const MemoryResourceTraits::granularity_type &granularity) |
| long | get_page_size () |
| std::string | platform_to_string (Platform type) |
Variables | |
| DeviceAllocator * | UMPIRE_DEV_ALLOCS_h {nullptr} |
| __device__ DeviceAllocator * | UMPIRE_DEV_ALLOCS {nullptr} |
| constexpr int | UMPIRE_TOTAL_DEV_ALLOCS {64} |
| using umpire::Platform = typedef camp::resources::Platform |
|
strong |
| std::ostream& umpire::operator<< | ( | std::ostream & | os, |
| const Allocator & | allocator | ||
| ) |
|
inline |
| __host__ __device__ DeviceAllocator umpire::get_device_allocator | ( | const char * | name | ) |
References UMPIRE_DEV_ALLOCS, UMPIRE_DEV_ALLOCS_h, and UMPIRE_ERROR.
| __host__ __device__ DeviceAllocator umpire::get_device_allocator | ( | int | da_id | ) |
References is_device_allocator(), UMPIRE_DEV_ALLOCS, UMPIRE_DEV_ALLOCS_h, UMPIRE_ERROR, and UMPIRE_TOTAL_DEV_ALLOCS.
| __host__ __device__ bool umpire::is_device_allocator | ( | const char * | name | ) |
References umpire::DeviceAllocator::isInitialized(), UMPIRE_DEV_ALLOCS, UMPIRE_DEV_ALLOCS_h, UMPIRE_ERROR, UMPIRE_LOG, and umpire::util::message::Warning.
Referenced by get_device_allocator().
| __host__ __device__ bool umpire::is_device_allocator | ( | int | da_id | ) |
| __host__ DeviceAllocator umpire::make_device_allocator | ( | Allocator | allocator, |
| size_t | size, | ||
| const std::string & | name | ||
| ) |
Construct a new DeviceAllocator. Calls the private Device Allocator constructor that records the associated id.
| allocator | Allocator to build the DeviceAllocator from. |
| size | Total size of the DeviceAllocator. |
| name | of the DeviceAllocator |
| __host__ void umpire::destroy_device_allocator | ( | ) |
| bool umpire::operator== | ( | const TypedAllocator< U > & | lhs, |
| const TypedAllocator< V > & | rhs | ||
| ) |
| bool umpire::operator!= | ( | const TypedAllocator< U > & | lhs, |
| const TypedAllocator< V > & | rhs | ||
| ) |
| void umpire::print_allocator_records | ( | Allocator | allocator, |
| std::ostream & | os = std::cout |
||
| ) |
Print the allocations from a specific allocator in a human-readable format.
| allocator | source Allocator. |
| os | output stream |
Referenced by umpire::ResourceManager::~ResourceManager().
| std::vector< util::AllocationRecord > umpire::get_allocator_records | ( | Allocator | allocator | ) |
Returns vector of AllocationRecords created by the allocator.
| allocator | source Allocator. |
Referenced by umpire::ResourceManager::destroyAllocator(), and get_leaked_allocations().
| bool umpire::pointer_overlaps | ( | void * | left, |
| void * | right | ||
| ) |
Check whether the right allocation overlaps the left.
right will overlap left if the right is greater than left, but less than left+size, and right+size is strictly greater than left+size.
| left | Pointer to left allocation |
| right | Poniter to right allocation |
References umpire::util::message::Error, umpire::ResourceManager::getInstance(), and UMPIRE_LOG.
Referenced by umpire_pointer_overlaps().
| bool umpire::pointer_contains | ( | void * | left, |
| void * | right | ||
| ) |
Check whether the left allocation contains the right.
right is contained by left if right is greater than left, and right+size is greater than left+size.
| left | Pointer to left allocation |
| right | Poniter to right allocation |
References umpire::util::message::Error, umpire::ResourceManager::getInstance(), and UMPIRE_LOG.
Referenced by umpire_pointer_contains().
Check whether or not an Allocator is accessible from a given platform.
This function describes which allocators should be accessible from which CAMP platforms. Information on platform/allocator accessibility can be found at https://umpire.readthedocs.io/en/develop/features/allocator_accessibility.html
| camp::Platform | p |
| umpire::Allocator | a |
References umpire::Allocator::getAllocationStrategy(), umpire::strategy::AllocationStrategy::getParent(), and umpire::resource::MemoryResource::isAccessibleFrom().
| std::string umpire::get_backtrace | ( | void * | ptr | ) |
Get the backtrace associated with the allocation of ptr.
The string may be empty if backtraces are not enabled.
References umpire::ResourceManager::getInstance(), umpire::event::record(), and UMPIRE_USE_VAR.
Referenced by umpire_get_backtrace_bufferify().
| std::size_t umpire::get_process_memory_usage_hwm | ( | ) |
Get high watermark memory usage of the current process (uses underlying system-dependent calls)
Referenced by umpire_get_process_memory_usage_hwm().
| std::size_t umpire::get_process_memory_usage | ( | ) |
Get memory usage of the current process (uses underlying system-dependent calls)
Referenced by umpire_get_process_memory_usage().
| std::size_t umpire::get_internal_memory_usage | ( | ) |
Get the current memory usage for internal Umpire data structures.
References umpire::ResourceManager::getInstance(), and umpire::ResourceManager::getInternalMemoryUsage().
| void umpire::mark_event | ( | const std::string & | event | ) |
Mark an application-specific event string within Umpire life cycle.
References umpire::event::metadata, and umpire::event::record().
| std::size_t umpire::get_total_bytes_allocated | ( | ) |
Get the total umpire memory usage in bytes across all memory resources.
References umpire::Allocator::getActualSize(), and umpire::ResourceManager::getInstance().
| std::size_t umpire::get_device_memory_usage | ( | int | device_id | ) |
Get memory usage of device device_id, using appropriate underlying vendor API.
References UMPIRE_ERROR, and UMPIRE_USE_VAR.
Referenced by umpire_get_device_memory_usage().
| std::vector< util::AllocationRecord > umpire::get_leaked_allocations | ( | Allocator | allocator | ) |
Get all the leaked (active) allocations associated with allocator.
References get_allocator_records().
| umpire::MemoryResourceTraits umpire::get_default_resource_traits | ( | const std::string & | name | ) |
Return the default traits for the given allocator string.
References umpire::resource::MemoryResourceRegistry::getInstance().
Referenced by umpire::strategy::DeviceIpcAllocator::DeviceIpcAllocator().
| void * umpire::find_pointer_from_name | ( | Allocator | allocator, |
| const std::string & | name | ||
| ) |
Return the pointer of an allocation for the given allocator and name.
References umpire::resource::HostSharedMemoryResource::find_pointer_from_name(), umpire::Allocator::getName(), UMPIRE_ERROR, and UMPIRE_USE_VAR.
| void umpire::register_external_allocation | ( | void * | ptr, |
| util::AllocationRecord | record | ||
| ) |
| util::AllocationRecord umpire::deregister_external_allocation | ( | void * | ptr | ) |
| camp::resources::Resource umpire::get_resource | ( | Allocator | a, |
| void * | ptr | ||
| ) |
Returns the Camp resource associated with a particular allocation This function is used mainly for testing purposes.
| Umpire | allocator which was used to allocate the data |
| Pointer | which was used for the allocation |
References umpire::Allocator::getAllocationStrategy(), umpire::Allocator::getName(), UMPIRE_ERROR, UMPIRE_LOG, and umpire::util::message::Warning.
| std::size_t umpire::get_num_pending | ( | Allocator | a | ) |
Returns the number of pending chunks associated with a ResourceAwarePool Allocator This function is used mainly for testing purposes.
| Umpire | ResourceAwarePool allocator |
References umpire::Allocator::getAllocationStrategy(), umpire::Allocator::getName(), and UMPIRE_ERROR.
| bool umpire::try_coalesce | ( | Allocator | a | ) |
Attempt to coalesce Allocator a, return true if a coalesce was performed.
References umpire::strategy::DynamicPoolList::coalesce(), umpire::strategy::QuickPool::coalesce(), and umpire::Allocator::getAllocationStrategy().
Referenced by coalesce().
| void umpire::coalesce | ( | Allocator | a | ) |
Attempt to coalesce Allocator a, throw if a does not support coalescing.
| umpire::util::Exception | if the Allocator doesn't support coalescing. |
References umpire::Allocator::getName(), try_coalesce(), and UMPIRE_ERROR.
|
inline |
References umpire::util::MPI::initialize().
| void umpire::finalize | ( | ) |
|
inline |
Allocate memory in the default space, with the default allocator.
This method is a convenience wrapper around calls to the ResourceManager to allocate memory in the default MemorySpace.
| size | Number of bytes to allocate. |
References umpire::Allocator::allocate(), umpire::ResourceManager::getDefaultAllocator(), and umpire::ResourceManager::getInstance().
Referenced by umpire::alloc::MallocAllocator::allocate(), and StdAllocator::allocate().
|
inline |
Free any memory allocated with Umpire.
This method is a convenience wrapper around calls to the ResourceManager, it can be used to free allocations from any MemorySpace. *
| ptr | Address to free. |
References umpire::ResourceManager::deallocate(), and umpire::ResourceManager::getInstance().
Referenced by umpire::alloc::MallocAllocator::deallocate(), umpire::alloc::PosixMemalignAllocator::deallocate(), StdAllocator::deallocate(), umpire::alloc::SyclMallocAllocator::deallocate(), umpire::alloc::SyclPinnedAllocator::deallocate(), umpire::alloc::SyclMallocManagedAllocator::deallocate(), umpire::event::json_file_store::get_events(), umpire::strategy::FixedPool::release(), umpire::util::FixedMallocPool::~FixedMallocPool(), and umpire::strategy::FixedPool::~FixedPool().
|
inline |
Referenced by umpire_get_major_version().
|
inline |
Referenced by umpire_get_minor_version().
|
inline |
Referenced by umpire_get_patch_version().
|
inline |
|
noexcept |
| std::ostream & umpire::log | ( | ) |
Referenced by umpire::util::flush_files(), umpire::util::initialize_io(), and umpire::util::Logger::logMessage().
| std::ostream & umpire::error | ( | ) |
Referenced by umpire::alloc::CudaMallocManagedAllocator::allocate(), umpire::alloc::CudaPinnedAllocator::allocate(), umpire::alloc::HipMallocManagedAllocator::allocate(), umpire::alloc::HipPinnedAllocator::allocate(), umpire::resource::HipConstantMemoryResource::allocate(), umpire::alloc::CudaMallocAllocator::allocate(), umpire::alloc::HipMallocAllocator::allocate(), umpire::op::CudaMemPrefetchOperation::apply(), umpire::op::CudaMemsetOperation::apply(), umpire::op::HipMemsetOperation::apply(), umpire::op::CudaAdviseOperation::apply(), umpire::op::HipAdviseOperation::apply(), umpire::op::CudaMemPrefetchOperation::apply_async(), umpire::op::CudaMemsetOperation::apply_async(), umpire::op::HipMemsetOperation::apply_async(), umpire::op::CudaGetAttributeOperation< ATTRIBUTE >::check_apply(), umpire::alloc::CudaMallocAllocator::deallocate(), umpire::alloc::CudaMallocManagedAllocator::deallocate(), umpire::alloc::CudaPinnedAllocator::deallocate(), umpire::alloc::HipMallocAllocator::deallocate(), umpire::alloc::HipMallocManagedAllocator::deallocate(), umpire::alloc::HipPinnedAllocator::deallocate(), umpire::util::flush_files(), umpire::util::initialize_io(), umpire::op::CudaCopyOperation::transform(), umpire::op::HipCopyOperation::transform(), umpire::op::CudaCopyOperation::transform_async(), and umpire::op::HipCopyOperation::transform_async().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References umpire::MemoryResourceTraits::device, umpire::MemoryResourceTraits::device_const, umpire::MemoryResourceTraits::file, umpire::MemoryResourceTraits::host, umpire::MemoryResourceTraits::pinned, umpire::MemoryResourceTraits::shared, umpire::MemoryResourceTraits::um, and umpire::MemoryResourceTraits::unknown.
|
inline |
| long umpire::get_page_size | ( | ) |
Referenced by umpire::alloc::PosixMemalignAllocator::allocate().
|
inline |
| DeviceAllocator * umpire::UMPIRE_DEV_ALLOCS_h {nullptr} |
| __device__ DeviceAllocator * umpire::UMPIRE_DEV_ALLOCS {nullptr} |
Referenced by get_device_allocator(), and is_device_allocator().
|
constexpr |
Referenced by destroy_device_allocator(), get_device_allocator(), and is_device_allocator().