Interactive MATLAB (Xfce)

Opening MATLAB Form

  • The first step is to select the Interactive apps and then click the MATLAB (Xfce) GUI in the Open OnDemand dashboard.

  • Then you will see a form which needs to be filled to launch the MATLAB GUI on compute nodes.

MATLAB Form

Partition

  • Partitions are work queues that has computational nodes in it to run the jobs. The partitions available in Colibri are general-cpu, general-gpu, interactive-cpu, interactive-gpu, backfill, inbre, and prism.

  • However, you will see only the list of authorized partitions available for your Colibri account and hence, you won’t see the partitions which you don’t have authorization in the select dropdown.

  • Select one of the partitions where you want to submit your job. Refer to the page → Partitions in Colibri to select the ideal partition for your job.

  • Jobs on the backfill partition are subject to being stopped and requeued.

Walltime(Hours)

  • Sets the Walltime for your job. The job gets killed if the Walltime you set gets elapsed. The maximum Walltime for each partition is listed in the table below.

    Partition Max Hours

    backfill

    338

    general-cpu

    169

    general-gpu

    169

    inbre

    169

    interactive-cpu

    25

    interactive-gpu

    25

    prism

    169

CPUs(Threads)

  • Sets the Number of CPUs(Threads) for the job. The default and minimum value is 1 CPU thread.

Memory (GB/Gigabytes)

  • Sets the memory for the job in terms of GB. The memory you select is available to all assigned threads for the job. The default and minimum value is 1 GB.

  • MATLAB Parallel Kit, or workers, requires Simultaneous Multithreading(SMT)/HT to be disabled. Hence, SMT is disabled for MATLAB by default.

GPUs

  • GPUs are available only in the partitions that contain GPU nodes: general-gpu, interactive-gpu, backfill, inbre, and prism. If you select one of these partitions, you can see the GPUs dropdown enabled.

Node Selection

This is an optional node selection feature for submissions to Slurm. It allows users to specify a particular node or any node with specific feature flags.

Selection Options

There are four available options for node selection:

  1. Disabled: This is the default setting. When "Disabled" is selected, the application will not send any specific node preferences to Slurm during job submission.

  2. Node List: With this option, users can specify a particular node (one single node) where the job should run.

  3. Node Features (--constraint): Users can select this option if they want to run their job on any node that meets a specific feature.

  4. Node Features (--prefer): This option is similar to the "--constraint" option, but it only indicates a preference. If it’s not available, it might be scheduled elsewhere.

Email Address

  • If you want to get notified via email when the job starts/fails/ends, enter the email address associated with the Colibri account.

  • You can leave the text field blank if you don’t want job notifications.

Working Directory

Working Directory

If left empty, the working directory points to your /home directory by default. To switch to a different directory, click the Select Path button.

Switch Directory

Select the desired directory you want to work with. After you make the selection, the Working Directory for the interactive job gets updated.

MATLAB version

  • Select one of the available versions 2022a,2021a,2020a, 2018a,2017b from the dropdown for the MATLAB software.

  • By Default, MATLAB version 2022a is selected.

MATLAB Command

You can run a user defined command in the MATLAB console at startup. The command syntax should be MATLAB console. To run a MATLAB file (.m),give the filename without .m.

For example, to call example.m, type:

example;exit

Submission Environment

You can select your desired submission environment from the drop down list. For example, to use an Apptainer image, select the Container option.

Submission Environment
  • Basic Modules

  • Advanced Modules

  • Basic Container

  • Advanced Container

This option allows you to launch the interactive application with the default software modules.

If you want to load additional modules or run any setup commands before launching the application, select the Advanced Modules option.

To load additional modules, use the module load command to load into your working environment.

module load <software-name>

For more information about module load command , refer to the page → Module Load in Colibri.

You can also source a bash script which will read and execute commands from the file specified as its argument. Create a bash script called setup-env.sh

#!/usr/bin/env bash

module load anaconda
conda activate <env-name>

To run the bash script file setup-env.sh using the source command, run the following command,

source setup-env.sh

Output

(<env-name>) [<username>@hpc-s13-n13 sample-scripts]$

From the above output, you can infer that, it first executed the module load anaconda command by loading the anaconda module to your environment and then activated the custom environment in it.

After you have the bash script ready with the commands, enter the source command followed by path to script file in the text entry box.

Syntax

source <path to bash script file>

Example

source "$HOME/project_a/setup-env.sh"

Instead of you using Environmental Modules, you can use an Apptainer/Singularity Container. You just need to select the appropriate SIF image.

Container

This option allows you to launch the interactive application with an Apptainer/Singularity Container.

Also, you can load additional modules or run any setup commands before launching the application. Check the Advanced Modules option for more details about this.

Launching the Interactive Session

  • Once all the form fields are set, you can click the Launch button. The interactive session will be launched and you will see the below output.

MATLAB Output
  • The above output shows that the interactive MATLAB session has been launched successfully. You will see the Launch MATLAB only if the resources you have requested becomes available. Else, you might need to wait for some more minutes for the resources allocation and then the Launch MATLAB button appears.

  • You can also set the Compression and Image Quality for MATLAB GUI by using the slider. After setting the values, click the Launch MATLAB button.

The interactive session won’t be launched if you try to submit your job to the partition that you don’t have access to. Also, the page gets reloaded and you need to select the value for the form fields again since the form gets reset.

Opening MATLAB Graphical User Interface

  • On clicking the Launch MATLAB button, the MATLAB GUI opens in a new tab through a VNC session.

ood-MATLABgui-output.png
  • The above output shows that the MATLAB GUI has been launched on the compute nodes in the Colibri through a VNC session.

  • Also, you have four different workspaces which is highlighted in red color in the top right corner of the window and you can use it.

  • Furthermore, you have Applications tab and you will see the following applications → Web Browser, File Manager, Terminal Emulator which you can open and use it.

Killing the Interactive Session

  • To kill the interactive session, you can simply press the close icon of the MATLAB GUI window. This will close the session and the cluster resources get freed.

  • Another way to kill the session is to go to the My Interactive sessions tab and select the Delete button of the current interactive session.

MATLAB delete session

Whenever you are done with the work, it’s always recommended to kill/delete the interactive session running on the compute nodes and free the resources.