startworker
R2026bStart MATLAB worker process
After starting the mjs service on a worker node, use the
startworker script to launch workers on that node. Workers execute
tasks assigned by a job manager. Each worker registers with a specified job manager and
waits for tasks. As a best practice, start as many workers as you have physical cores on the
worker node.
The
startworker executable resides in the folder
(Windows® operating system) or matlabroot\toolbox\parallel\bin
(Linux® operating system). Enter the command at a Windows or Linux command-line prompt, respectively.matlabroot/toolbox/parallel/bin
Syntax
startworker
startworker --options
Description
startworker starts a MATLAB® worker process under the mjs service. The
mjs service must already be running on the target computer.
startworker accepts the
following input options. You can use multiple options together in the same command, except
where noted. Precede each option with two dashes (--options--).
Before R2026b: To specify an option, use a single dash
(-).
| Option | Operation |
|---|---|
--name <worker_name> | Specify the name of the MATLAB worker. The default is the value of the
|
--jobmanager <job_manager_name> | Specify the name of the job manager the worker registers with. The
worker receives tasks from this job manager. The default is the value of
|
--jobmanagerhost <job_manager_hostname> | Specify the host where the job manager is running. When you use this
option, the worker uses unicast to contact the job manager lookup process on
that host during registration. This option overrides the
|
--clean | Delete checkpoint information from previous instances of the worker with the same name. |
--num <num_workers> | Specifies the number of workers to start. The default is one. When
starting multiple workers, the worker name is appended with
|
--remotehost <hostname> | Specify the host on which to start the MATLAB worker. If you do not specify a host, the worker is started on the local host. |
--baseport <port_number> | Specify the base port used by the |
--secretfile <path_to_shared_secret_file> |
Specify the path to the shared secret file to use to sign the
command. This option is required when the $CHECKPOINTBASE/security/secret |
--verbose, -v | Display detailed progress information about the command execution. |
Examples
Start a worker on the local host, using the default worker name, registering with the
job manager named MyJobManager on the host
JMHost.
startworker --jobmanager MyJobManager --jobmanagerhost JMHostStart a worker on the host WorkerHost, using the default worker name,
and registering with the job manager named MyJobManager on the host
JMHost.
startworker --jobmanager MyJobManager --jobmanagerhost JMHost --remotehost WorkerHostStart two workers, named worker_1 and worker_2, on
the host WorkerHost, registering with the job manager named
MyJobManager that is running on the host
JMHost.
startworker --num 2 --name worker --remotehost WorkerHost --jobmanager MyJobManager --jobmanagerhost JMHost
See Also
mjs | nodestatus | startjobmanager | stopjobmanager | stopworker