From 6ae2f868fdad1c7077034e6557f1353773ed1ab3 Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Sat, 9 Feb 2013 18:18:55 +0100 Subject: [PATCH] Set the affinity. Only use 1 core of each module on bulldozer. --- driver/others/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver/others/init.c b/driver/others/init.c index f6924d5f4..44cdf9074 100644 --- a/driver/others/init.c +++ b/driver/others/init.c @@ -492,7 +492,7 @@ static void disable_affinity(void) { #ifndef USE_OPENMP for(i=0; i< count; i++){ - lprocmask[i] &= ((unsigned long *)&cpu_orig_mask[0])[i]; + lprocmask[i] &= common->avail[i]; } #endif @@ -751,7 +751,7 @@ void gotoblas_affinity_init(void) { if (common -> num_nodes > 1) numa_mapping(); common -> final_num_procs = 0; - for(i = 0; i < common -> avail_count; i++) common -> final_num_procs += popcount(common -> avail[i]); + for(i = 0; i < common -> avail_count; i++) common -> final_num_procs += rcount(common -> avail[i]) + 1; //Make the max cpu number. for (cpu = 0; cpu < common -> final_num_procs; cpu ++) common -> cpu_use[cpu] = 0;