Matlab
To run matlab on the cluster you must first load the matlab module with the "module load matlab" command. The create a file with all of the matlab commands that you would like to run. In this example, matlab_file contains matlab commands. Running the commands in matlab_file is as simple as running "matlab -nodisplay -nodesktop -r matlab_file". This can then be added to a Slurm job submission script:
$ cat matlab-job.txt
#!/bin/sh
#SBATCH --mail-type=ALL
#SBATCH --mail-user=uniqname@umich.edu
#SBATCH --license=MATLAB
#SBATCH --time=1-0
#SBATCH --job-name=test_matlab_job
#SBATCH --mem-per-cpu=4000
matlab -nodisplay -nodesktop -r matlab_file
Once the slurm job submission script and the matlab files exist, you can submit the job with:
$ module load matlab
$ sbatch matlab-job.txt