Imported Debian patch 0.12.7-3
[bowtie.git] / scripts / random_bowtie_tests_p.sh
1 #!/bin/sh
2
3 # Spawn a bunch of parallel processes running random_bowtie_tests.sh
4 # and dumping results into text files.  Run from the bowtie dir.
5
6 NUM=$1
7 if [ -z "$NUM" ] ; then
8         NUM=4
9 fi
10
11 make bowtie bowtie-debug bowtie-build-debug bowtie-inspect-debug
12 if [ "$?" != "0" ] ; then
13         echo "Error during build"
14         exit 1
15 fi
16
17 echo > .randpids
18 while [ $NUM -gt 0 ] ; do
19         echo "Spawning: sh scripts/random_bowtie_tests.sh $NUM > .randstdout.$NUM 2> .randstderr.$NUM &"
20         sh scripts/random_bowtie_tests.sh $NUM > .randstdout.$NUM 2> .randstderr.$NUM &
21         echo $! >> .randpids
22         NUM=`expr $NUM - 1`
23 done
24
25 for p in `cat .randpids` ; do
26         echo "Waiting for pid $p"
27         wait $p
28 done