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


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

set mpiJavaHome = @top_srcdir@

set MPI       = @MPI@

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

set MPI_RUN  = "${MPI_PATH}/bin/mpirun -np"
set CLASS_PATH = "-classpath .:../../classes:${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 machineFile = machines
else if ($MPI == sp2) then
  set machineFile = host.list
else
  echo Not supported yet. ; exit 1
endif
 
#(hostname; hostname; hostname; hostname; hostname ; hostname ; hostname ; hostname ) > $machineFile


set CWD = `pwd`

        echo ...Running : {$CWD:t}/${executableC}.c
        mpirun -np ${nprocs[1]} -machinefile machines $executableC
 
 
#foreach source ($sources)
#       set executable=${source:r}
        if ( -f ./$executableJAVA.jig ) then
            rm -f ./$executableJAVA.jig
        endif   
        echo " "
        echo "**********************************************"
        echo " "
        echo ...Running : {$CWD:t}/${executableJAVA}.java
        #echo ${MPI_RUN} ${nprocs[1]} $1 ${JAVA_RUN} $executable $0 $* 
        #${MPI_RUN} ${nprocs[1]} $1 ${JAVA_RUN} $executable $0 $* 
        $mpiJavaHome/script/prunjava ${nprocs[1]} $executableJAVA 
#end
 







