diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2019-03-07 16:41:03 +0100 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2019-03-07 16:41:03 +0100 |
commit | c4a8bd34b41b2be26426ea01aafc69d41260cce5 (patch) | |
tree | e682743f76f40dd506871ee18874836884a4fee5 | |
parent | 39ad0db84adecfeb8ec2e2c7628b9d55a3fe0894 (diff) |
Make postprocessing scripts more resilient
-rw-r--r-- | parasort.sh | 24 | ||||
-rw-r--r-- | postprocess.sh | 27 |
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 | ||
10 | cd output || exit 1 | 10 | if ! test -d work; then |
11 | mkdir -p ../sorted | 11 | printf "This directory contains no work/ directory.\n" |
12 | [ -d ../work ] && printf "(but .. does)\n" | ||
13 | exit 1 | ||
14 | fi | ||
12 | 15 | ||
13 | for a in *[05]; do echo "$a" >&2; ../merge_entries $a > ../sorted/$a; done & | 16 | export PATH=${PATH}:`pwd -P`/bin/ |
14 | for a in *[16]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & | 17 | |
15 | for a in *[27]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & | 18 | mkdir -p work/sorted |
16 | for a in *[38]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & | 19 | cd work/output || exit 1 |
17 | for a in *[49]; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & | 20 | |
18 | for a in brken *_; do echo " $a" >&2; ../merge_entries $a > ../sorted/$a; done & | 21 | for a in *[05]; do echo "$a" >&2; merge_entries $a > ../sorted/$a; done & |
22 | for a in *[16]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done & | ||
23 | for a in *[27]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done & | ||
24 | for a in *[38]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done & | ||
25 | for a in *[49]; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done & | ||
26 | for a in brken *_; do echo " $a" >&2; merge_entries $a > ../sorted/$a; done & | ||
19 | 27 | ||
20 | wait | 28 | wait |
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 | |||
2 | export LC_ALL=C | 2 | export LC_ALL=C |
3 | export LC_CTYPE=C | 3 | export LC_CTYPE=C |
4 | 4 | ||
5 | sudo sysctl kern.maxfilesperproc=65563 | 5 | |
6 | sudo sysctl kern.maxfiles=65563 | 6 | mfpp=`sysctl -n kern.maxfilesperproc` |
7 | mf=`sysctl -n kern.maxfiles` | ||
8 | |||
9 | |||
10 | if [ $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 | ||
15 | fi | ||
16 | |||
7 | ulimit -n 65563 | 17 | ulimit -n 65563 |
8 | 18 | ||
9 | for a in 199[56789]_Q? 20*_Q?; do ./sort_plz $a; done | 19 | export PATH=${PATH}:`pwd -P`/bin/ |
20 | |||
21 | if ! test -d work; then | ||
22 | printf "This directory contains no work/ directory.\n" | ||
23 | [ -d ../work ] && printf "(but .. does)\n" | ||
24 | exit 1 | ||
25 | fi | ||
10 | 26 | ||
11 | rm -rf sorted | 27 | cd work || exit 1 |
12 | mkdir sorted | 28 | |
29 | for a in 199[56789]_Q? 20*_Q?; do ./sort_plz $a; done | ||