#!/bin/sh # assume that this script called by batch_replay.tcl with arguments # $1 is run number # $2 is the replay script name # $3 is the data file(s) on the MSS # $4 is main PARM file # nrun=$1 home=$PWD username=${USER}@jlab.org parmfile=$4 jname=$5_$1 echo $jname # # write replay script that is used by batch file created below # echo '#!/bin/tcsh -f' > bat_files/$2 echo 'setenv OSNAME `/bin/uname -s`' >> bat_files/$2 echo 'setenv ENGINE_CONFIG_FILE $WORKDIR/'$parmfile >> bat_files/$2 echo '../${OSNAME}/bin/engine_replay $*' >> bat_files/$2 chmod a+x bat_files/$2 #### Writes file batch_#### # echo '#!/bin/sh' > bat_files/batch_$nrun echo 'cd '$home >> bat_files/batch_$nrun echo 'mkdir $WORKDIR/PARM_FILES ' >> bat_files/batch_$nrun echo 'sed -e "s||$WORKDIR|" < '$parmfile' > $WORKDIR/'$parmfile >> bat_files/batch_$nrun echo 'ls $WORKDIR ' >> bat_files/batch_$nrun echo 'bat_files/'$2 ' grun='$nrun' 2>bat_files/error_'$nrun' >bat_files/output_'$nrun >> bat_files/batch_$nrun # chmod a+x bat_files/batch_$nrun # #### Writes the jsub command file # echo 'PROJECT: sane' > bat_files/jsub_file_$nrun echo 'JOBNAME: '$jname >> bat_files/jsub_file_$nrun echo 'MAIL : '$username >> bat_files/jsub_file_$nrun echo 'COMMAND: '$home'/bat_files/batch_'$nrun >> bat_files/jsub_file_$nrun echo 'TRACK: ANALYSIS' >> bat_files/jsub_file_$nrun echo 'INPUT_FILES: '$3 >> bat_files/jsub_file_$nrun echo 'SINGLE_JOB: true' >> bat_files/jsub_file_$nrun echo 'MEMORY: 1000 MB' >> bat_files/jsub_file_$nrun # #### Submits the job to farms # jsub bat_files/jsub_file_$nrun