Note: To run a process dedicated on a CPU you can use the tasket
command. For example
taskset -c 5,11 python -m timeit 'sum(range(10**7))'
However, this will not guarantee that the CPUs 5,11 will be used for that process alone. The same CPU can be interrupted by the scheduler and may not be properly isolated. So inorder to isolate the CPU the following steps are to be taken. Another feature that could be turned off for these CPUs are the interrupt feature 'IRQ'. However this is not covered here.
- List all available cores and hyperthreads in your processor.
lscpu --all --extended