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;