All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
run_lar.sh
Go to the documentation of this file.
1 #!/bin/bash
2 set -x
3 echo Start `date`
4 echo Site:${GLIDEIN_ResourceName}
5 echo "the worker node is " `hostname` "OS: " `uname -a`
6 whoami
7 id
8 
9 cd $_CONDOR_SCRATCH_DIR
10 
11 IFDH_OPTION=""
12 
13 if [ -z $GROUP ]; then
14 
15 # try to figure out what group the user is in
16 GROUP=`id -gn`
17 
18 fi
19 
20 export IFDH_DEBUG=1
21 
22 case $GROUP in
23 
24 sbnd)
25 SCRATCH_DIR="/pnfs/sbnd/scratch/users"
26 ;;
27 esac
28 
29 voms-proxy-info --all
30 
31 
32 source /grid/fermiapp/products/common/etc/setups.sh
33 source /cvmfs/oasis.opensciencegrid.org/fermilab/products/larsoft/setup
34 
36 
37 echo "Here is the your environment in this job: " > job_output_${CLUSTER}.${PROCESS}.log
38 env >> job_output_${CLUSTER}.${PROCESS}.log
39 
40 echo "group = $GROUP"
41 
42 if [ -z ${GRID_USER} ]; then
43 GRID_USER=`basename $X509_USER_PROXY | cut -d "_" -f 2`
44 fi
45 
46 echo "GRID_USER = `echo $GRID_USER`"
47 
48 sleep $[ ( $RANDOM % 10 ) + 1 ]m
49 
50 umask 002
51 
52 cd $_CONDOR_SCRATCH_DIR
53 
54 
55 ####################################
56 ###### setup your needed products here, e.g. geant4 etc...
57 ####################################
58 
59 # source /grid/fermiapp/products/larsoft/setup
60 # setup geant4 v4_9_6_p03e -q debug:e6
61 # setup geant4 v4_9_6_p03e -q e6:prof #no debug information, faster.
62 
63 
64 
65 ####################################
66 ###### setup LArSoft
67 ####################################
68 version=v03_03_00
69 source /grid/fermiapp/larsoft/products/setup
70 setup git
71 setup gitflow
72 setup mrb
73 export MRB_PROJECT=larsoft
74 setup larsoft ${version} -q debug:e6
75 cd /sbnd/app/users/andrzejs/
76 cd sbndDe${version}/
77 source localProducts_larsoft_${version}_debug_e6/setup
78 mrbslp
79 
80 
81 ####################################
82 #### This is where you copy all of your necessary files to the worker node
83 #### ( If applicable )
84 ####################################
85 
86 # ifdh cp /pnfs/sbnd/scratch/users/andrzejs/hello.out .
87 
88 
89 
90 #######
91 ####### launch executable
92 #######
93 
94 cd $_CONDOR_SCRATCH_DIR
95 
96 lar -c prodsingle_sbnd.fcl -n 5 -o test.root -T test_hist.root &> output_${CLUSTER}.${PROCESS}.log
97 
98 
99 
100 #######
101 ####### Copy results back
102 #######
103 
104 ifdh mkdir ${SCRATCH_DIR}/${GRID_USER}/output_${CLUSTER}.${PROCESS}
105 
106 ifdh cp test.root ${SCRATCH_DIR}/${GRID_USER}/output_${CLUSTER}.${PROCESS}/
107 ifdh cp test_hist.root ${SCRATCH_DIR}/${GRID_USER}/output_${CLUSTER}.${PROCESS}/
108 
109 
110 ifdh cp output*log ${SCRATCH_DIR}/${GRID_USER}/output_${CLUSTER}.${PROCESS}/
111 
112 
113 #ifdh cp debug*log ${SCRATCH_DIR}/${GRID_USER}/output_${CLUSTER}.${PROCESS}/
114 
115 #######
116 ####### The rest is some copying info, that is not necessarily relevant.
117 #######
118 
119 
120 if [ -z "$SCRATCH_DIR" ]; then
121  echo "Invalid dCache scratch directory, not copying back"
122 else
123 
124 #export IFDH_DEBUG=1
125 
126 
127 
128  # first do lfdh ls to check if directory exists
129  ifdh ls ${SCRATCH_DIR}/$GRID_USER
130  # A non-zero exit value probably means it doesn't, so create it
131  if [ $? -ne 0 && -z "$IFDH_OPTION" ]; then
132 
133  echo "Unable to read ${SCRATCH_DIR}/$GRID_USER. Make sure that you have created this directory and given it group write permission (chmod g+w ${SCRATCH_DIR}/$GRID_USER)."
134  exit 74
135 # ifdh mkdir ${SCRATCH_DIR}/$GRID_USER
136 # if [ "$?" -ne "0" ]; then
137 # echo "Unable to make ${SCRATCH_DIR}/$GRID_USER directory"
138 # else
139 # ifdh cp -D --force=gridftp job_output_${CLUSTER}.${PROCESS}.log ${SCRATCH_DIR}/${GRID_USER}/
140 # if [ "$?" -ne "0" ]; then
141 # echo "Error $? when copying to dCache scratch area!!!"
142 # fi
143 # fi
144  else
145  # directory already exists, so let's copy
146  ifdh cp -D $IFDH_OPTION job_output_${CLUSTER}.${PROCESS}.log ${SCRATCH_DIR}/${GRID_USER}/output_${CLUSTER}.${PROCESS}/
147  if [ $? -ne 0 ]; then
148  echo "Error $? when copying to dCache scratch area!\n If you created ${SCRATCH_DIR}/${GRID_USER} yourself,\n make sure that it has group write permission."
149  exit 73
150  fi
151  fi
152 fi
153 
154 echo "End `date`"
155 
156 exit 0
process_name opflash particleana ie ie ie z
then source grid fermiapp products dune setup_dune_fermiapp sh exit else echo No setup file found exit fi setup
process_name opflash particleana ie x
then setup git exit fi setup gitflow exit export MRB_PROJECT
do source
set x echo Start date echo Site
Definition: run_job.sh:13
then echo Invalid dCache scratch not copying back else ifdh ls
Definition: run_job.sh:111
lar1nd SCRATCH_DIR
Definition: run_job.sh:28
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
process_name gaushit a
then GROUP
Definition: run_job.sh:16
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker see the discussion of warn common echo in *Note Linker such as a global int variable echo as opposed to a large global array echo echo I echo The symbol is an indirect reference to another symbol This echo is a GNU extension to the a out object file format which is echo rarely used echo echo N echo The symbol is a debugging symbol echo echo R echo The symbol is in a read only data section echo echo S echo The symbol is in an uninitialized data section for small echo objects echo echo T echo The symbol is in the the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo W echo The symbol is a weak symbol that has not been specifically echo tagged as a weak object symbol When a weak defined symbol echo is linked with a normal defined the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo echo The symbol is a stabs symbol in an a out object file In echo this the next values printed are the stabs other echo the stabs desc and the stab type Stabs symbols are echo used to hold debugging information For more information
then shift fi
then echo Setting up ifdhc
esac shift done rm f *xml find $SBNDCODE_DIR source fcl gen name *fcl while read fcl do if!echo $fcl grep q common
do cd
g grid
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
do i e
then GRID_USER
Definition: run_job.sh:46
stream1 can override from command line with o or output services user sbnd
BEGIN_PROLOG hitmakerfive clustermakerfour pfparticlemakerthree showermakertwo END_PROLOG hitmakerfive clustermakerfour pfparticlemakerthree sequence::inline_paths sequence::inline_paths sequence::inline_paths showermakers test