File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -765,7 +765,7 @@ int gotoblas_set_affinity(int pos) {
765
765
766
766
int mynode = 1 ;
767
767
768
- /* if number of threads is larger than inital condition */
768
+ /* if number of threads is larger than initial condition */
769
769
if (pos < 0 ) {
770
770
sched_setaffinity (0 , sizeof (cpu_orig_mask ), & cpu_orig_mask [0 ]);
771
771
return 0 ;
@@ -857,7 +857,14 @@ void gotoblas_affinity_init(void) {
857
857
common -> shmid = pshmid ;
858
858
859
859
if (common -> magic != SH_MAGIC ) {
860
+
861
+ #if defined(__GLIBC_PREREQ )
862
+ #if __GLIBC_PREREQ (2 , 7 )
860
863
cpu_set_t * cpusetp ;
864
+ #else
865
+ cpu_set_t cpuset ;
866
+ #endif
867
+ #endif
861
868
int nums ;
862
869
int ret ;
863
870
@@ -890,19 +897,19 @@ void gotoblas_affinity_init(void) {
890
897
}
891
898
CPU_FREE (cpusetp );
892
899
#else
893
- ret = sched_getaffinity (0 ,sizeof (cpu_set_t ), cpusetp );
900
+ ret = sched_getaffinity (0 ,sizeof (cpu_set_t ), & cpuset );
894
901
if (ret != 0 ) {
895
902
common -> num_procs = nums ;
896
903
} else {
897
904
#if !__GLIBC_PREREQ (2 , 6 )
898
905
int i ;
899
906
int n = 0 ;
900
907
for (i = 0 ;i < nums ;i ++ )
901
- if (CPU_ISSET (i ,cpusetp )) n ++ ;
908
+ if (CPU_ISSET (i ,& cpuset )) n ++ ;
902
909
common -> num_procs = n ;
903
910
}
904
911
#else
905
- common -> num_procs = CPU_COUNT (sizeof ( cpu_set_t ), cpusetp );
912
+ common -> num_procs = CPU_COUNT (& cpuset );
906
913
}
907
914
#endif
908
915
You can’t perform that action at this time.
0 commit comments