setaffinity - Manipulate affinities from command line
$ setaffinity 675 676 679 1011
$ setaffinity @pids affinity_mask
setaffinity expects list of pids with mask to be applied to them all coming last. Mask must be a string consisting of 0 and 1. CPU0 comes rightmost, here are two examples:
0101 - CPU0 + CPU2 1000 - CPU3 only
Mask is applied to all specified process, if anything fails, process is not aborted, but error description + pid are printed to STDERR.
Note that you can change affinity only of processes you own, only root can change others.
man 2 cpuset_getaffinity
man 2 cpuset
Sergey Aleynikov <email@example.com>