Using parfor specifying the number of parallel workers, how does it relate to the number of CPUs?
Where M specifies the Maximum number of workers running in parallel, as both a cap, and a limit.
It may seem like a very obvious question and answer: is the number of workers equal to the CPUs available? That is, on a quadcore computer, the maximum number of workers would be 4?
A separate question, I've been advised I can set some settings using this written in somewhere before the parfor coding:
tempdir = getenv('TMPDIR')
c = parcluster
c.JobStorageLocation = tempdir
Would this specify the pool to 8 workers? In which case the code below for parfor would cap at 8 even if M is specifed as 10? What would happen if M was 4? Would it be capped at 4 or 8?
And where should theTMPDIR in tempdir = getenv('TMPDIR') be located?
Thanks a lot!