diff options
author | Roland Haas <rhaas@caltech.edu> | 2012-03-20 09:28:03 -0700 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2012-09-11 18:23:12 +0100 |
commit | 4b5daec50c1db3c2926074337749bd1c4abada35 (patch) | |
tree | 3e61cac04f113486efe86796988fa12f2f11a00a /Carpet/Carpet/src/SetupGH.cc | |
parent | aceb8b80d1851fd41284f81982cf51b0e4dd00f8 (diff) |
Carpet: let thread run on any core [n0,n0+num_threads) instead of binding to
single core
This is the behaviour of eg. Kraken's aprun --cc numa_node.
Avoids using omp_get_thread_num().
Diffstat (limited to 'Carpet/Carpet/src/SetupGH.cc')
-rw-r--r-- | Carpet/Carpet/src/SetupGH.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc index da68b3162..9e56e0878 100644 --- a/Carpet/Carpet/src/SetupGH.cc +++ b/Carpet/Carpet/src/SetupGH.cc @@ -356,7 +356,9 @@ namespace Carpet { { cpu_set_t cpumask; CPU_ZERO(&cpumask); - CPU_SET(n0 + omp_get_thread_num(), &cpumask); + for (int i=0; i<mynthreads; ++i) { + CPU_SET(n0 + i, &cpumask); + } int const ierr = sched_setaffinity(0, sizeof(cpumask), &cpumask); assert (not ierr); } |