Index: /anuga_validation/performance_tests/README.txt
===================================================================
--- /anuga_validation/performance_tests/README.txt	(revision 7256)
+++ /anuga_validation/performance_tests/README.txt	(revision 7256)
@@ -0,0 +1,8 @@
+This directory contains some tools to measure performance of the ANUGA system.
+
+run_profile.py is a script that profiles ANUGA performing a small calculation.
+
+test.sh is a (shell) script that executes scripts run_profile.py and
+okushiri/run_okushiri_profile.py a certain number of times and in a python2.4
+and python2.5 environment, allowing comparisons of performance.  A log is written
+at run_profile.log.
Index: /anuga_validation/performance_tests/test.sh
===================================================================
--- /anuga_validation/performance_tests/test.sh	(revision 7256)
+++ /anuga_validation/performance_tests/test.sh	(revision 7256)
@@ -0,0 +1,136 @@
+#!/bin/bash
+
+######
+# A program to create 5 (or whatever) runs of run_profile.py.
+# Must be executed from 'anuga_validation/performance_tests'.
+######
+
+LOGFILE=$(pwd)/run_profile.log
+TMPFILE=$(pwd)/tmp_xyzzy
+#NUMRUNS=5
+NUMRUNS=1
+ANUGA_NUMERIC_BASE=/nas/gemd/georisk_models/inundation/sandpits/rwilson/anuga_core/source/anuga
+ANUGA_NUMPY_BASE=/nas/gemd/georisk_models/inundation/sandpits/rwilson/branches/numpy/anuga
+DELIM1="--------------------------------------------------------------------------------------"
+DELIM2="######################################################################################"
+PYTHON25=/usr/local/bin/python2.5
+PYTHON24=/usr/bin/python2.4
+
+# clear the logfile
+rm -f $LOGFILE
+echo "$DELIM2" >> $LOGFILE
+
+rm -f $TMPFILE
+
+# set environment to python2.4, Numeric trunk
+echo "set environment to python2.4, Numeric trunk"
+export PYTHONPATH=$(dirname $ANUGA_NUMERIC_BASE)
+if [ -d ~/bin ]; then
+    mv ~/bin ~/xbin
+    hash >/dev/null 2>&1
+fi
+
+echo "$DELIM2" >> $LOGFILE
+echo "Python 2.4, Numeric trunk" >> $LOGFILE
+echo "$DELIM2" >> $LOGFILE
+echo "" >> $LOGFILE
+
+# dump the environment to the log file
+echo "PYTHONPATH=$PYTHONPATH" >> $LOGFILE
+VERSION=$($PYTHON24 -V 2>&1)
+echo "python version is $VERSION" >> $LOGFILE
+echo "$DELIM1" >> $LOGFILE
+
+# compile the code.
+echo "compile the code"
+HERE=$(pwd)
+cd $ANUGA_NUMERIC_BASE
+$PYTHON24 compile_all.py >> $LOGFILE 2>&1
+echo "run test_all.py"
+$PYTHON24 test_all.py >> $LOGFILE 2>&1
+cd $HERE
+echo "$DELIM1" >> $LOGFILE
+
+# run the profile code $NUMRUNS times
+echo "run the profile code $NUMRUNS times"
+COUNT=0
+while [ $COUNT -lt $NUMRUNS ]; do
+    COUNT=$(( $COUNT + 1 ))
+    echo "run_profile.py - $COUNT of $NUMRUNS"
+    $PYTHON24 run_profile.py >> $LOGFILE 2>&1
+    echo "$DELIM1" >> $LOGFILE
+done
+
+# run the okushiri profile code
+echo "run the okushiri profile code $NUMRUNS times"
+HERE=$(pwd)
+cd okushiri
+COUNT=0
+while [ $COUNT -lt $NUMRUNS ]; do
+    COUNT=$(( $COUNT + 1 ))
+    echo "run_okushiri_profile.py - $COUNT of $NUMRUNS"
+    $PYTHON24 run_okushiri_profile.py > $TMPFILE 2>&1
+    tail -40 $TMPFILE >> $LOGFILE
+    echo "$DELIM1" >> $LOGFILE
+done
+cd $HERE
+
+echo "" >> $LOGFILE
+echo "$DELIM2" >> $LOGFILE
+echo "Python 2.5, numpy branch" >> $LOGFILE
+echo "$DELIM2" >> $LOGFILE
+echo "" >> $LOGFILE
+
+# set environment to python2.5, numpy trunk
+echo "set environment to python2.5, numpy trunk"
+export PYTHONPATH=$(dirname $ANUGA_NUMPY_BASE)
+if [ -d ~/xbin ]; then
+    mv ~/xbin ~/bin
+    hash >/dev/null 2>&1
+fi
+
+# dump the environment to the log file
+echo "PYTHONPATH=$PYTHONPATH" >> $LOGFILE
+VERSION=$($PYTHON25 -V 2>&1)
+echo "python version is $VERSION" >> $LOGFILE
+echo "$DELIM1" >> $LOGFILE
+
+# compile the code.
+echo "compile the code"
+HERE=$(pwd)
+cd $ANUGA_NUMPY_BASE
+$PYTHON25 compile_all.py >> $LOGFILE 2>&1
+echo "run test_all.py"
+$PYTHON25 test_all.py >> $LOGFILE 2>&1
+cd $HERE
+echo "$DELIM1" >> $LOGFILE
+
+# run the profile code $NUMRUNS times
+echo "run the profile code $NUMRUNS times"
+COUNT=0
+while [ $COUNT -lt $NUMRUNS ]; do
+    COUNT=$(( $COUNT + 1 ))
+    echo "run_profile.py - $COUNT of $NUMRUNS"
+    $PYTHON25 run_profile.py >> $LOGFILE 2>&1
+    echo "$DELIM1" >> $LOGFILE
+done
+
+# run the okushiri profile code
+echo "run the okusihiri profile code $NUMRUNS times"
+HERE=$(pwd)
+cd okushiri
+COUNT=0
+while [ $COUNT -lt $NUMRUNS ]; do
+    COUNT=$(( $COUNT + 1 ))
+    echo "run_okushiri_profile.py - $COUNT of $NUMRUNS"
+    $PYTHON25 run_okushiri_profile.py > $TMPFILE 2>&1
+    tail -40 $TMPFILE >> $LOGFILE
+    echo "$DELIM1" >> $LOGFILE
+done
+cd $HERE
+
+echo "" >> $LOGFILE
+echo "$DELIM2" >> $LOGFILE
+echo "" >> $LOGFILE
+
+
