-
Notifications
You must be signed in to change notification settings - Fork 41
/
job.animation.sh.tmpl
70 lines (56 loc) · 1.93 KB
/
job.animation.sh.tmpl
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
#job
#PBS -N runAnimation-<TMPL_VAR NAME=iJob>
#user
#PBS -P <TMPL_VAR NAME=linuxUser>:<TMPL_VAR NAME=linuxUser>
#notification
#PBS -M <TMPL_VAR NAME=emailAddress>
#resources
#PBS -l walltime=1:00:00
#PBS -l nodes=1:ppn=1
#PBS -l mem=1300mb
#PBS -l vmem=5gb
#log
#PBS -o <TMPL_VAR NAME=outDir>/<TMPL_VAR NAME=conditionSetTimeStamp>/<TMPL_VAR NAME=movieSubFolder>/out.animation-<TMPL_VAR NAME=iJob>.log
#PBS -e <TMPL_VAR NAME=outDir>/<TMPL_VAR NAME=conditionSetTimeStamp>/<TMPL_VAR NAME=movieSubFolder>/err.animation-<TMPL_VAR NAME=iJob>.log
#PBS -W umask=002
#set environment
export MATLAB_PREFDIR=/tmp/emptydir
export MCR_CACHE_ROOT=/tmp/mcr_cache_$PBS_JOBID
mkdir -p $MCR_CACHE_ROOT
#setup
cd <TMPL_VAR NAME=baseDir>
#job
<TMPL_IF NAME=renderFrames>
#PBS -m a
#animation
./run.sh runAnimation \
<TMPL_VAR NAME=pathToRunTime> \
<TMPL_VAR NAME=outDir>/<TMPL_VAR NAME=conditionSetTimeStamp>/matlab.animation.log \
<TMPL_VAR NAME=conditionSetTimeStamp> <TMPL_VAR NAME=movieSubFolder> 1 <TMPL_VAR NAME=iJob> <TMPL_VAR NAME=nFrameRenderJobs>
<TMPL_ELSE>
#PBS -m abe
#PBS -W depend=afterany<TMPL_VAR NAME=afterany>
#animation
./run.sh runAnimation \
<TMPL_VAR NAME=pathToRunTime> \
<TMPL_VAR NAME=outDir>/<TMPL_VAR NAME=conditionSetTimeStamp>/matlab.animation.log \
<TMPL_VAR NAME=conditionSetTimeStamp> <TMPL_VAR NAME=movieSubFolder> 0
#set permissions
sudo chown -R <TMPL_VAR NAME=linuxUser>:<TMPL_VAR NAME=linuxUser> <TMPL_VAR NAME=outDir>/<TMPL_VAR NAME=conditionSetTimeStamp>/<TMPL_VAR NAME=movieSubFolder>
chmod -R 775 <TMPL_VAR NAME=outDir>/<TMPL_VAR NAME=conditionSetTimeStamp>/<TMPL_VAR NAME=movieSubFolder>
</TMPL_IF>
#cleanup
rm -rf $MCR_CACHE_ROOT/*
#resources
echo ""
echo "=============="
echo "=== status ==="
echo "=============="
qstat -f $PBS_JOBID
#status
if [[ -f "<TMPL_VAR NAME=outDir>/<TMPL_VAR NAME=conditionSetTimeStamp>/<TMPL_VAR NAME=movieSubFolder>/err.animation-<TMPL_VAR NAME=iJob>.log" ]]
then
exit 1
fi
exit 0