5 declare -
r SCRIPTVERSION=
"1.0"
7 declare -Ar GenerationScriptNames=(
8 [
'overburden']=
'makeOverburdenVersionOf.sh'
9 [
'nooverburden']=
'makeNoOverburdenVersionOf.sh'
12 declare -
r FHiCLbaseDir=
"${ICARUSCODE_DIR}/fcl"
14 declare -
r JobListFileName=
"OverburdenConfigurations.txt"
17 # ------------------------------------------------------------------------------
18 declare -
r EndLine=$
'\n'
19 function STDERR() { echo
"$*" >&2 ; }
24 STDERR "FATAL(${Code}): $*"
29 # ------------------------------------------------------------------------------
30 function PrintHelp() {
37 This script must be run
in a MRB development area with icarus_code checked out.
44 # ------------------------------------------------------------------------------
45 function MakeUpName() {
46 local TemplateName=
"${1%.fcl}"
53 # policy change: always a modifier, does not replace "standard"
54 # Name="${Name/standard_/${Tag}_}"
55 # [[ "$Name" != "$TemplateName" ]] && break
67 function GenerateConfigurationsFor() {
71 # find the original FHiCL file (we need the full path);
72 # exclude "Deprecated" directories
74 local -
a Matches=( $(find
"$FHiCLbaseDir" -
name "$FHiCLname" | grep -i -
E -v
'(/|^)Deprecated/' ) )
75 case "${#Matches[@]}" in
77 ERROR "No configuration
file '${FHiCLname}
' found under '${FHiCLbaseDir}
'"
81 FHiCLpath="${Matches[0]}"
84 ERROR "Multiple (${#Matches[@]}) configuration files '${FHiCLname}
' found in '${FHiCLbaseDir}
':${EndLine} ${Matches[@]/%/${EndLine} }"
89 # find the original FHiCL file (we need the full path)
91 local ScriptTag Script ConfName
94 for ScriptTag in "${!GenerationScriptPaths[@]}" ; do
95 Script="${GenerationScriptPaths["$ScriptTag"]}"
97 ConfName="$(MakeUpName "$FHiCLname" "$ScriptTag")"
99 echo "'${FHiCLname}
' => '${ConfName}
' ['${ScriptTag}
']"
100 Cmd=( "$Script" "$FHiCLpath" "$ConfName" )
101 if [[ -n "${FAKE//0}" ]]; then
102 echo "$SHELL" "${Cmd[@]}"
106 if [[ $? != 0 ]]; then
107 ERROR "Failed to run ${ScriptTag} script on '${FHiCLpath}
'"
113 [[ $nErrors == 0 ]] # return value
114 } # GenerateConfigurationsFor()
117 # ------------------------------------------------------------------------------
123 declare -A GenerationScriptPaths
124 for ScriptTag in "${!GenerationScriptNames[@]}" ; do
125 ScriptName="${GenerationScriptNames[$ScriptTag]}"
129 ScriptPath="$(which "$ScriptName" 2> /dev/null)"
130 [[ $? == 0 ]] && break
132 ScriptPath="${SCRIPTDIR}/${ScriptName}"
133 [[ $? == 0 ]] && break
135 FATAL 2 "Could not locate the script '${
ScriptName}
'!"
137 GenerationScriptPaths+=( ["$ScriptTag"]="$ScriptPath" )
141 declare JobListFilePath
142 for CandidateDir in "$FHiCLbaseDir" "." ; do
143 JobListFilePath="${CandidateDir}/${JobListFileName}"
144 [[ -r "$JobListFilePath" ]] && break
146 [[ -r "$JobListFilePath" ]] || FATAL 2 "Couldn't find
job list file '${JobListFileName}'"
152 [[ -z "$Line
" ]] && continue
153 [[ "${Line:0:1}
" == "#
" ]] && continue
154 FHiCLname="${Line%.fcl}.fcl
"
155 Jobs+=( "$FHiCLname
" )
156 done < "$JobListFilePath
"
160 --- Setup ----------------------------------------------------------------------
161 Configuration base directory: '${FHiCLbaseDir}'
162 Job name list: '${JobListFileName}'
163 Generation scripts (${#GenerationScriptPaths[@]}):${GenerationScriptPaths[@]/#/${EndLine} }
164 Job configuration (${#Jobs[@]}):${Jobs[@]/#/${EndLine} }
165 --------------------------------------------------------------------------------
168 # we need the full path of the FHiCL file
170 for Job in "${Jobs[@]}
"; do
171 GenerateConfigurationsFor "$Job
" || let ++nErrors
174 [[ "$nErrors
" -gt 0 ]] && FATAL 1 "Detected ${
nErrors} failures.
"
177 # ------------------------------------------------------------------------------
then echo Sam station was not specified(use option--sam_station)." exit 1 fi if [ x$SAM_GROUP
do &&[[-z"$Line"]] continue &&[["${Line:0:1}"=="#"]] continue FHiCLname
return match has_match and(match.match_pdg==11 or match.match_pdg==-11)
BEGIN_PROLOG vertical distance to the surface Name
esac voms proxy info all source grid fermiapp products common etc setups sh source cvmfs oasis opensciencegrid org fermilab products larsoft setup setup ifdhc echo Here is the your environment in this job
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 don t mess with this pandoraTrackGausCryoW true