MATLAB: Problem in running multiple parallel jobs on cluster

clusterparallel computingParallel Computing Toolboxparfor

Hi,
I'm running a program using parallel computing toolbox on a cluster (just a simple matlabpool-parfor loop). It happened that if I only have one program running, things are fine. However, when I submit the second job (using same functions with different parameters), I got an error in one of the programs that looks like:
_??? Error using ==> matlabpool at 127
> The interactive parallel job is unavailable.
> Most likely, the parallel job has been destroyed.
I can run these multiple jobs simultaneously with no problem without PCT (just use "for").
If anyone can help explain this behavior, I would be really appreciated.

Best Answer

Are you including the "matlabpool" command in your code to run on the cluster? If so, that's not the right way, you should be submitting a job which already has a pool available. For example,
numArgsOut = 1;
argsIn = {1, 2, 3};
job = batch( @myFcn, numArgsOut, argsIn, 'Matlabpool', 4 );
will submit a job where "myFcn" is run and can use PARFOR loops. See the batch documentation for more.