Skip to content

Commit

Permalink
getting rid of dependence on libnuma
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLangmead committed Mar 24, 2016
1 parent 3d513f6 commit 55f9f1a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 23 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ OTHER_CPPS = ccnt_lut.cpp ref_read.cpp alphabet.cpp shmem.cpp \
edit.cpp ebwt.cpp

ifeq (1,$(WITH_COHORTLOCK))
LIBS += -lnuma
override EXTRA_FLAGS += -DWITH_COHORTLOCK=1
OTHER_CPPS += cohort.cpp cpu_numa_info.cpp
endif
Expand Down
1 change: 0 additions & 1 deletion cohort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#ifndef COHORT_H_
#define COHORT_H_

#include <numa.h>
#include <iostream>
#include <cstdio>
#include <assert.h>
Expand Down
18 changes: 0 additions & 18 deletions cpu_numa_info.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
#include "cpu_numa_info.h"

//adapted from http://stackoverflow.com/questions/7259363/measuring-numa-non-uniform-memory-access-no-observable-asymmetry-why
int bind_to_node(int thread_idx)
{
//int numcpus = numa_num_task_cpus()
//bitmask* bm = numa_bitmask_alloc(numcpus);
int num_nodes = numa_max_possible_node();
int numa_node = thread_idx % num_nodes;
bitmask* nm = numa_allocate_nodemask();
numa_bitmask_setbit(nm,numa_node);
//void numa_bind(struct bitmask *nodemask); sets node AND memory
//this one only sets node (not memeory)
//numa_run_on_node_mask(struct bitmask *nodemask);
numa_run_on_node_mask(nm);
numa_free_nodemask(nm);
return numa_node;
//numa_bitmask_free(bm);
}

/// Based on http://stackoverflow.com/questions/16862620/numa-get-current-node-core
void get_cpu_and_node_(int& cpu, int& node) {
unsigned long a,d,c;
Expand Down
3 changes: 0 additions & 3 deletions cpu_numa_info.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef CPU_AND_NODE_H_
#define CPU_AND_NODE_H_

#include <numa.h>

extern void get_cpu_and_node_(int& cpu, int& node);
extern int bind_to_node(int thread_idx);

#endif

0 comments on commit 55f9f1a

Please sign in to comment.