MATLAB (General)
Step 1: Prepare MATLAB Program Source Code
Section titled “Step 1: Prepare MATLAB Program Source Code”Example source code path -> /home/$USER/job_template/matlab/matlab_test.m
disp('Hello World');A = randn(3)ticexpm(A)sin(A).^2 + cos(A).^2tocdisp('Done, bye.');Step 2: Prepare job template script
Section titled “Step 2: Prepare job template script”Pre-configured template script path -> /home/$USER/job_template/slurm_job/matlab_test.sh
#!/bin/bash#SBATCH --job-name=matlab_test ## Job Name#SBATCH --partition=shared_cpu ## Partition for Running Job#SBATCH --nodes=1 ## Number of Compute Node#SBATCH --ntasks-per-node=1 # Number of Task per Compute Node#SBATCH --cpus-per-task=2 ## Number of CPU per task#SBATCH --time=60:00 ## Job Time Limit (i.e. 60 Minutes)#SBATCH --mem=10GB ## Total Memory for Job#SBATCH --output=./%x%j.out ## Output File Path#SBATCH --error=./%x%j.err ## Error Log Path
## Initiate Environment Modulesource /usr/share/modules/init/profile.sh
## Reset the Environment Module componentsmodule purge
## Load Modulemodule load matlab/25.2.0
## Run user command### Change directory to source code pathcd /home/$USER/job_template/matlab### Run matlab script in batch mode (remove ".m" from the script file in below command)matlab -nodisplay -batch matlab_test
## Clear Environment Module componentsmodule purgeStep 3: Create Template (Web Interface Feature)
Section titled “Step 3: Create Template (Web Interface Feature)”To submit HPC via web interface a job template is required, details please refer to: Create Template (Web Interface Feature)
For Job submission via CLI Terminal, please skip this step.
Step 4: Submit HPC Job
Section titled “Step 4: Submit HPC Job”Guides for submitting HPC job, please refer to: HPC Job Submission