#!/usr/bin/env bash #------------------------------------------------------------------------------ # usage: cdfopr/scripts/submit_stnmaker_prod dataset[:book] \ # sec1 sec2 [caf[:mode]] [queue] # # edit the script to put in # - right location of the tarball # - queue # - logic defining output directory # - user email address for CAF # # to run 1 job on local machine: # ------------------------------ # cdfopr/scripts/submit_stnmaker_prod zewk0d 1 10 local:test # # to run 300 jobs on Fermilab CAF: # -------------------------------- # cdfopr/scripts/submit_stnmaker_prod wewk9t 501 800 caf #------------------------------------------------------------------------------ dataset=`echo $1 | awk -F : '{print $1}'` book=`echo $1 | awk -F : '{print $2}'` caf="local"; job1=$2 job2=$3 mode="submit"; prefix="" extra_parameters="none" if [ .$4 != "." ] ; then caf=`echo $4 | awk -F : '{print $1}'` x=`echo $4 | awk -F : '{print $2}'`; if [ .$x != "." ] ; then mode=$x ; fi fi if [ $mode == "debug" ] ; then prefix="echo" ; fi if [ $caf == "cafcondor" ] ; then queue=medium ; else queue=medium ; fi if [ .$5 != "." ] ; then queue=$5 ; fi echo book=$book dataset=$dataset mode=$mode caf=$caf tcl_file= host=`hostname -f` tar=stnmaker_prod_5.3.3_dev_242_17.tgz user=`klist | grep Default | awk '{print $3}' | awk -F @ '{print $1}'` if [ ".$CDF_TARBALL_DIR" != "." ] ; then tarball_dir=$CDF_TARBALL_DIR else case $host in "ncdf131.fnal.gov" ) tarball_dir=/cdf/data01/tarballs ;; "fcdflnx3.fnal.gov" ) tarball_dir=/cdf/opr/cdfopr/tarballs ;; * ) tarball_dir= ;; esac fi if [ $caf == "caf" ] ; then if [ $user == "cdfopr" ] ; then queue=cdfopr else queue=medium fi elif [ $caf == ".cafcondor" ] ; then queue=medium ; else queue=medium ; fi tarball=$tarball_dir/$tar output_node=cdfopr@fcdfdata053.fnal.gov output_dir=/cdf/scratch/cdfopr/datasets/$book/$dataset/tmp if [ .$book == "." ] ; then book="cdfpewk" ; fi input_dataset=$dataset case $dataset in "bewk0d" ) # incl high-Pt electrons job=stnmaker.prod input_dataset=bhel0d tcl_file=cdfopr/tcl/stnmaker/filter_hpte.tcl output_node=murat@fcdfdata122 output_dir=/export/data1/ewk/murat/datasets/cdfpewk/$dataset/tmp queue=short ;; "bewk2d" ) # incl high-Pt muons job=stnmaker.prod input_dataset=bhmu0d tcl_file=cdfopr/tcl/stnmaker/filter_hptm.tcl output_node=cdfopr@fcdflnx6 output_dir=/cdf/data58/s0/production/datasets/cdfpewk/$dataset/tmp queue=short ;; "eewk0d" ) # MET25_PS100 and such job=stnmaker.prod input_dataset="emet0d" tcl_file=cdfopr/tcl/stnmaker/filter_met25_ps100.tcl output_node=ewk@fcdfdata030 output_dir=/cdf/scratch/ewk/datasets/cdfpewk/$dataset/tmp queue=short ;; "gcrs0d" ) # zero-bias (0d-0e) ntupling job=stnmaker.prod ;; "sewk3d" ) # SUM ET dataset (0D) input_dataset="gset0d" job=stnmaker.prod output_node=ewk@fcdfdata054 output_dir=/cdf/scratch/ewk/datasets/$book/$dataset/tmp extra_parameters=" -x USE_WWW_TCL=1" ;; "mewkpp" ) job=stnmaker.prod:mc ;; "mewktp" ) job=stnmaker.prod:mc ;; "tmet0d" ) # W->tau nu strip+ntupling job=stnmaker.prod input_dataset=etau0d tcl_file=cdfopr/tcl/stnmaker/filter_taumet.tcl output_node=ewk@fcdfdata030 output_dir=/cdf/scratch/ewk/datasets/cdfpewk/$dataset/tmp queue=short ;; "wewk0d" ) # W->enu (calib) job=stnmaker.prod output_node=ewk@fcdfdata030 output_dir=/cdf/scratch/ewk/datasets/cdfpewk/$dataset/tmp ;; "wewk10" ) # W_NOTRACK, 314 files job=stnmaker.prod input_dataset=wewk10 output_node=cdfopr@fcdflnx6 output_dir=/cdf/data58/s0/production/datasets/cdfpewk/$dataset/tmp queue=short ;; "wewk2d" ) # W->munu (calib) job=stnmaker.prod output_node=ewk@fcdfdata030 output_dir=/cdf/scratch/ewk/datasets/cdfpewk/$dataset/tmp ;; "wewk8t" ) # 5.3.3 W->taunu MC job=stnmaker.prod:mc ;; "wewk9t" ) # 5.3.3 W->taunu MC v2 job=stnmaker.prod:mc output_node=ewk@fcdfdata030 output_dir=/cdf/scratch/ewk/datasets/$book/$dataset/tmp ;; "wewk9t_test" ) # 5.3.3 W->taunu MC v2 job=stnmaker.prod:mc output_node=ewk@fcdfdata030 output_dir=/cdf/scratch/ewk/datasets/$book/$dataset/tmp extra_parameters=" -x USE_WWW_TCL=1" ;; "wewkee" ) job=stnmaker.prod:mc ;; "sewkad" ) # 5.3.3 W->enu MC v2 input_dataset=wewkfe job=stnmaker.prod:mc output_node=ewk@fcdfdata030 output_dir=/cdf/scratch/ewk/datasets/$book/$dataset/tmp ;; "zewk0d" ) # Z->ee job=stnmaker.prod output_node=ewk@fcdfdata030 output_dir=/cdf/scratch/ewk/datasets/cdfpewk/$dataset/tmp ;; "zewk2d" ) # Z->mumu job=stnmaker.prod output_node=ewk@fcdfdata030 output_dir=/cdf/scratch/ewk/datasets/cdfpewk/$dataset/tmp ;; "zewk3m" ) # Z->mumu 5.3.3 MC job=stnmaker.prod:mc ;; "zewkae" ) # Z->ee 5.3.3 MC job=stnmaker.prod:mc ;; * ) esac parameters="-e bin/$BFARCH/stnmaker_prod.exe -j stnmaker.prod -b $book" parameters=${parameters}" -D $input_dataset -o ${output_node}:$output_dir" parameters=${parameters}" -x CAF=$caf" output_tarball=${output_node}:$output_dir/stnmaker_prod_$dataset.$.tgz if [ .$tcl_file != "." ] ; then parameters=${parameters}" -i $tcl_file " fi if [ "$extra_parameters" != "none" ] ; then parameters=${parameters}" $extra_parameters" fi if [ $mode == "test" ] ; then if [ $caf == "local" ] ; then #----------------------------------------------------------------------- # local test job #----------------------------------------------------------------------- cmd="$prefix ./cdfopr/scripts/run.sh -v -J $job1 $parameters -n 1000 &" else #----------------------------------------------------------------------- # test remote job #----------------------------------------------------------------------- setup cdfsoft2 development if [ $caf == "caf" ] ; then queue=test ; fi if [ $caf == "cafcondor" ] ; then queue=test ; fi cmd="$prefix CafSubmit --tarFile=$tarball \ --outLocation=$output_tarball \ --dhaccess=DFC \ --dataset=$input_dataset \ --procType=$queue \ --email=${user}@fnal.gov \ --farm=$caf \ --start=$job1 --end=$job2 \ ./cdfopr/scripts/run.sh -V debug -J $ $parameters -n 10" fi else #----------------------------------------------------------------------- # remote job #----------------------------------------------------------------------- if [ $caf == "local" ] ; then #----------------------------------------------------------------------- # local job #----------------------------------------------------------------------- cmd="$prefix ./cdfopr/scripts/run.sh -v -J $job1 $parameters &" else setup cdfsoft2 development cmd="$prefix CafSubmit --tarFile=$tarball \ --outLocation=$output_tarball \ --dhaccess=DFC \ --dataset=$input_dataset \ --procType=$queue \ --email=${user}@fnal.gov \ --farm=$caf \ --start=$job1 --end=$job2 \ ./cdfopr/scripts/run.sh -V debug -J $ $parameters" fi fi echo $cmd $cmd