#!/usr/bin/env bash #------------------------------------------------------------------------------ # example: cdfopr/scripts/submit_strip zewk0d 1 10 [ version [ prefix [ mode ]]] # example: # cdfopr/scripts/submit_strip eewk0d 1050 1051 5.3.3 . test # # normally the jobs are submitted into short queue # for user=cdfopr on CAF_CURRENT="caf" use queue=cdfopr #------------------------------------------------------------------------------ name=strip dataset=$1 job1=$2 job2=$3 version=5.3.3 mode=caf prefix= if [ .$4 != . ] ; then version=$4 ; fi if [[ .$5 != "." && .$5 != .. ]] ; then prefix=echo ; fi if [ .$6 != . ] ; then mode=$6 ; fi tarball=stnmaker_${version}.tgz user=`klist | grep Default | awk '{print $3}' | awk -F @ '{print $1}'` if [ .$CAF_CURRENT == ".cafcondor" ] ; then queue=short ; else if [ $user == "cdfopr" ] ; then queue=cdfopr ; else queue=short fi fi book=cdfpewk output_node=cdfopr@fcdfdata034.fnal.gov output_dir=/cdf/scratch/cdfopr/datasets/$book/$dataset case $dataset in "bewk0d" ) input_dataset="bhel0d" tcl_file=cdfopr/tcl/stnmaker/filter_path_hpte.tcl ;; "bewk2d" ) input_dataset="bhmu0d" tcl_file=cdfopr/tcl/stnmaker/filter_path_hptm.tcl ;; "nocmup" ) input_dataset="bhmu0d" tcl_file=cdfopr/tcl/stnmaker/filter_path_no_cmup18.tcl ;; "eewk0d" ) input_dataset="emet0d" tcl_file=cdfopr/tcl/stnmaker/filter_path_met25_ps100.tcl ;; "wewk0d" ) input_dataset=bewk0d tcl_file=cdfopr/tcl/stnmaker/filter_path_wenu.tcl ;; "wewk2d" ) input_dataset=bewk2d tcl_file=cdfopr/tcl/stnmaker/filter_path_wmunu.tcl ;; "wewk3d" ) input_dataset=bhel0d_v1 tcl_file=cdfopr/tcl/stnmaker/filter_path_wenu.tcl ;; "wewk4d" ) input_dataset=bhmu0d_v1 tcl_file=cdfopr/tcl/stnmaker/filter_path_wmunu.tcl ;; "zewk0d" ) input_dataset=bewk0d tcl_file=cdfopr/tcl/stnmaker/filter_path_zee.tcl ;; "zewk4d" ) input_dataset=bhel0d_v1 tcl_file=cdfopr/tcl/stnmaker/filter_path_zee.tcl ;; "zewk2d" ) input_dataset=bewk2d tcl_file=cdfopr/tcl/stnmaker/filter_path_zmumu.tcl ;; "zewk5d" ) input_dataset=bhmu0d_v1 tcl_file=cdfopr/tcl/stnmaker/filter_path_zmumu.tcl ;; * ) esac parameters="-v -j stnmaker.strip -e bin/$BFARCH/stnmaker.exe -i $tcl_file " parameters=${parameters}" -D $input_dataset -o ${output_node}:$output_dir" if [ $mode == "test" ] ; then $prefix ./cdfopr/scripts/run.sh -J $job1 $parameters -n 1000 elif [ $mode == "local" ] ; then $prefix ./cdfopr/scripts/run.sh -J $job1 $parameters elif [ $mode == "test-caf" ] ; then $prefix Cafcom $tarball icaf:${name}_$dataset.$.tgz ${user}@fnal.gov \ test 1 2 "./cdfopr/scripts/run.sh -J $ $parameters -n 1000" elif [ $mode == "caf" ] ; then $prefix Cafcom $tarball icaf:${name}_$dataset.$.tgz ${user}@fnal.gov \ $queue $job1 $job2 "./cdfopr/scripts/run.sh -J $ $parameters" fi