#!/bin/csh -f
##### 
##   Sung-Hoon Ko
##   4/28/98
#####


# Run synthetic test cases
 
set sources = (Metrop.java)
          
 
set nprocs  = 4

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 .:${mpiJavaHome}/lib/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 if ($MPI == sunhpc) then
  set machineFile = 
else
  echo Not supported yet. ; exit 1
endif
 
#(hostname; hostname; hostname; hostname; hostname ; hostname ; hostname ; hostname ) > $machineFile


set CWD = `pwd`

foreach source ($sources)
	set executable=${source:r}
	if ( -f ./$executable.jig ) then
	    rm -f ./$executable.jig
	endif	
	echo ...Running : {$CWD:t}/${source}

	$mpiJavaHome/src/scripts/prunjava ${nprocs[1]} $executable < data

end





