summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2019-03-07 16:41:03 +0100
committerDirk Engling <erdgeist@erdgeist.org>2019-03-07 16:41:03 +0100
commitc4a8bd34b41b2be26426ea01aafc69d41260cce5 (patch)
treee682743f76f40dd506871ee18874836884a4fee5
parent39ad0db84adecfeb8ec2e2c7628b9d55a3fe0894 (diff)
Make postprocessing scripts more resilient
-rw-r--r--parasort.sh24
-rw-r--r--postprocess.sh27
2 files changed, 38 insertions, 13 deletions
diff --git a/parasort.sh b/parasort.sh
index 6b54449..6565d61 100644
--- a/parasort.sh
+++ b/parasort.sh
@@ -7,14 +7,22 @@ function ctrl_c() {
7 echo "Killed." 7 echo "Killed."
8} 8}
9 9
10cd output || exit 1 10if ! test -d work; then
11mkdir -p ../sorted 11 printf "This directory contains no work/ directory.\n"
12 [ -d ../work ] && printf "(but .. does)\n"
13 exit 1
14fi
12 15
13for a in *[05]; do echo "$a" >&2; ../merge_entries $a > ../sorted/$a; done & 16export PATH=${PATH}:`pwd -P`/bin/
14for a in *[16]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & 17
15for a in *[27]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & 18mkdir -p work/sorted
16for a in *[38]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & 19cd work/output || exit 1
17for a in *[49]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & 20
18for a in brken *_; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & 21for a in *[05]; do echo "$a" >&2; merge_entries $a > ../sorted/$a; done &
22for a in *[16]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done &
23for a in *[27]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done &
24for a in *[38]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done &
25for a in *[49]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done &
26for a in brken *_; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done &
19 27
20wait 28wait
diff --git a/postprocess.sh b/postprocess.sh
index 7c4b4e6..9316357 100644
--- a/postprocess.sh
+++ b/postprocess.sh
@@ -2,11 +2,28 @@ export LANG=C
2export LC_ALL=C 2export LC_ALL=C
3export LC_CTYPE=C 3export LC_CTYPE=C
4 4
5sudo sysctl kern.maxfilesperproc=65563 5
6sudo sysctl kern.maxfiles=65563 6mfpp=`sysctl -n kern.maxfilesperproc`
7mf=`sysctl -n kern.maxfiles`
8
9
10if [ $mfpp -lt 65563 -o $mf -lt 65563 ]; then
11 printf "System resources not tuned, %d and %d please run:\n" $mfpp $mf
12 printf "sudo sysctl kern.maxfilesperproc=65563\n"
13 printf "sudo sysctl kern.maxfiles=65563\n"
14 exit
15fi
16
7ulimit -n 65563 17ulimit -n 65563
8 18
9for a in 199[56789]_Q? 20*_Q?; do ./sort_plz $a; done 19export PATH=${PATH}:`pwd -P`/bin/
20
21if ! test -d work; then
22 printf "This directory contains no work/ directory.\n"
23 [ -d ../work ] && printf "(but .. does)\n"
24 exit 1
25fi
10 26
11rm -rf sorted 27cd work || exit 1
12mkdir sorted 28
29for a in 199[56789]_Q? 20*_Q?; do ./sort_plz $a; done