diff options
Diffstat (limited to 'src/run.cpp')
-rw-r--r-- | src/run.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/run.cpp b/src/run.cpp index 44a8319..3d41f71 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -23,9 +23,7 @@ #include <unistd.h> #include <cstddef> #include <algorithm> -#if defined(NUMA) #include <numa.h> -#endif // Local includes #include <AsmJit/AsmJit.h> @@ -67,7 +65,6 @@ int Run::run() { Chain** chain_memory = new Chain*[this->exp->chains_per_thread]; Chain** root = new Chain*[this->exp->chains_per_thread]; -#if defined(NUMA) // establish the node id where this thread // will run. threads are mapped to nodes // by the set-up code for Experiment. @@ -78,18 +75,14 @@ int Run::run() { // memory will be allocated. for (int i=0; i < this->exp->chains_per_thread; i++) { int alloc_node_id = this->exp->chain_domain[this->thread_id()][i]; - nodemask_t alloc_mask; - nodemask_zero(&alloc_mask); - nodemask_set(&alloc_mask, alloc_node_id); - numa_set_membind(&alloc_mask); + struct bitmask *bitmask = numa_allocate_nodemask(); + numa_bitmask_clearall(bitmask); + numa_bitmask_setbit(bitmask, alloc_node_id); + numa_set_membind(bitmask); + numa_free_nodemask(bitmask); chain_memory[i] = new Chain[ this->exp->links_per_chain ]; } -#else - for (int i = 0; i < this->exp->chains_per_thread; i++) { - chain_memory[i] = new Chain[this->exp->links_per_chain]; - } -#endif // initialize the chains and // select the function that |