missed one!
[debian/atlc] / tests / benchmark.test
1 #! /bin/sh
2 # This test checks that a multi-threaded vesion of 
3 # atlc runs faster than a single threaded one. 
4 # and reports by how much so. 
5
6 if [ "x$mpirun_found" = "xyes" ] ; then
7   return 77
8 else
9   cp $top_srcdir/examples/25ohm-401h.bmp $top_builddir/tmp
10   ret=`$top_builddir/tests/benchmark $top_builddir/src/atlc $top_builddir/tmp/25ohm-401h.bmp `
11   rm -f $top_builddir/tmp/25ohm-401h.bmp
12
13 #  cp $top_srcdir/examples/twin-wire3.bmp $top_builddir/tmp
14 #  ret=`$top_builddir/tests/benchmark $top_builddir/src/atlc $top_builddir/tmp/twin-wire3.bmp `
15 #  rm -f $top_builddir/tmp/twin-wire3.bmp
16
17   exitcode=`echo $ret | awk '{print $1}'`
18   t1=`echo $ret | awk '{print $2}'`
19   t2=`echo $ret | awk '{print $3}'`
20   speedup=`echo $ret | awk '{print $4}'`
21   N_cpus=`echo $ret | awk '{print $5}'`
22   mhz=`echo $ret | awk '{print $6}'`
23   efficiency=`echo $ret | awk '{print $7}'`
24   cpu_type=`echo $ret | awk '{print $8}'`
25   fpu_type=`echo $ret | awk '{print $9}'`
26   supported_cpus=`echo $ret | awk '{print $10}'`
27   ram=`echo $ret | awk '{print $11}'`
28   sysname=`echo $ret | awk '{print $12}'`
29   nodename=`echo $ret | awk '{print $13}'`
30   release=`echo $ret | awk '{print $14}'`
31   version=`echo $ret | awk '{print $15}'`
32   machine=`echo $ret | awk '{print $16}'`
33   hw_provider=`echo $ret | awk '{print $17}'`
34   hw_platform=`echo $ret | awk '{print $18}'`
35   L1data=`echo $ret | awk '{print $19}'`
36   L1instruction=`echo $ret | awk '{print $20}'`
37   L2=`echo $ret | awk '{print $21}'`
38   echo " "
39   echo "                  BENCHMARK DATA"
40   echo "                  BENCHMARK DATA" >> tests.log
41   echo "                  <STRONG><div align="center">BENCHMARK DATA</div></STRONG> <BR>" > tests.html
42
43   echo "Hardware data working reasonably well on AIX, HP-UX, Solaris, Tru64,"
44   echo "Hardware data working reasonably well on AIX, HP-UX, Solaris, Tru64," >> tests.log
45   echo "Hardware data working reasonably well on AIX, HP-UX, Solaris, Tru64, <BR>" >> tests.html
46
47   echo "IRIX and UNICOS, but not too well on Linux and poorly on *BSD" 
48   echo "IRIX and UNICOS, but not too well on Linux and poorly on *BSD" >> tests.log
49   echo "IRIX and UNICOS, but not too well on Linux and poorly on *BSD <BR>" >> tests.html
50
51   echo "Any help to write code to gather data on other OS's would be appreciated" 
52   echo "Any help to write code to gather data on other OS's would be appreciated" >> tests.log
53   echo "Any help to write code to gather data on other OS's would be appreciated<BR><BR>" >> tests.html
54
55   echo " "
56   echo " " >> tests.log
57   echo "<BR>" >> tests.html
58
59   echo "Hardware provider is $hw_provider. Hardware platform is $hw_platform."
60   echo "Hardware provider is $hw_provider. Hardware platform is $hw_platform." >> tests.log
61   echo "Hardware provider is $hw_provider. Hardware platform is $hw_platform.<BR>" >> tests.html
62
63   echo "Machine: $machine. Sysname: $sysname. Release: $release. Nodename: $nodename."
64   echo "Machine: $machine. Sysname: $sysname. Release: $release. Nodename: $nodename." >> tests.log
65   echo "Machine: $machine. Sysname: $sysname. Release: $release. Nodename: $nodename.<BR>" >> tests.html
66
67   echo "Number of CPUs supported by system is $supported_cpus. Number of CPUs online is  $N_cpus."
68   echo "Number of CPUs supported by system is $supported_cpus. Number of CPUs online is  $N_cpus." >> tests.log
69   echo "Number of CPUs supported by system is $supported_cpus. Number of CPUs online is  $N_cpus.<BR>" >> tests.html
70
71   echo "CPU_type is $cpu_type. FPU_type is $fpu_type. Speed of CPU(s) is $mhz MHz."
72   echo "CPU_type is $cpu_type. FPU_type is $fpu_type. Speed of CPU(s) is $mhz MHz." >> tests.log
73   echo "CPU_type is $cpu_type. FPU_type is $fpu_type. Speed of CPU(s) is $mhz MHz.<BR>" >> tests.html
74
75   echo "L1 data cache is $L1data kB; L1 instruction cache is $L1instruction kB; L2 cache is $L2 kB"
76   echo "L1 data cache is $L1data kB; L1 instruction cache is $L1instruction kB; L2 cache is $L2 kB" >> tests.log
77   echo "L1 data cache is $L1data kB; L1 instruction cache is $L1instruction kB; L2 cache is $L2 kB<BR>" >> tests.html
78
79   if [ "x$built_with_posix_threads" = "xyes" ] ; then
80     echo "Run times: T_sequential is $t1 s. T_parallel is $t2 s."
81     echo "Run times: T_sequential is $t1 s. T_parallel is $t2 s." >> tests.log
82     echo "Run times: T_sequential is $t1 s. T_parallel is $t2 s.<BR>" >> tests.html
83
84     echo "Speedup=T_sequential/T_parallel is $speedup. Efficiency=Speedup/N_cpus is $efficiency"
85     echo "Speedup=T_sequential/T_parallel is $speedup. Efficiency=Speedup/N_cpus is $efficiency" >> tests.log
86     echo "Speedup=T_sequential/T_parallel is $speedup. Efficiency=Speedup/N_cpus is $efficiency<BR>" >> tests.html
87   else
88     echo "Run times: T_sequential is $t1 s. Not configured for parallel operation."
89     echo "Run times: T_sequential is $t1 s. Not configured for parallel operation." >> tests.log
90     echo "Run times: T_sequential is $t1 s. Not configured for parallel operation.<BR>" >> tests.html
91   fi 
92 fi