source: trunk/anuga_core/source/anuga/fit_interpolate/table.awk @ 7876

Last change on this file since 7876 was 4656, checked in by duncan, 17 years ago

Ponit in polygon C code. Currently not connected to ANUGA.

File size: 1.1 KB
Line 
1# Run results from statrun.tst through this script, e.g.
2#    table.awk *.stats
3# to generate tables of timings
4
5for dog in $*
6do
7cat $dog | awk '
8BEGIN {
9    count = -1
10}
11{
12    if ( $1 == "Polygons" ) {
13        count++
14        if ( !count ) {
15            title = $0
16            title_on = 1
17        }
18        if ( $4 == "to" ) {
19            nv[count] = $3"-"$5
20        } else {
21            nv[count] = $3
22        }
23    } else if ( title_on ) {
24        if ( !count ) {
25            if ( $1 == "Testing" ) {
26                title_on = 0
27            } else {
28                title = title "\n" $0
29            }
30        }
31    } else if ( $3 == "time:" ) {
32        t[$1,count] = $4
33        found[$1] = 1
34    } else if ( $2 == "%" ) {
35        pc[count] = $1
36    }
37}
38END {
39    print title
40
41    printf( "\n\t\t   Number of vertices\n\t" )
42    for ( i = 0 ; i <= count ; i++ ) {
43        printf( "\t    %s",nv[i] )
44    }
45    printf( "\n\n" ) ;
46
47    for ( name in found ) {
48        printf( "%s\t", name )
49        if ( length( name ) < 8 ) {
50            printf( "\t" )
51        }
52        for ( i = 0 ; i <= count ; i++ ) {
53            printf( "%8.1f",t[name,i] )
54        }
55        printf( "\n" ) ;
56    }
57
58    printf( "\ninside %\t" )
59    for ( i = 0 ; i <= count ; i++ ) {
60        printf( "%8.1f",pc[i] )
61    }
62    printf( "\n\n\n" ) ;
63}'
64done
Note: See TracBrowser for help on using the repository browser.