aboutsummaryrefslogtreecommitdiff
path: root/CarpetAttic/Cart3dTest/utils/mptest
blob: 054992be955d6f8fd3fd3d5a6af4f99b269625d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# $Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/Cart3dTest/utils/mptest,v 1.4 2001/04/23 08:10:17 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 "Suite: $suite"
    
    for file in $(ls arrangements/Carpet/Cart3dTest/test/$suite | grep -v CVS | grep -v \.dl); 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 '{ diff=(($1-$2)/($1+$2+1e-6))**2; 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."