poolStartup
File for user-defined options to run on each worker when parallel pool starts
Syntax
poolStartup
Description
poolStartup
自动运行一个工人每次症r forms part of a parallel pool. You do not call this function from the client session, nor explicitly as part of a task function.
You add MATLAB code to thepoolStartup.m
file to define pool initialization on the worker. The worker looks forpoolStartup.m
in the following order, executing the one it finds first:
Included in the job's
AttachedFiles
property.In a folder included in the job's
AdditionalPaths
property.In the worker’s MATLAB®installation at the location
matlabroot/toolbox/parallel/user/poolStartup.m
To create a version ofpoolStartup.m
forAttachedFiles
orAdditionalPaths
, copy the provided file and modify it as required. .
poolStartup
is the ideal location for startup code required for parallel execution on the parallel pool. For example, you might want to include code for usingmpiSettings
. BecausejobStartup
andtaskStartup
execute beforepoolStartup
, they are not suited to pool-specific code. In other words, you should usetaskStartup
for setup code on your worker regardless of whether the task is from an independent job, communicating job, or using a parallel pool; whilepoolStartup
is for setup code for pool usage only.
For further details onpoolStartup
and its implementation, see the text in the installedpoolStartup.m
file.