#!/bin/csh -f
# newqch_driver
# New version for parallel SP2 optimization with loadleveler.
#
# 3param.in.(fn_eval_num) and results.out.(fn_eval_num)
# are passed on command line as $argv[1] and $argv[2]
#
# -----------------   ANALYSIS   -------------------
# Kill any existing qcheck processes with 'killorphan' script
/home/mseldre/bin/qtran/killorphan qcheck.ll
#
# Launch qcheck (loadleveler version) in background 
# correct qtran.exe job is identified by 3param.in.# ($argv[1])
/home/mseldre/bin/qtran/qcheck.ll 90 $argv[1] &
#
# Doublecheck to make sure license is still available.
# Nonavailability of license will cause qtran to terminate, 
# results.out.# to not be written, and DAKOTA to hang.
/home/mseldre/bin/qtran/ch2.360
#
# Run qtran.exe
#/usr/local/patran3/bin/qsubmit won't work because of links
qtran.exe
# ----------------- OUTPUT FILTER ------------------
/home/mseldre/bin/qtran/qtran_ofilter timeplt.dat ../$argv[2]
#
# Do cleanup here
set num = `echo $argv[1] | cut -c 11-15`
# Keep jcf.llout; it contains timing info.
cp jcf.llout ../jcf.llout.$num
#
cd ..
rm -r workdir.$num
