hpx/compute/host/numa_binding_allocator.hpp

See Public API for a list of names and headers that are part of the public HPX API.

Defines

NUMA_BINDING_ALLOCATOR_DEBUG
namespace hpx

Functions

static hpx::debug::enable_print<NUMA_BINDING_ALLOCATOR_DEBUG> hpx::nba_deb("NUM_B_A")
namespace compute
namespace host

Typedefs

template<typename T>
using numa_binding_helper_ptr = std::shared_ptr<numa_binding_helper<T>>
template<typename T>
struct numa_binding_allocator
#include <numa_binding_allocator.hpp>

The numa_binding_allocator allocates memory using a policy based on hwloc flags for memory binding. This allocator can be used to request data that is bound to one or more numa domains via the bitmap mask supplied

Public Types

typedef T value_type
typedef T *pointer
typedef T &reference
typedef T const &const_reference
typedef std::size_t size_type
typedef std::ptrdiff_t difference_type
template<>
using numa_binding_helper_ptr = std::shared_ptr<numa_binding_helper<T>>

Public Functions

numa_binding_allocator()
numa_binding_allocator(threads::hpx_hwloc_membind_policy policy, unsigned int flags)
numa_binding_allocator(numa_binding_helper_ptr bind_func, threads::hpx_hwloc_membind_policy policy, unsigned int flags)
numa_binding_allocator(numa_binding_allocator const &rhs)
template<typename U>
numa_binding_allocator(numa_binding_allocator<U> const &rhs)
numa_binding_allocator(numa_binding_allocator &&rhs)
numa_binding_allocator &operator=(numa_binding_allocator const &rhs)
numa_binding_allocator &operator=(numa_binding_allocator &&rhs)
pointer address(reference x) const
const_pointer address(const_reference x) const
pointer allocate(size_type n)
void deallocate(pointer p, size_type n)
size_type max_size() const
template<class U, class ...A>
void construct(U *const p, A&&... args)
template<class U>
void destroy(U *const p)
int get_numa_domain(void *page)
std::string get_page_numa_domains(void *addr, std::size_t len) const
void initialize_pages(pointer p, size_t n) const
std::string display_binding(pointer p, numa_binding_helper_ptr helper)
template<typename Binder>
std::shared_ptr<Binder> get_binding_helper_cast() const

Public Members

const typedef T* hpx::compute::host::numa_binding_allocator::const_pointer
std::shared_ptr<numa_binding_helper<T>> binding_helper_
threads::hpx_hwloc_membind_policy policy_
unsigned int flags_

Protected Functions

std::vector<threads::hwloc_bitmap_ptr> create_nodesets(threads::hwloc_bitmap_ptr bitmap) const
void touch_pages(pointer p, size_t n, numa_binding_helper_ptr helper, size_type numa_domain, std::vector<threads::hwloc_bitmap_ptr> const &nodesets) const
void bind_pages(pointer p, size_t n, numa_binding_helper_ptr helper, size_type numa_domain, std::vector<threads::hwloc_bitmap_ptr> const &nodesets) const

Private Members

std::mutex init_mutex
template<typename U>
struct rebind

Public Types

template<>
typedef numa_binding_allocator<U> other
template<typename T>
struct numa_binding_helper

Public Functions

virtual std::size_t operator()(const T*const, const T*const, std::size_t const, std::size_t const) const
virtual ~numa_binding_helper()
virtual const std::string &pool_name() const
virtual std::size_t memory_bytes() const
virtual std::size_t array_rank() const
virtual std::size_t array_size(std::size_t) const
virtual std::size_t memory_step(std::size_t) const
virtual std::size_t display_step(std::size_t) const
virtual std::string description() const

Public Members

std::string pool_name_ = "default"
namespace parallel
namespace execution
template<>
struct pool_numa_hint<numa_binding_allocator_tag>

Public Functions

int operator()(int const &domain) const