Main Content

startworker

Start MATLAB worker session

Syntax

startworker
startworker -flags

Description

startworker starts a MATLAB® worker process under the mjs service, which maintains it after that. The worker registers with the specified job manager, from which it will get tasks for evaluation. The mjs service must already be running on the specified computer.

The startworker executable resides in the folder matlabroot\toolbox\parallel\bin (Windows® operating system) or matlabroot/toolbox/parallel/bin (UNIX® operating system). Enter the following command syntax at a Windows or UNIX command-line prompt, respectively.

startworker -flags accepts the following input flags. Multiple flags can be used together on the same command, except where noted.

FlagOperation
-name <worker_name>

Specifies the name of the MATLAB worker. The default is the value of the DEFAULT_WORKER_NAME parameter in the mjs_def file.

-remotehost <hostname>

Specifies the name of the computer where you want to start the MATLAB worker. If omitted, the worker is started on the local computer.

-jobmanager <job_manager_name>

Specifies the name of the job manager this MATLAB worker will receive tasks from. The default is the value of the DEFAULT_JOB_MANAGER_NAME parameter in the mjs_def file.

-jobmanagerhost <job_manager_hostname>

Specifies the host on which the job manager is running. The worker contacts the job manager lookup process on that host to register with the job manager.

This overrides the setting of JOB_MANAGER_HOST in the mjs_def file on the worker computer. You must specify the job manager host by one of these means.

-clean

Deletes all checkpoint information associated with this worker name before starting.

-num <num_workers>

Specifies the number of workers to start. The default is one. If starting more than one worker, worker names will have '_1', '_2', and so on, appended to them.

-baseport <port_number>

Specifies the base port that the mjs service on the remote host is using. You only need to specify this if the value of BASE_PORT in the local mjs_def file does not match the base port being used by the mjs service on the remote host.

-secretfile <path_to_shared_secret_file>

Specifies the path to the shared secret file to use to authenticate the command. Use this flag to override the value of SHARED_SECRET_FILE in the local mjs_def file. If not specified, the command will attempt to use the path in the local mjs_def file or the default location:

$CHECKPOINTBASE/security/secret

-v

Verbose mode displays the progress of the command execution.

Examples

Start a worker on the local host, using the default worker name, registering with the job manager MyJobManager on the host JMHost.

startworker -jobmanager MyJobManager -jobmanagerhost JMHost

Start a worker on the host WorkerHost, using the default worker name, and registering with the job manager MyJobManager on the host JMHost. (The following command should be entered on a single line.)

startworker -jobmanager MyJobManager -jobmanagerhost JMHost 
               -remotehost WorkerHost

Start two workers, named worker_1 and worker_2, on the host WorkerHost, registering with the job manager MyJobManager that is running on the host JMHost. (The following command should be entered on a single line.)

startworker -num 2 -name worker -remotehost WorkerHost 
               -jobmanager MyJobManager -jobmanagerhost JMHost