forked from sciaba/nanocc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_nano.sh
executable file
·59 lines (52 loc) · 973 Bytes
/
run_nano.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
#! /bin/bash
LIMIT=0
CHUNK=0
MAX=0
while getopts "n:a:w:c:m:" arg; do
case $arg in
n)
LIMIT=$OPTARG
;;
a)
AFNAME=$OPTARG
;;
w)
WORKERS=$OPTARG
;;
c)
CHUNK=$OPTARG
;;
m)
MAX=$OPTARG
;;
esac
done
WDIR="nanocc_run_${NFILES}_${AFNAME}_${LIMIT}_${CHUNK}_${MAX}_${WORKERS}"
if [ ${LIMIT} == 0 ] ; then
LIMIT=""
else
LIMIT="--limit ${LIMIT}"
fi
if [ ${CHUNK} == 0 ] ; then
CHUNK=""
else
CHUNK="--chunk ${CHUNK}"
fi
if [ ${MAX} == 0 ] ; then
MAX=""
else
MAX="--max ${MAX}"
fi
if [ -e $WDIR ] ; then
echo "Directory already exists. Exiting..."
exit 1
fi
mkdir $WDIR
cd $WDIR
ln -s ../runner.py .
ln -s ../metadata .
sudo sysctl vm.drop_caches=3
#ulimit -n 4096
prmon -i 5 -- python runner.py --id test --json metadata/v2x17_${AFNAME}.json --year 2017 ${LIMIT} ${CHUNK} ${MAX} --executor futures -j $WORKERS > nanocc.out 2> nanocc.err
RC=$?
echo "Return code: ${RC}" >> nanocc.out