client (Win): if ncpus < physical ncpus, use every other core in benchmarks

This commit is contained in:
David Anderson 2016-12-19 00:30:48 -08:00
parent b5d1119972
commit a3fa0b6b1c
1 changed files with 3 additions and 1 deletions

View File

@ -276,7 +276,9 @@ void CLIENT_STATE::start_cpu_benchmarks() {
NULL, 0, win_cpu_benchmarks, benchmark_descs+i, 0,
&benchmark_descs[i].pid
);
SetThreadAffinityMask(benchmark_descs[i].handle, 1<<i);
int n = host.p_ncpus;
j = (i >= n/2)? 2*i+1 : 2*i;
SetThreadAffinityMask(benchmark_descs[i].handle, 1<<j);
SetThreadPriority(benchmark_descs[i].handle, THREAD_PRIORITY_IDLE);
#else
sprintf(benchmark_descs[i].filename, "%s_%d.xml", CPU_BENCHMARKS_FILE_NAME, i);