MATLAB: Difference between revisions

From NU HPC Wiki
Jump to navigation Jump to search
(Created page with "MATLAB is a programming environment for algorithm development, data analysis, visualization, and numerical computation. Using MATLAB, you can solve technical computing problems faster than traditional programming languages, such as C, C++, and Fortran. You can use MATLAB in various applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology. A common mistake for ne...")
 
No edit summary
Line 3: Line 3:
You can use MATLAB in various applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology.
You can use MATLAB in various applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology.


A common mistake for new users of HPC clusters is to run heavy workloads directly on a login node (e.g., discovery.usc.eduor endeavour.usc.edu). Unless you are only running a small test, please make sure to run your program as a job interactively on a compute node. Processes left running on login nodes may be terminated without warning. For more information on jobs, see our Running Jobs user guide.
==== Running MATLAB in interactive mode ====
A common mistake for new users of HPC clusters is to run heavy workloads directly on a login node. Please make sure to run your program as a job interactively on a compute node. Processes left running on login nodes may be terminated without warning. For more information on jobs, see our Running Jobs user guide.


To run MATLAB interactively on a compute node, follow these two steps:
To run MATLAB interactively on a compute node, follow these two steps:


Reserve job resources on a node using salloc
# Reserve job resources on a node using salloc
Once resources are allocated, load the required modules and enter matlab -nodisplay
# Once resources are allocated, load the required modules and enter matlab -nodisplay
<syntaxhighlight lang="css">
salloc --time=1:00:00 --ntasks=1 --cpus-per-task=8 --mem=16G --account=<nu/hpcnc>
salloc: Pending job allocation 24316
salloc: job 24316 queued and waiting for resources
salloc: job 24316 has been allocated resources
salloc: Granted job allocation 24316
salloc: Waiting for resource configuration
salloc: Nodes cn08 are ready for job
</syntaxhighlight>Make sure to change the resource requests (the <code>--time=1:00:00 --ntasks=1 --cpus-per-task=8 --mem=16G --account=<nu/hpcnc></code>part after your <code>salloc</code>command) as needed to reflect the number of cores and memory required.

Revision as of 04:36, 3 July 2024

MATLAB is a programming environment for algorithm development, data analysis, visualization, and numerical computation. Using MATLAB, you can solve technical computing problems faster than traditional programming languages, such as C, C++, and Fortran.

You can use MATLAB in various applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology.

Running MATLAB in interactive mode

A common mistake for new users of HPC clusters is to run heavy workloads directly on a login node. Please make sure to run your program as a job interactively on a compute node. Processes left running on login nodes may be terminated without warning. For more information on jobs, see our Running Jobs user guide.

To run MATLAB interactively on a compute node, follow these two steps:

  1. Reserve job resources on a node using salloc
  2. Once resources are allocated, load the required modules and enter matlab -nodisplay
salloc --time=1:00:00 --ntasks=1 --cpus-per-task=8 --mem=16G --account=<nu/hpcnc>
salloc: Pending job allocation 24316
salloc: job 24316 queued and waiting for resources
salloc: job 24316 has been allocated resources
salloc: Granted job allocation 24316
salloc: Waiting for resource configuration
salloc: Nodes cn08 are ready for job

Make sure to change the resource requests (the --time=1:00:00 --ntasks=1 --cpus-per-task=8 --mem=16G --account=<nu/hpcnc>part after your salloccommand) as needed to reflect the number of cores and memory required.