Skip to content

Commit a287858

Browse files
committed
NUMA optional
1 parent adb2834 commit a287858

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/testROC.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ InfoLogger theLog;
1818
#include <time.h>
1919

2020
#include <sys/mman.h>
21+
22+
#ifdef WITH_NUMA
2123
#include <numa.h>
24+
#endif
25+
2226
#include <sched.h>
2327
#include <sys/types.h>
2428
#include <sys/stat.h>
@@ -220,13 +224,17 @@ int main(int argc, char**argv) {
220224

221225
// bind alloc/exec on numa node
222226
if (numaNodeId>=0) {
227+
#ifdef WITH_NUMA
223228
struct bitmask *nodemask;
224229
nodemask=numa_allocate_nodemask();
225230
if (nodemask==NULL) {return -1;}
226231
numa_bitmask_clearall(nodemask);
227232
numa_bitmask_setbit(nodemask,numaNodeId);
228233
numa_bind(nodemask);
229234
printf("Locked to numa node %d\n",numaNodeId);
235+
#else
236+
printf("Can not set numaNode ... program compiled without NUMA support\n");
237+
#endif
230238
}
231239

232240

0 commit comments

Comments
 (0)