#!/bin/csh

# ****************************************************************************
#  FILE     : bench

#  VERSION  : 4.0

#  PURPOSE  : script to perform a benchmark test

#  AUTHOR   : Ralf Huebner
#  DATE     : 26.03.93

#  NOTES    : not part of the distribution

#  USAGE    : bench <execdir>

#  MODIFICATIONS :
#
# ****************************************************************************

set SNNS_DIR = `pwd`

if (($1 == "") || ($1 == "-h") || (! -e $SNNS_DIR/tools/bin/$1)) then
  echo ''
  echo 'script to perform a benchmark test'
  echo ''
  echo '    usage: bench <execdir>'
  echo ''
  echo '    where execdir is in:'
  echo '          .../tools/bin/execdir'
  echo '                        ^^^^^^^'
  echo ''
  exit
endif

echo $SNNS_DIR/examples/nettalk.net > propagate.val
echo 1 >> propagate.val
echo 200 >> propagate.val


echo $SNNS_DIR/examples/nettalk.net > learn.val
echo 2 >> learn.val
echo $SNNS_DIR/examples/nettalk.pat >> learn.val
echo '0.5' >> learn.val
echo '0.0' >> learn.val
echo 2 >> learn.val


echo SNNS Benchmark on `uname -a` > benchvalues
$SNNS_DIR/tools/bin/$1/netperf < propagate.val | grep 'CPS'  >> benchvalues 
$SNNS_DIR/tools/bin/$1/netperf < learn.val | grep 'CUPS'  >> benchvalues
/bin/rm propagate.val learn.val
cat benchvalues
