#!/bin/csh -f
##### 
##   Sung-Hoon Ko
##   7/2/98
#####


# Run synthetic test cases
 
set executableJAVA = PingPong
set executableC = mpi_single
           
 
set nprocs  = 2

set mpiJavaHome = @top_srcdir@
set mpiJavaClasses = @top_srcdir@/lib/classes

set MPI       = @MPI@

set MPI_PATH  = @MPIPATH@
set JAVA_PATH = @JAVA@

set MPI_RUN  = "${MPI_PATH}/bin/mpirun -np"
set CLASS_PATH = "-classpath .:${mpiJavaClasses}:${JAVA_PATH}/lib/classes.zip:${JAVA_PATH}/classes"
set JAVA_C = "${JAVA_PATH}/bin/javac ${CLASS_PATH}"
set JAVA_RUN = "${JAVA_PATH}/bin/java ${CLASS_PATH}"


if ($MPI == mpich) then
  set MPIRUN = mpirun 
  if ( -f ./machines ) then
    set machineFile = "-machinefile ./machines"
  else
    set machineFile =
  endif   
else if ($MPI == sp2) then
  set machineFile = host.list
else if ($MPI == sunhpc) then
  set MPIRUN = tmrun 
  set machineFile = 
else
  echo Not supported yet. ; exit 1
endif
 
#(hostname; hostname; hostname; hostname; hostname ; hostname ; hostname ; hostname ) > $machineFile


set CWD = `pwd`

        ## Benchmarking  MPI-C
        echo ...Running : {$CWD:t}/${executableC}.c
        $MPIRUN -np ${nprocs[1]}  $machineFile $executableC
 

        ## Benchmarking  MPI-JAVA
        if ( -f ./$executableJAVA.jig ) then
            rm -f ./$executableJAVA.jig
        endif   
        echo " "
        echo "**********************************************"
        echo " "
        echo ...Running : {$CWD:t}/${executableJAVA}.java
        $mpiJavaHome/src/scripts/prunjava ${nprocs[1]} $executableJAVA 

 







