-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmatlab.pbs
40 lines (29 loc) · 1.15 KB
/
matlab.pbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
## University of New Mexico Center for Advanced Research Computing
## Ryan Johnson, March 16, 2016
## PBS submission script to run a batch MATLAB script on CARC machines
# these are the pbs directives. They are just options to qsub, written here
# for convenience. They are overwritten by any given to qsub on command line
#PBS -l nodes=1:ppn=8
#PBS -l walltime=01:00:00
#PBS -N matlab_test
#PBS -S /bin/bash
# matlab script must end in .m but do not include the .m here:
# ie for hello.m only hello is written (-r option to matlab is used)
INPUT=hello
OUTPUT=out.log
##########################################
# shouldn't need to edit below here often
##########################################
# must load the module
module load matlab
#change to directory where you typed qsub
cd $PBS_O_WORKDIR
#These type of lines will be in the STDOUT file (ie .o)
echo starting Matlab jobs at $(date)
# Call matlab on your code and redirect output to OUTPUT
matlab -r -nojvm -nodisplay $INPUT > $OUTPUT
# also in .o
echo finished Matlab jobs at $(date)
# better timing info can be found my prepending /usr/bin/time to matlab command
# see man time for more info