aboutsummaryrefslogtreecommitdiff
path: root/CarpetAttic/Cart3dTest/utils/mptest
diff options
context:
space:
mode:
Diffstat (limited to 'CarpetAttic/Cart3dTest/utils/mptest')
-rwxr-xr-xCarpetAttic/Cart3dTest/utils/mptest32
1 files changed, 32 insertions, 0 deletions
diff --git a/CarpetAttic/Cart3dTest/utils/mptest b/CarpetAttic/Cart3dTest/utils/mptest
new file mode 100755
index 000000000..d6a7f25d3
--- /dev/null
+++ b/CarpetAttic/Cart3dTest/utils/mptest
@@ -0,0 +1,32 @@
+#!/bin/bash
+# $Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/Cart3dTest/utils/mptest,v 1.5 2001/12/17 13:34:48 schnetter Exp $
+
+# Call this script from the Cactus directory. It compares a Carpet
+# ASCII testsuite outputs from runs with different numbers of
+# processors.
+
+for suite in $(ls TEST/carpet | grep -v log\$); do
+
+ echo
+ echo "Case: $suite"
+
+ for file in $(ls arrangements/Carpet/Cart3dTest/test/$suite | grep -v CVS | grep -v \.dl\$ | grep -v \.gnuplot\$); do
+
+ paste \
+ <( awk 'NF==9 { print $1,$6,$7,$8,$9; }' arrangements/Carpet/Cart3dTest/test/$suite/$file |
+ sort -n -k 1,4 |
+ uniq |
+ awk '{ print $5; }'
+ ) \
+ <( awk 'NF==9 { print $1,$6,$7,$8,$9; }' TEST/carpet/$suite/$file |
+ sort -n -k 1,4 |
+ uniq |
+ awk '{ print $5; }'
+ ) \
+ | awk 'function abs(x) { return x>0?x:-x; } { diff=abs(($1-$2)/(abs($1)+abs($2)+1e-10)); if (diff>1e-10) { ++cnt; print l+0,$1,$2,diff; ++l; } } END { if (cnt>0) print "File '$file'",cnt+0,"differing lines"; }'
+
+ done
+
+done
+
+echo "Done."