#!/bin/csh
# @ job_type   = parallel
# @ environment = COPY_ALL;MP_EUILIB=us
# @ job_name   = swan
# @ output     = swanout
# @ error      = swanerr
# @ node       = 1,4
# @ network.MPI    = css0,shared,us
# @ tasks_per_node = 1
# @ node_usage = shared
# @ checkpoint = no
# @ wall_clock_limit = 5599

# @ class      = com_rg8
# @ ja_report  = yes
# @ queue

#set echo
source ~bettenc/disttest/mcel.csh

setenv machine bluesky
setenv case 1
setenv way 1way
rm -rf run-$machine-$way-$case
mkdir run-$machine-$way-$case
cd run-$machine-$way-$case
ln -s ../run/* .
ln -sf ../MCELServer.ior .

# Filter for SWAN
interpolation.ex -auto-destroy -auto-shutdown >& log-interpolation &
sleep 5
# Start up SWAN
setenv OMP_NUM_THREADS 4
#cp INPUT-mcel INPUT
time ../src/swan.ex >& log-run 
cd ../..


kill -9 `ps -ef | grep interpolation.ex | grep -v grep | awk ' {print $2} '`
sleep 2
kill -9 `ps -ef | grep interpolation.ex | grep -v grep | awk ' {print $2} '`

