This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
howto:matlab [2025/04/02 13:46] kevin |
howto:matlab [2025/05/22 16:56] (current) kevin [Example job script] |
||
|---|---|---|---|
| Line 31: | Line 31: | ||
| Note that you will only have access to the text mode user interface on the cluster. | Note that you will only have access to the text mode user interface on the cluster. | ||
| - | Additionally, | + | Additionally, |
| + | |||
| + | ====Example job script==== | ||
| + | |||
| + | > This job script assumes you want to use all 24 cores on one compute node. If your job needs fewer cores then change the '' | ||
| + | |||
| + | **Note:** set the '' | ||
| + | |||
| + | <code bash> | ||
| + | # | ||
| + | #PBS -N YOURJOBNAME | ||
| + | #PBS -l select=1: | ||
| + | #PBS -P YOURPROJECT | ||
| + | #PBS -q smp | ||
| + | #PBS -l walltime=0: | ||
| + | CWD=/ | ||
| + | cd $CWD | ||
| + | echo " | ||
| + | echo | ||
| + | module purge | ||
| + | module load chpc/ | ||
| + | echo " | ||
| + | module list |& cat | ||
| + | echo | ||
| + | echo " | ||
| + | which matlab | ||
| + | echo | ||
| + | nproc=`cat $PBS_NODEFILE | wc -l` | ||
| + | echo "nproc is $nproc" | ||
| + | echo | ||
| + | echo " | ||
| + | cat $PBS_NODEFILE | sort | uniq -c | ||
| + | echo | ||
| + | echo "This script is running on node" `hostname` | ||
| + | echo | ||
| + | echo " | ||
| + | # Run matlab on the m-file hello.m | ||
| + | matlab -batch " | ||
| + | echo | ||
| + | echo "... done." | ||
| + | </ | ||
| + | |||
| + | If the '' | ||
| + | |||
| + | matlab -nodesktop -nojvm < ./hello.m | ||
| + | |||
| + | |||
| + | See the [[https:// | ||