MATLAB: Using parfor on a cluster

parallel computingParallel Computing Toolboxparfor

I have 400 cores split across 20 nodes on my cluster and I am running the following command for parfor: `parfor(ifile2=ifile1:500,np2)` where np2=400. Instead of connecting to 400 workers, I get this in the output: connected to 12 workers.
Is there something wrong that is going on? I read somewhere that the 12 workers limit was only for R2013a and earlier; I am running R2016a (9.0.0.341360) 64-bit (glnxa64).

Best Answer

By default, preferred number of workers are defined as 12, so you need to change this value to much larger by "Parallel" -> "Parallel Preferences" -> "Preferred number of workers in a parallel pool".