Main Content

pctRunOnAll

Run command on client and all workers in parallel pool

Syntax

pctRunOnAll command

Description

pctRunOnAll commandruns the specifiedcommandon all the workers of the parallel pool as well as the client, and prints any command-line output back to the client Command Window. The specifiedcommandruns in the base workspace of the workers and does not have any return variables. This is useful if there are setup changes that need to be performed on all the workers and the client.

Note

If you usepctRunOnAllto run a command such asaddpathin a mixed-platform environment, it can generate a warning on the client while executing properly on the workers. For example, if your workers are all running on Linux®operating systems and your client is running on a Microsoft®Windows®operating system, anaddpathargument with Linux-based paths will warn on the Windows-based client.

Examples

Clear all loaded functions on all workers:

pctRunOnAllclear功能

Change the directory on all workers to the project directory:

pctRunOnAllcd/opt/projects/c1456

Add some directories to the paths of all the workers:

pctRunOnAlladdpath({'/usr/share/path1' '/usr/share/path2'})

Limitations

  • pctRunOnAlldoes not support thread-based pools, such as those created byparpool("threads")andbackgroundPool.

Version History

Introduced in R2008a

See Also