3 #----------------------------------------------------------------------
6 # Name: mcc10_SubmissionScript.sh
8 # Purpose: Launch batch job using project.py and different stages
10 # Usage: sh mcc10_SubmissionScript.sh --xmld <xmldir> --xml <xmlfile> --stage <stage> [--test]
17 # --stage <stage>; accepted values: detsim, reco, mergeana, finalize
18 # --dataset <dataset>; NOT USED
19 # --mode <mode>; NOT USED
20 # --slice <slice>; NOT USED
21 # --test ; enable POMS test mode (1 job/10 events)
22 # --recovery <dataset>; enable POMS recovery mode NOT USED
24 # Stage "finalize" is used to declare mergeana output.
26 #----------------------------------------------------------------------
36 x--xmld) xmldir="$2"; shift; shift;;
37 x--xml) xmlfile="$2"; shift; shift;;
38 x--stage) stage="$2"; shift; shift;;
39 x--dataset) dataset="$2"; shift; shift;;
40 x--mode) mode="$2"; shift; shift;;
41 x--slice) slice="$2"; shift; shift;;
42 x--test) tempdir=/pnfs/dune/scratch/dunepro/mcc10_test/$(uuidgen); echo "tempdir = $tempdir" ; overrides="$overrides -Onumevents=10 -Ostage.numjobs=1 -Ostage.outdir=$tempdir -Ostage.workdir=$tempdir"; echo "overrides=$overrides"; shift;;
43 x--recovery) mode="recovery"; dataset="$2"; shift; shift;;
49 # use the New and Improved! wrap_proj...
51 wrap_proj=/grid/fermiapp/products/common/prd/poms_client/v2_0_0/NULL/bin/wrap_proj
54 echo -e "\nRunning\n `basename $0` $@"
58 if [[ $? -ne 0 ]]; then echo -e "\n dir $xmldir doesn't exist\n"; exit 1; fi
62 if [ x"$stage" = x"detsim" ]; then
65 $wrap_proj $overrides project.py --xml ${xmlfile} --stage ${stage} --submit
69 echo "project.py terminated with exit code ${EXITCODE}"
71 if [ ${EXITCODE} -ne 0 ]; then exit ${EXITCODE}; fi
76 elif [ x"$stage" = x"reco" ]; then
80 $wrap_proj $overrides project.py --xml ${xmlfile} --stage detsim --check
84 echo "project.py terminated with exit code ${EXITCODE}"
86 if [ ${EXITCODE} -ne 0 ]; then exit ${EXITCODE}; fi
94 $wrap_proj $overrides project.py --xml ${xmlfile} --stage ${stage} --submit
98 echo "project.py terminated with exit code ${EXITCODE}"
100 if [ ${EXITCODE} -ne 0 ]; then exit ${EXITCODE}; fi
104 elif [ x"$stage" = x"mergeana" ]; then
108 $wrap_proj $overrides project.py --xml ${xmlfile} --stage reco --check
112 echo "project.py terminated with exit code ${EXITCODE}"
114 if [ ${EXITCODE} -ne 0 ]; then exit ${EXITCODE}; fi
122 $wrap_proj $overrides project.py --xml ${xmlfile} --stage ${stage} --submit
126 echo "project.py terminated with exit code ${EXITCODE}"
128 if [ ${EXITCODE} -ne 0 ]; then exit ${EXITCODE}; fi
132 elif [ x"$stage" = x"finalize" ]; then
135 $wrap_proj $overrides project.py --xml ${xmlfile} --stage mergeana --check
139 echo "project.py terminated with exit code ${EXITCODE}"
141 if [ ${EXITCODE} -ne 0 ]; then exit ${EXITCODE}; fi
148 $wrap_proj $overrides project.py --xml ${xmlfile} --stage mergeana --declare
152 echo "project.py terminated with exit code ${EXITCODE}"
154 if [ ${EXITCODE} -ne 0 ]; then exit ${EXITCODE}; fi
160 echo "stage $(stage) unknown, accepted value are: detsim, reco, mergeana, finalize"