python multi processing

import os
os.system("taskset -p %s" %os.getpid()) ## check the current affinity mask
os.system("taskset -p 0xffffffff %d" %os.getpid()) ## set new affinity mask

task set -p 0xffffffff [pid] # set process to a core

KMP_AFFINITY=“verbose” ## prevent process from being set only on core 0