first_cpu:-1;}intget_cpu_affinity_(void){returnget_cpu_affinity();}/* Fortran interface *//* * Set CPU affinity to one core. */voidset_cpu_affinity(int cpu){cpu_set_t coremask;/* core affinity mask */CPU_ZERO(&coremask);CPU_SET(cpu,&coremask);if(sched_setaffinity(gettid(),si...
// First, save our cpumask (the user may want it back.) cpu_set_t old; CPU_ZERO(&old); TC_CHECK_EQ(0, sched_getaffinity(0, sizeof(cpu_set_t), &old)); CpuSet old; old.Zero(); TC_CHECK_EQ(0, old.GetAffinity(0)); // Here's the basic idea: if we run on every CPU...
char **av) { int lc,num,i; /* loop counter */ char *msg; /* message returned from parse_opts */ - cpu_set_t mask; - unsigned int len = sizeof(cpu_set_t); + cpu_set_t *mask; + int nrcpus = 1024; + unsigned int len; /* parse standard options */ if ((msg = parse...