hpx/compute_local/host/numa_binding_allocator.hpp#
Defined in header hpx/compute_local/host/numa_binding_allocator.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace hpx
Functions
- inline hpx::debug::enable_print< NUMA_BINDING_ALLOCATOR_DEBUG > 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_helper#
-
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
-
using numa_binding_helper_ptr = std::shared_ptr<numa_binding_helper<T>>#
Public Functions
-
numa_binding_allocator() = default#
-
inline numa_binding_allocator(threads::hpx_hwloc_membind_policy policy, unsigned int flags)#
-
inline numa_binding_allocator(numa_binding_helper_ptr bind_func, threads::hpx_hwloc_membind_policy policy, unsigned int flags)#
-
inline numa_binding_allocator(numa_binding_allocator const &rhs)#
-
template<typename U>
inline numa_binding_allocator(numa_binding_allocator<U> const &rhs)#
-
inline numa_binding_allocator(numa_binding_allocator &&rhs) noexcept#
-
inline numa_binding_allocator &operator=(numa_binding_allocator const &rhs)#
-
inline numa_binding_allocator &operator=(numa_binding_allocator &&rhs) noexcept#
-
inline void initialize_pages(pointer p, size_t n) const#
Touches every page of the allocation starting at p so that each page is physically bound to the NUMA domain assigned to it by binding_helper_. One first-touch task per NUMA domain is dispatched and the call blocks until all of them complete.
- Parameters:
p – pointer to the start of the allocation to initialize.
n – number of elements to initialize.
- Pre:
Must be called from an HPX thread. init_mutex serializes concurrent calls to this function and is intentionally held across hpx::wait_all() below, which is a suspension point that may resume the calling HPX thread on a different OS worker thread. hpx::mutex (unlike std::mutex) supports this safely, and ignore_while_checking silences the HPX lock-checking layer’s warning about a lock spanning a suspension point.
-
inline std::string display_binding(pointer p, numa_binding_helper_ptr helper)#
Builds a human-readable, page-by-page description of how the allocation starting at p is bound across NUMA domains, suitable for debug output. init_mutex is held only for the duration of this synchronous call; unlike initialize_pages(), no suspension point is crossed while it is held.
- Parameters:
p – pointer to the start of the allocation to describe.
helper – binding helper describing the array layout used to compute per-page offsets.
- Returns:
a formatted string describing the domain binding of each page in the allocation.
Public Members
-
std::shared_ptr<numa_binding_helper<T>> binding_helper_#
-
threads::hpx_hwloc_membind_policy policy_#
-
unsigned int flags_#
Public Static Functions
-
static inline const_pointer address(const_reference x) noexcept#
-
static inline int get_numa_domain(void *page)#
Protected Functions
-
inline 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#
-
inline 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#
Protected Static Functions
-
static inline std::vector<threads::hwloc_bitmap_ptr> create_nodesets(threads::hwloc_bitmap_ptr const &bitmap)#
-
template<typename U>
struct rebind# Public Types
-
using other = numa_binding_allocator<U>#
-
using other = numa_binding_allocator<U>#
-
using numa_binding_helper_ptr = std::shared_ptr<numa_binding_helper<T>>#
-
template<typename T>
-
namespace host
-
namespace execution
-
namespace experimental
-
struct numa_binding_allocator_tag#
-
template<>
struct pool_numa_hint<numa_binding_allocator_tag># Public Functions
-
inline int operator()(int const &domain) const#
-
inline int operator()(int const &domain) const#
-
struct numa_binding_allocator_tag#
-
namespace experimental