poolStartup
File for user-defined options to run on each worker when parallel pool starts
Syntax
Description
poolStartup
runs automatically on a worker each time the worker
forms part of a parallel pool. You do not call this function from the client session, nor
explicitly as part of a task function.
To define the pool initialization on the worker, add MATLAB® code to the poolStartup.m
file. The worker looks for
poolStartup.m
in this order, executing the first one it finds:
Included in the
AttachedFiles
property of the job.In a folder included in the
AdditionalPaths
property of the job.In the worker MATLAB installation at this location:
matlabroot/toolbox/parallel/user/poolStartup.m
To create a version of poolStartup.m
for the
AttachedFiles
or AdditionalPaths
properties,
copy the provided file and modify it as
required.
matlabroot/toolbox/parallel/user/poolStartup.m
Use the poolStartup
function to run startup code required for
parallel execution on the parallel pool. For example, you might want to include code for
using mpiSettings
. Because jobStartup
and taskStartup
execute before
poolStartup
, they are not suited to pool-specific code. Use
taskStartup
for setup code on your worker regardless of whether the
task is from an independent job, communicating job, or using a parallel pool. Use
poolStartup
to setup code for pool usage only.
For further details on poolStartup
and its implementation, see the
text in the installed poolStartup.m
file.
Version History
Introduced in R2010a