User`s guide

createCommunicatingJob
11-53
simultaneously on all workers, and lab* functions can be used for communication
between workers.
job = createCommunicatingJob(...,'Profile','profileName',...)
creates a communicating job object with the property values specified in the profile
'profileName'. If no profile is specified and the cluster object has a value specified in
its 'Profile' property, the cluster’s profile is automatically applied.
Examples
Pool Type Communicating Job
Consider the function 'myFunction' which uses a parfor loop:
function result = myFunction(N)
result = 0;
parfor ii=1:N
result = result + max(eig(rand(ii)));
end
end
Create a communicating job object to evaluate myFunction on the default cluster:
myCluster = parcluster;
j = createCommunicatingJob(myCluster,'Type','pool');
Add the task to the job, supplying an input argument:
createTask(j, @myFunction, 1, {100});
Set the number of workers required for parallel execution:
j.NumWorkersRange = [5 10];
Run the job.
submit(j);
Wait for the job to finish and retrieve its results:
wait(j)
out = fetchOutputs(j)