setaffinity - Manipulate affinities from command line
Typical usage:
$ setaffinity 675 676 679 1011
Options synopsis:
$ 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 <sergey.aleynikov@gmail.com>
To install BSD::Process::Affinity, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BSD::Process::Affinity
CPAN shell
perl -MCPAN -e shell install BSD::Process::Affinity
For more information on module installation, please visit the detailed CPAN module installation guide.