aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-04-27 14:33:09 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-04-27 14:33:09 +0200
commitf90b2aff40e24901cf2146f46b052bd42cf0a160 (patch)
treec067fa505f8a5575424ae180848c9378c4966504
parent47150bfc22dee2f5944e032eeaccdbe902cb42e5 (diff)
The realisation that fullcompMT respects $num_cores
-rwxr-xr-xfullcomp.sh36
1 files changed, 1 insertions, 35 deletions
diff --git a/fullcomp.sh b/fullcomp.sh
index bb4f59a..88ad0a3 100755
--- a/fullcomp.sh
+++ b/fullcomp.sh
@@ -1,36 +1,2 @@
#!/usr/bin/env bash
-BINARIES="./gluon ./neutrino ./randino ./charm"
-
-if [[ ! -e competitions ]]; then
- mkdir competitions || exit 1
-fi
-
-find competitions -type f -delete
-
-for p1 in $BINARIES; do
- for p2 in $BINARIES; do
- if [[ $p1 == $p2 ]]; then
- continue
- fi
- printf "%s\n%s\n" $p1 $p2 >competition.txt
- ./competition.py $@
- status=$?
- if [[ $status != 0 ]]; then
- echo "$p1 - $p2 : ERROR $status (0-0)"
- continue
- fi
- p1pretty=$(echo "$p1" | sed 's/[^a-zA-Z0-9 ]//g')
- p2pretty=$(echo "$p2" | sed 's/[^a-zA-Z0-9 ]//g')
- complogfile="competitions/game_${p1pretty}_vs_${p2pretty}.txt"
- lastline=$(tail -n1 $complogfile)
- if [[ "$lastline" == "P1 won" ]]; then
- echo "$p1 - $p2 : WIN - LOSS (3-1)"
- elif [[ "$lastline" == "P2 won" ]]; then
- echo "$p1 - $p2 : LOSS - WIN (1-3)"
- elif [[ "$lastline" == "Tie" ]]; then
- echo "$p1 - $p1 : TIE (1-1)"
- fi
- done
-done
-
-./fullcompstats.py
+env num_cores=1 ./fullcompMT.sh $@