4 #include <sys/processor.h> 6 #include <sys/thread.h> 7 #include <sys/processor.h> 10 void aff_(
int* icpu,
int* ncpu)
13 *ncpu=sysconf(_SC_NPROCESSORS_ONLN);
26 if( 0 != bindprocessor(BINDTHREAD,t,*proc) )
27 fprintf(stderr,
"bindprocessor failed for thread = %d\n",t);
35 out=popen(
"mpstat -s | grep cpu | grep -v System | sed s/cpu//g",
"r");
46 out0=popen(
"bindprocessor -s 0",
"r");
47 out1=popen(
"bindprocessor -s 1",
"r");
48 fscanf(out0,
"%s %s %s %s",v1,v1,v1,v1);
49 fscanf(out1,
"%s %s %s %s",v1,v1,v1,v1);
50 for (ii=0; ii<*N; ii++)
52 fscanf(out0,
"%d",&i0[ii]);
53 fscanf(out1,
"%d",&i1[ii]);
void aff_(int *icpu, int *ncpu)
smtctl_(int *N, int *i0, int *i1)
subroutine t(CDPREF, CDSUFF, KCODPA, LDNIVA, PMULTI)