- Linux only feature.
- Requires the Linux
tasksetcommand to be installed. - Usage :
addprocs(LocalAffinityManager(;np=CPU_CORES, mode::AffinityMode=BALANCED, affinities=[]); kwargs...).
where
npis the number of workers to be started.affinities, if specified, is a list of CPU IDs. As many workers as entries inaffinitiesare launched. Each worker is pinned to the specified CPU ID.mode(used only whenaffinitiesis not specified, can be eitherCOMPACTorBALANCED) -COMPACTresults in the requested number of workers pinned to cores in increasing order, For example, worker1 => CPU0, worker2 => CPU1 and so on.BALANCEDtries to spread the workers. Useful when we have multiple CPU sockets, with each socket having multiple cores. ABALANCEDmode results in workers spread across CPU sockets. Default isBALANCED.