defaulted cpu affinity to all cores

master
Ismael Gomez 8 years ago
parent 198c705fcd
commit a4498aeb1e

@ -65,7 +65,7 @@ bool threads_new_rt_cpu(pthread_t *thread, void *(*start_routine) (void*), void
fprintf(stderr, "Error not enough privileges to set Scheduling priority\n");
}
}
if(cpu != -1) {
if(cpu > 0) {
if(cpu > 50) {
int mask;
mask = cpu/100;
@ -73,14 +73,12 @@ bool threads_new_rt_cpu(pthread_t *thread, void *(*start_routine) (void*), void
CPU_ZERO(&cpuset);
for(int i = 0; i < 8;i++){
if(((mask >> i) & 0x01) == 1){
printf("Setting this worker with affinity to core %d\n", i);
CPU_SET((size_t) i , &cpuset);
}
}
} else {
CPU_ZERO(&cpuset);
CPU_SET((size_t) cpu, &cpuset);
printf("Setting CPU affinity to cpu_id=%d\n", cpu);
}
if(pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset)) {

@ -113,11 +113,11 @@ void parse_args(all_args_t *args, int argc, char* argv[]) {
/* Expert section */
("expert.phy.worker_cpu_mask",
bpo::value<int>(&args->expert.phy.worker_cpu_mask)->default_value(254),
bpo::value<int>(&args->expert.phy.worker_cpu_mask)->default_value(-1),
"cpu bit mask (eg 255 = 1111 1111)")
("expert.phy.sync_cpu_affinity",
bpo::value<int>(&args->expert.phy.sync_cpu_affinity)->default_value(2),
bpo::value<int>(&args->expert.phy.sync_cpu_affinity)->default_value(-1),
"index of the core used by the sync thread")
("expert.ue_category",

Loading…
Cancel
Save