Main Content

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.mfile to define pool initialization on the worker. The worker looks forpoolStartup.min the following order, executing the one it finds first:

  1. Included in the job'sAttachedFilesproperty.

  2. In a folder included in the job'sAdditionalPathsproperty.

  3. In the worker’s MATLAB®installation at the location

    matlabroot/toolbox/parallel/user/poolStartup.m

To create a version ofpoolStartup.mforAttachedFilesorAdditionalPaths, copy the provided file and modify it as required. .

poolStartupis the ideal location for startup code required for parallel execution on the parallel pool. For example, you might want to include code for usingmpiSettings. BecausejobStartupandtaskStartupexecute beforepoolStartup, they are not suited to pool-specific code. In other words, you should usetaskStartupfor setup code on your worker regardless of whether the task is from an independent job, communicating job, or using a parallel pool; whilepoolStartupis for setup code for pool usage only.

For further details onpoolStartupand its implementation, see the text in the installedpoolStartup.mfile.

Version History

Introduced in R2010a