All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
submit_combined.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 ###########################################################
4 # Submit sbncode LArSoft jobs to the grid.
5 #
6 # Note: Please check the OUTDIR path!
7 #
8 # Script arguments are passed to "lar"
9 #
10 # From Gray Putnam, taken from script by Andy Mastbaum
11 ###########################################################
12 
13 OUTDIR=$1
14 NPROCESSES=$2
15 FILELIST="sbncode/sbnanalysis/files/$3"
16 CONFIG=$4
17 
18 OUTDIR="/pnfs/sbnd/scratch/users/gputnam/numu-selection/${OUTDIR}"
19 TARDIR="/pnfs/sbnd/resilient/users/gputnam/tars"
20 SBNCODE_TAR="${TARDIR}/sbncode-selection.tar.gz"
21 
22 # Log file
23 LOG="${CLUSTER}_${PROCESS}.log"
24 echo "Running ${0} on ${HOSTNAME}" >>${LOG} 2>&1
25 echo "Cluster: ${CLUSTER}" >>${LOG} 2>&1
26 echo "Process: ${PROCESS}" >>${LOG} 2>&1
27 echo "sbncode: ${SBNCODE_TAR}" >>${LOG} 2>&1
28 echo "lar options: $@" >>${LOG} 2>&1
29 date >>${LOG} 2>&1
30 
31 # Environment
32 source /cvmfs/uboone.opensciencegrid.org/products/setup
33 unsetup mrb
34 source /cvmfs/sbnd.opensciencegrid.org/products/sbnd/setup
35 source /cvmfs/icarus.opensciencegrid.org/products/icarus/setup_icarus.sh
36 setup mrb
37 setup larsoft v08_30_02 -q e17:prof
38 
39 # Get sbncode tarball, unpack, and configure
40 ifdh cp -D ${SBNCODE_TAR} . >>${LOG} 2>&1
41 tar xvf $(basename ${SBNCODE_TAR}) >>${LOG} 2>&1
42 
43 export MRB_PROJECT="larsoft"
44 export MRB_PROJECT_VERSION="v08_30_02"
45 export MRB_QUALS="e17:prof"
46 export MRB_TOP="${PWD}"
47 export MRB_SOURCE="${MRB_TOP}"
48 export MRB_INSTALL="${MRB_TOP}"
49 export PRODUCTS="${MRB_INSTALL}:${PRODUCTS}"
50 
51 echo "local products: $(ups list -aK+ -z .)" >>${LOG} 2>&1
52 
53 mrbsetenv >>${LOG} 2>&1
54 mrbslp >>${LOG} 2>&1
55 
56 . sbncode/sbnanalysis/bin/setup_sbnanalysis.sh
57 
58 NFILES=`wc -l < $FILELIST`
59 echo "Nfiles in list $FILELIST: $NFILES" >>${LOG} 2>&1
60 NRUN=$((($NFILES + $NPROCESSES - 1) / $NPROCESSES))
61 FIRST_FILE=$(($NRUN * $PROCESS))
62 CUT_FILE=$(($NFILES - $FIRST_FILE))
63 THISFILES=`tail -n $CUT_FILE $FILELIST | head -n $NRUN`
64 THISFILES=$(for f in $THISFILES; do pnfsToXRootD $f; done)
65 echo "Processing files: ${THISFILES}" >>${LOG} 2>&1
66 sbn -m SBNOscReco_NumuReco -c $CONFIG ${THISFILES} >>${LOG} 2>&1
67 
68 LASTROOT=`ls -t | grep root | tail -1`
69 
70 # Transfer output files to dCache
71 OUT="${CLUSTER}_${PROCESS}"
72 mkdir -p ${OUT} >>${LOG} 2>&1
73 mv $LASTROOT $OUT
74 mv ${LOG} ${OUT}
75 
76 ifdh mkdir ${OUTDIR}/${OUT}
77 ifdh cp -D ${OUT}/* ${OUTDIR}/${OUT}/
78 ifdh_exit_code=$?
79 
80 exit ${ifdh_exit_code}
then OUTDIR
then source grid fermiapp products dune setup_dune_fermiapp sh exit else echo No setup file found exit fi setup
process_name uboone
then setup git exit fi setup gitflow exit export MRB_PROJECT
do source
pdgs p
Definition: selectors.fcl:22
then echo Invalid dCache scratch not copying back else ifdh ls
Definition: run_job.sh:111
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
BEGIN_PROLOG dataFFTHistosEW root
then dohelp exit fi tar
Definition: make_tarball.sh:51
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
MRB_INSTALL
Definition: grid_setup.sh:25
stream1 can override from command line with o or output services user sbnd