Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 70462345 authored by BRAMAS Berenger's avatar BRAMAS Berenger

update binding functions

parent 29204aaa
......@@ -17,15 +17,23 @@ namespace FBinding {
inline int GetThreadBinding(){
inline long GetThreadBinding(){
// Mask will contain the current affinity
unsigned long mask = 0;
cpu_set_t mask;
// We need the thread pid (even if we are in openmp)
pid_t tid = (pid_t) syscall(SYS_gettid);
// Get the affinity
FAssertLF(sched_getaffinity(tid, sizeof(mask), (cpu_set_t*)&mask) != -1);
return int(mask>>1);
long cpus = 0;
for(size_t idxCpu = 0 ; idxCpu < sizeof(long)*8-1 ; ++idxCpu){
if(CPU_ISSET(idxCpu, &mask)){
cpus |= (1 << idxCpu);
return cpus;
return -1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment