#!/bin/tcsh #SBATCH --partition=priority #SBATCH --account=clas12 #SBATCH --mem-per-cpu=2024M #SBATCH --time=1:00:00 #SBATCH --nodes=1 #SBATCH --job-name=gpgRunSlurm #SBATCH --output=/farm_out/%u/%x-%j-%N.out #SBATCH --error=/farm_out/%u/%x-%j-%N.err # tcsh script to manage the batch job submitted by submit_lbNDEdata.pl (perl script) # with sbatch command # # manages and monitors the ifarm job including running the codes and copying the # results over to the work disk. Also collects some information about the job # like space used, cpu time. #printenv; date; # # go to the local directory on the remote node instead of where # the job was launched. cd /scratch/slurm/$SLURM_JOBID # set up environment for COATJAVA. echo " " source /group/clas12/packages/setup.csh module load clas12/pro # read inputs to script echo " " setenv CASE myCASE setenv RUNNO myRUNNO setenv nevents myNEVENTS setenv caseString `printf %04d $CASE` # time marker. date # start a timer. setenv start `date +%s` # print out the inputs to check things. echo 'Environment variables:' # weird bug appears with current production version of COATJAVA, but not older one. setenv COATJAVA /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/coatjava/coatjava echo 'COATJAVA = '$COATJAVA echo 'CASE = '$CASE echo 'RUN NUMBER = '$RUNNO echo 'nevents = '$nevents echo 'caseString = '$caseString echo 'current pwd is : ' `pwd` ' list below' # # define directories mkdir rootfile/ echo 'List '`pwd`' (should be empty.)' #mkdir /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/run/gpgRunSlurm`date +%F`-`echo $CASE` #chdir /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/run/gpgRunSlurm`date +%F`-`echo $CASE` #echo 'List '`pwd`' (should be empty.)' ls -lthr # # RUN LB's ndeNtuple.groovy script here. Copy necessary stuff first. echo echo 'Copy ndeNtuple.groovy and related scripts to current area and set up j2root.' echo ' ' echo 'cp /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/*.groovy .' echo 'source /work/clas12/kenjo/j2root/j2root.csh' cp /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/*.groovy . cp /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/groovyScripts/*.groovy . # set up Andey Kim's j2root package. source /work/clas12/kenjo/j2root/j2root.csh echo ' ' # check that you have the right stuff. echo 'List '`pwd`' (should have a bunch of groovy scripts.)' ls -lthr echo ' ' # let're rip. echo 'Start ndeNtuple.groovy' echo '$COATJAVA/bin/run-groovy ndeNtuple.groovy data inb10p6 inbCor firstDataRun.root' $nevents $RUNNO echo ' ' date # problem here: Can't connect to X11 window server using 'localhost:114.0' as the value of the DISPLAY variable. #setenv DISPLAY ":0.0" #setenv DISPLAY localhost:0.0 echo $DISPLAY #unsetenv DISPLAY # echo $DISPLAY # xhost +local:all #$COATJAVA/bin/run-groovy nde.groovy data inb10p6 inbCor firstDataRun.root $nevents $RUNNO /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/coatjava/coatjava/bin/run-groovy ndeNtuple.groovy data inb10p6 inbCor firstDataRun.root $nevents $RUNNO echo ' ' echo 'ndeNtuple.groovy is finished.' date echo ' ' # check the right output files are here. echo 'List '`pwd`' after ndeNtuple.groovy.' ls -lthr echo echo 'List '`pwd`'/rootfile.' ls -lthr rootfile/* echo # cp root files back to my area. echo 'copy results back to my rootfile and list results.' #cp rootfile/firstDataRun.root /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/results/firstDataRun$CASE.root cp clas12*.root /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/rootfile/ ls -lthr /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/results/* ls -lthr /w/hallb-scshelf2102/clas12/gilfoyle/lbNDEcode/lbCode-21-dec-02/rootfile/* echo # check space used. setenv MYSPACE `du -hs` setenv stop `date +%s` @ duration = ( $stop - $start ) @ minutes = ( $duration / 60 ) @ seconds = ( $duration % 60 ) echo echo "Timer: $minutes minutes and $seconds seconds for case $CASE, run $RUNNO. Space used = $MYSPACE Nevents limit = $nevents per file" echo echo 'End of analysis run.'