Main Content

mjs

R2026b

Control the mjs service associated with MATLAB Job Scheduler

The mjs service makes sure that all other MATLAB® Job Scheduler processes are running and that it is possible to communicate with them. Use the mjs script to start and stop the mjs service. When the mjs service is running, you can use the nodestatus command to obtain information about the mjs service and all the processes it maintains.

The mjs 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

mjs install
mjs uninstall
mjs start
mjs stop
mjs console
mjs restart
mjs status
mjs ___ --options

Description

mjs install installs the mjs service in the Microsoft® Windows Service Control Manager. This command configures the service to start automatically when the Windows operating system boots. On Windows operating systems, you must install the service before you can start it.

mjs uninstall uninstalls the mjs service from the Windows Service Control Manager. If you want to install the mjs service under a different user account, you must first uninstall the existing service and then reinstall as the new user. Uninstalling the mjs service is only required on Windows operating systems.

mjs start starts the mjs service. This command creates the required logging and checkpointing folders, and then starts the service as specified in the mjs_def file.

mjs stop stops the mjs service. This command automatically stops all job managers and workers on the computer, but preserves their checkpoint information so that they can restart when the mjs service starts again.

mjs console starts the mjs service as a process in the current terminal or command window rather than as a service running in the background.

mjs restart performs the equivalent of mjs stop followed by mjs start. This command is available only on Linux operating systems.

mjs status reports the status of the mjs service, indicating whether it is running and with what PID. Use nodestatus to obtain more detailed information about the mjs service. The mjs status command is available only on Linux operating systems.

mjs ___ --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
--clean

Perform a complete cleanup of all service checkpoint and log files before installing or starting the service, or after stopping or uninstalling it. This option deletes all information about any job managers or workers this service has ever maintained.

--cleanPreserveJobsClean all service checkpoint and log files before starting or after stopping the service, but preserve any existing jobs and tasks. This option deletes all information about any job managers or workers the service has ever maintained.
--mjsdef <mjs_defaults_file>

Specify an alternative mjs_def file instead of the one found in matlabroot/toolbox/parallel/bin. This file is provided for Linux (mjs_def.sh) and Windows (mjs_def.bat). For details about the contents of the mjs_def file, see Define MATLAB Job Scheduler Startup Parameters.

--useonlinelicensing

Use with mjs start to use online licensing for workers. Unless you specify --useonlinelicensing, the workers use the network license manager. This option overrides any value defined in the mjs_def file.

--versionDisplay version information.

Examples

expand all

On Windows operating systems, you must install the mjs service before you can start it.

.\mjs install
Setting permissions on LOGBASE C:\ProgramData\MJS\Log
Setting permissions on CHECKPOINTBASE C:\ProgramData\MJS\Checkpoint
Setting permissions on SECURITY_DIR C:\ProgramData\MJS\Checkpoint\security
Setting permissions on COMMUNICATIONBASE C:\ProgramData\MJS\Checkpoint\security\communication
Using existing mjs configuration file in CHECKPOINTBASE "C:\ProgramData\MJS\Checkpoint".
MATLAB Parallel Server installed.

Start the mjs service.

.\mjs start
MATLAB Parallel Server started.

Use the nodestatus command to obtain information about the mjs service processes running on the node.

Setting permissions on LOGBASE C:\ProgramData\MJS\Log
Setting permissions on CHECKPOINTBASE C:\ProgramData\MJS\Checkpoint
Setting permissions on SECURITY_DIR C:\ProgramData\MJS\Checkpoint\security
Setting permissions on COMMUNICATIONBASE C:\ProgramData\MJS\Checkpoint\security\communication
Using existing mjs configuration file in CHECKPOINTBASE "C:\ProgramData\MJS\Checkpoint".
.\nodestatus
Summary:
The mjs service on host1.dhcp.mycompany.com manages the following processes:
     Job manager lookup processes             0
     Backwards-compatible lookup processes    0
     Job managers                             0
     Workers                                  0
     Worker groups                            0

Note: The mjs service on host host1.dhcp.mycompany.com is not 
controlling any job managers or workers. To start a job manager or 
worker, use the startjobmanager or startworker command.

Start the mjs service.

./mjs start
Creating LOGBASE directory (/var/log/mjs).
Creating CHECKPOINTBASE directory (/var/lib/mjs).
Creating SECURITY_DIR directory (/var/lib/mjs/security).
Creating COMMUNICATIONBASE directory (/var/run/mjs).
A SECURITY_LEVEL has not been specified in the mjs_def file, so no security
features are enabled. As a best practice and to prevent this message, specify
a SECURITY_LEVEL in the mjs_def file.

Starting the MATLAB Parallel Server in the background.

Use the nodestatus command to obtain information about the mjs service processes running on the node.

./nodestatus
Summary:
The mjs service on host1.dhcp.mycompany.com manages the following processes:
     Job manager lookup processes             0
     Backwards-compatible lookup processes    0
     Job managers                             0
     Workers                                  0
     Worker groups                            0

Note: The mjs service on host host1.dhcp.mycompany.com is not 
controlling any job managers or workers. To start a job manager or 
worker, use the startjobmanager or startworker command.