-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-spits-parallel.sh
executable file
·66 lines (56 loc) · 1.71 KB
/
run-spits-parallel.sh
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
#!/bin/bash
############################################
# This is the OpenMP run for the RayTracer #
############################################
# You can either pass scenes individually as arguments or
# leave it blank to run all scenes in the 'scenes' folder
SCENES="${@:1}"
SCENES="${SCENES:-`ls scenes/*.scn`}"
# Ray tracing parameters
export SUPER_SAMPLES=1
export DEPTH_COMPLEXITY=5
export WIDTH=128
export HEIGHT=72
# Runtime directory
export PROGDIR="./runtime"
export PROGRAM="$PROGDIR/spitz-run.sh"
# Input binary
export MODULEDIR="./bin"
export MODULE="$MODULEDIR/RayTracer_spits.so"
# Output directory
export OUTDIR="./results/spits-parallel"
# Execution directory
export RUNDIR="./run"
# Ensure the output directory exists
mkdir -p $OUTDIR
# Ensure the execution directory exists
mkdir -p $RUNDIR
# Some PYPITS flags
#
# --overfill is the number of extra tasks sent to each Task Manager
# to make better use of the TCP connection, usually a
# value a few times larger than the number of workers
# works best, this also avoids starvation problems
#
export PPFLAGS="--overfill=2"
# Iterate through selected scenes and
# run the ray tracer using time
for i in `seq 1 10`;
do
for SCENE in $SCENES
do
FILENAME="$OUTDIR/`basename $SCENE`"
FILENAME="${FILENAME%.*}"
OUTFILE="$FILENAME.tga"
OUTLOG="$FILENAME.log"
OUTTIME="$FILENAME.time"
RUNSCNDIR="$RUNDIR/`basename $SCENE`"
echo $SCENE...
mkdir -p $RUNSCNDIR
pushd $RUNSCNDIR
rm -rf nodes* jm.* log
(time ../../$PROGRAM $PPFLAGS ../../$MODULE \
../../$SCENE $SUPER_SAMPLES $DEPTH_COMPLEXITY ../../$OUTFILE $WIDTH $HEIGHT) >> ../../$OUTLOG 2>> ../../$OUTTIME
popd
done
done