-
Notifications
You must be signed in to change notification settings - Fork 19
/
run_ama3_noise-plot.sh
executable file
·84 lines (63 loc) · 2.75 KB
/
run_ama3_noise-plot.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash -x
# This script just writes the result of unnormalize( normalize(inputs) + noise ) into files.
# See ama3-noise-plot.py .
ulimit -v 16000000000
trap exit SIGINT
probdir=problem-instances-noise-plot
traindir=samples
suffix=
domainfilename=domain
proj=$(date +%Y%m%d%H%M)ama3-noise-plot
submit="jbsub -cores 8 -mem 16g -queue x86_1h -proj $proj"
#### foolproof check
# ensuring if the system is built correctly
(
make -C lisp
git submodule update --init --recursive
cd downward
./build.py -j $(cat /proc/cpuinfo | grep -c processor) release
)
# chmod -R +w $probdir # in the weird case this happens
#### job submission
task (){
out=$(echo ${1%%.pddl} | sed 's@/@_@g')
base=$2/ama3_${out}_$3
outfile=${base}.log
errfile=${base}.err
if [ -f ${base}_problem.json ]
then
echo skipping $base
return
fi
trap "cat $outfile; cat $errfile >&2" RETURN
./ama3-noise-plot.py \
$@ \
1> $outfile \
2> $errfile
}
export -f task
# 8 cores per job.
# singe task is timed out by 1 min, therefore 60 tasks / hour
# since the queue is 1h, we can assign 60 tasks per core
./run-jobscheduler-parallel 8 60 $submit -- task \
::: $(ls $traindir/puzzle_mnist*$suffix/logs/*/$domainfilename.pddl | head -n 1) \
::: $probdir/*/puzzle*-mnist*/[0-9]* \
./run-jobscheduler-parallel 8 60 $submit -- task \
::: $(ls $traindir/puzzle_mandrill*$suffix/logs/*/$domainfilename.pddl | head -n 1) \
::: $probdir/*/puzzle-mandrill*/[0-9]* \
./run-jobscheduler-parallel 8 60 $submit -- task \
::: $(ls $traindir/lightsout_digital*$suffix/logs/*/$domainfilename.pddl | head -n 1) \
::: $probdir/*/lightsout-digital*/[0-9]* \
./run-jobscheduler-parallel 8 60 $submit -- task \
::: $(ls $traindir/lightsout_twisted*$suffix/logs/*/$domainfilename.pddl | head -n 1) \
::: $probdir/*/lightsout-twisted*/[0-9]* \
# ./run-jobscheduler-parallel 8 60 $submit -- task \
# ::: $traindir/hanoi*$suffix/logs/*/$domainfilename.pddl \
# ::: $probdir/*/hanoi*/[0-9]* \
# ::: blind lama lmcut mands
./run-jobscheduler-parallel 8 60 $submit -- task \
::: $(ls $traindir/blocks*$suffix/logs/*/$domainfilename.pddl | head -n 1) \
::: $probdir/*/prob-*/[0-9]* \
./run-jobscheduler-parallel 8 60 $submit -- task \
::: $(ls $traindir/sokoban*$suffix/logs/*/$domainfilename.pddl | head -n 1) \
::: $probdir/*/sokoban*/[0-9]* \