Contenuto principale

resize

R2026b

Output or update resizing information for job manager processes

You can set your MATLAB® Job Scheduler cluster to resize automatically based on demand. For details, see Set Up MATLAB Job Scheduler Cluster for Auto-Resizing. Use the resize command to return information about the resizeable cluster while the cluster is running. You can also use the resize command to update the limits of the resizeable cluster.

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

Syntax

resize status
resize update
resize ___ --options

Description

resize status returns information about the job manager and worker processes in JSON format. The mjs service must already be running on the target computer. For each job manager, resize status displays the job manager's name, host name, desired and maximum number of Linux and Windows workers, and registered workers. The worker information includes their name, host, operating system, state, and number of seconds they have been idle. Use this information to decide whether you need to start or stop workers.

resize update updates resizing limits for the job manager processes. Use this argument with the --maxlinuxworkers and --maxwindowsworkers to specify new limits for the resizeable cluster.

resize ___ --options accepts the following options. You can use multiple options together in the same command. Precede each option with two dashes (--).

Before R2026b: To specify an option, use a single dash (-).

OptionOperation
--jobmanager

Specify the name of a single job manager process to query or update resizing information. If you do not use this option, the command outputs or updates resizing information for all job manager processes the mjs service maintains on the specified host.

--maxlinuxworkers

Update the maximum number of Linux workers the cluster can resize to on demand.

--maxwindowsworkers

Update the maximum number of Windows workers the cluster can resize to on demand.

--remotehost <hostname>

Specify the host of the mjs service that maintains the job manager processes. The default value is the local host.

--baseport <port_number>

Specify the base port used by the mjs service on the remote host. Use this option only when the remote host's base port differs from the local BASE_PORT value in the mjs_def file.

--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 mjs_def file of the mjs service has REQUIRE_SCRIPT_VERIFICATION=true. If you do not use this option and the mjs services requires script verification, the command attempts to use the secret file in the default location:

$CHECKPOINTBASE/security/secret

Examples

Display the resizing information of the job managers on the local host.

resize status
{
  "jobManagers": [
    {
      "name": "myJobManager",
      "host": "myhostname",
      "desiredWorkers": {
        "linux": 1,
        "windows": 0
      },
      "maxWorkers": {
        "linux": 4,
        "windows": 8,
      },
      "workers": [
        {
          "name": "worker_1",
          "host": "myhostname",
          "operatingSystem": "linux",
          "state": "busy",
          "secondsIdle": 0
        },
        {
          "name": "worker_2",
          "host": "myhostname",
          "operatingSystem": "linux",
          "state": "idle",
          "secondsIdle": 60
        }
      ]
    }
  ]
}

Display resizing information about the job managers on remote host node27.

resize status --remotehost node27

Display resizing information about the job manager named myJobManager on the local host.

resize status --jobmanager myJobManager

Update the maximum number of Linux workers for the job manager named MyJobManager on the local host.

resize update --jobmanager MyJobManager --maxlinuxworkers 8