All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
neoSmazza.sh
Go to the documentation of this file.
1 #!/usr/bin/env bash
2 #
3 # This script creates in the specified directory a series of configuration files
4 # (FHiCL and XML respectively for art and project.py) to be submitted to build
5 # an entire photon visibility library.
6 # All parameters are hard-coded into the "Script settings" section;
7 # the script only takes as optional argument an alternative output directory.
8 #
9 # This script produces:
10 # * a lot of FHiCL files (in their own subdirectory), one per job
11 # * a lot of XML files (in their own subdirectory), one per job
12 # * one XML file list with absolute paths
13 # * one `project.py` script with all XML files
14 #
15 #
16 # Job details
17 # ------------
18 #
19 # Each job fills one voxel per event
20 # (i.e. a job with 10 events is going to fill 10 jobs).
21 #
22 #
23 # Run instructions
24 # -----------------
25 #
26 # The script can and should run without arguments. For debugging purposes,
27 # the following arguments are accepted:
28 #
29 # neoSmazza.sh [BaseOutputDir] [CampaignTag] [ScriptOutputDir]
30 #
31 # * `BaseOutputDir` is the directory where job output will be copied;
32 # * `CampaignTag` is a reference tag for the production (default: today date);
33 # * `ScriptOutputDir` is the directory where scripts and configuration are
34 # stored (same as `BaseOutputDir` by default)
35 #
36 
37 SCRIPTNAME="$(basename "$0")"
38 SCRIPTVERSION="1.7"
39 
40 
41 ################################################################################
42 ### Script settings
43 ################################################################################
44 
45 #
46 # physics configuration: geometry and number of voxels (and voxels per job);
47 # current implementation uses bash to do the math: round to integers!
48 #
49 # The current code (v09_00_00) can autodetect the size of the volume,
50 # but it would make precise numbers; here we prefer to have round numbers and
51 # potentially miss a bit of the volume close to the cryostat border;
52 # these numbers describe the (rounded) volume of the default ICARUS geometry
53 # in `icaruscode` `v09_00_00`.
54 # These figures are from `icarus_v3` geometry.
55 #
56 declare XMin="-395" # cm
57 declare XMax=" -25" # cm
58 declare YMin="-215" # cm
59 declare YMax=" 170" # cm
60 declare ZMin="-985" # cm
61 declare ZMax=" 985" # cm
62 
63 declare Step="5" # cm
64 declare XStep="$Step"
65 declare YStep="$Step"
66 declare ZStep="$Step"
67 
68 declare -i PhotonsPerVoxel=1000000
69 
70 #
71 # Job configuration for the generation in a few voxels (template):
72 # icaruscode version and FHiCL name
73 #
74 declare -r ProductionVersion="${ICARUS_VERSION:-v09_37_01}"
75 declare -r ReferenceConfiguration='photonlibrary_builder_icarus.fcl'
76 
77 declare -ir VoxelsPerJob=814 # estimate: 70s/ 1M photons
78 
79 declare -r DefaultUserOutputDir="/pnfs/icarus/scratch/users/${USER}/jobOutput"
80 declare -r DefaultCampaignTag="$(date '+%Y%m%d')" # current date in format YYYYMMDD
81 
82 #
83 # Technical details that may need update because world goes on
84 #
85 declare -r Qualifiers='e20:prof' # GCC 9.3.0
86 declare -r ExecutionNodeOS='SL7' # Scientific Linux [Fermi] 7
87 declare ExpectedJobTime='48h'
88 declare -r ExpectedMemoryUsage='2000'
89 declare -r GeneratorLabel='generator'
90 
91 #
92 # TEST settings
93 #
94 if [[ "${THISISATEST:-0}" != "0" ]]; then
95  if [[ "$THISISATEST" == 1 ]]; then
96  PhotonsPerVoxel=$((${PhotonsPerVoxel:-1000000} / 100)) # 1% of the regular job
97  else
98  PhotonsPerVoxel="$THISISATEST"
99  fi
100  ExpectedJobTime='8h'
101 fi
102 
103 declare -a ExtraJobsubOptions=(
104  # this magic asks for more modern CPU:
105 # "--append_condor_requirements='(TARGET.CpuFamily=?=6 && TARGET.CpuModelNumber=?=85)'"
106 )
107 
108 # be careful about single quotes inside the amenment
109 declare ConfigurationAmend=''
110 
111 ################################################################################
112 # internal variables; can change if you really want to
113 #
114 ReferenceBaseName="$(basename "${ReferenceConfiguration%.fcl}")"
115 XMLlistName="${ReferenceBaseName}-xml.list"
116 SubmitScriptName="${ReferenceBaseName}-submit.sh"
117 
118 CampaignTag="${2:-"${DefaultCampaignTag}"}"
119 BaseOutputDir="${1:-"${DefaultUserOutputDir}/${ReferenceBaseName}/${CampaignTag}"}"
120 ScriptOutputDir="${3:-${BaseOutputDir}}"
121 BaseJobOutputDir="${BaseOutputDir%/}/output"
122 FHiCLdir="${ScriptOutputDir%/}/fcl"
123 XMLdir="${ScriptOutputDir%/}/xml"
124 XMLlistPath="${ScriptOutputDir%/}/${XMLlistName}"
125 SubmitScriptPath="${ScriptOutputDir%/}/${SubmitScriptName}"
126 
127 StageName='LibraryBuild'
128 
129 UserName="$USER"
130 HostName="$(hostname)"
131 
132 
133 #
134 # do the math
135 #
136 declare XRange="$(( XMax - XMin ))"
137 declare YRange="$(( YMax - YMin ))"
138 declare ZRange="$(( ZMax - ZMin ))"
139 declare -i NStepsX="$(( XRange / XStep ))"
140 declare -i NStepsY="$(( YRange / YStep ))"
141 declare -i NStepsZ="$(( ZRange / ZStep ))"
142 declare -i TotalVoxels="$(( NStepsX * NStepsY * NStepsZ ))"
143 
144 declare -i NJobs="$(( TotalVoxels / VoxelsPerJob ))"
145 declare -i LastJobVoxels="$(( TotalVoxels - VoxelsPerJob * NJobs ))"
146 if [[ $LastJobVoxels -gt 0 ]]; then
147  let ++NJobs
148 else
149  LastJobVoxels="$VoxelsPerJob" # just as all others
150 fi
151 LastJob=$((NJobs - 1))
152 
153 
154 ################################################################################
155 ### Support functions
156 ################################################################################
157 function STDERR() { echo "$@" >&2 ; }
158 function FATAL() {
159  local -i Code="$1"
160  export KEEPTEMP=1
161  shift
162  STDERR "FATAL (${Code}): $*"
163  if [[ -r "$ErrorLog" ]]; then
164  echo "FATAL (${Code}): $*" >> "$ErrorLog"
165  STDERR " (log file available at: '${ErrorLog}')"
166  fi
167  exit "$Code"
168 } # FATAL()
169 
170 
171 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
172 function ClearTemporary() {
173  [[ -d "$MyTempDir" ]] || return
174  if [[ "${KEEPTEMP:-0}" != 0 ]]; then
175  # if the temporary directory is empty, we remove it anyway.
176  rmdir -p "$MyTempDir" >& /dev/null || STDERR "WARNING: temporary files in '${MyTempDir}' have been left behind."
177  else
178  rm -Rf "$MyTempDir"
179  fi
180 } # ClearTemporary()
181 trap ClearTemporary EXIT
182 declare -r MyTempDir="$(mktemp --directory --tmpdir "${SCRIPTNAME%.sh}-${USER}-tmpXXXXXX" )"
183 
184 
185 function ScheduleForTransfer() {
186  # adds the specified file in the list of files to transfer to ScriptOutputDir;
187  # if the path is relative to our temporary directory, its relative path is preserved
188 
189  [[ -n "$MyTempDir" ]] || FATAL 1 "Logic error: temporary directory not defined!"
190  [[ -n "$TransferListTempFile" ]] || FATAL 1 "Logic error: transfer file not defined!"
191  [[ -n "$ScriptOutputDir" ]] || FATAL 1 "Logic error: script output directory not defined!"
192 
193  local SourceFile RelSourcePath DestPath
194  for SourceFile in "$@" ; do
195  RelSourcePath="${SourceFile#${MyTempDir}/}"
196  [[ "${RelSourcePath:0:1}" == '/' ]] && RelSourcePath="$(basename "$SourceFile")"
197  DestPath="${ScriptOutputDir%/}/${RelSourcePath}"
198 
199  echo "${SourceFile} ${DestPath}" >> "$TransferListTempFile"
200  done
201 
202 } # ScheduleForTransfer()
203 
204 
205 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
206 function CounterPadding() {
207  declare -i Counts="$1"
208  declare -i LastCount="$((Counts - 1))"
209  echo "${#LastCount}"
210 } # CounterPadding()
211 
212 function PadCounter() {
213  declare -i Value="$1"
214  declare -i Padding="$2"
215  printf "%0*d" "$Padding" "$Value"
216 } # PadCounter()
217 
218 
219 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
220 function Pager() {
221  local -i Iter="$1"
222  local -i NIters="$2"
223  local -i NSteps="${3:-10}"
224 
225  if [[ "$Iter" -ge "$NIters" ]]; then
226  STDERR " 100%"
227  return
228  fi
229 
230  local -i Step="$(( NIters / NSteps ))"
231  [[ "$NIters" -gt "$(( NSteps * Step ))" ]] && let ++Step
232 
233  local -i Page="$(( Iter / Step ))"
234  if [[ "$(( Page * Step ))" == "$Iter" ]]; then
235  STDERR -n " $(( 100 * Page / NSteps ))% "
236  fi
237  STDERR -n '.'
238 
239 } # Pager()
240 
241 
242 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
243 function CreateDirectoryFor() {
244  local Dest
245  for Dest in "$@" ; do
246 
247  if [[ "${Dest: -1}" == '/' ]]; then
248  Dir="$Dest"
249  else
250  Dir="$(dirname "$Dest")"
251  fi
252 
253  [[ -d "$Dir" ]] && continue
254  mkdir "$Dir" || FATAL $? "Can't create a directory for '${Dest}'."
255  done
256 } # CreateDirectoryFor()
257 
258 
259 function FHiCLtoXMLname() {
260  local TemplateName="$1"
261  echo "${TemplateName%.fcl}.xml"
262 } # FHiCLtoXMLname()
263 
264 
265 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
266 function CreateFHiCL() {
267  local TemplateFHiCL="$1"
268  local FirstVoxel="$2"
269  local NVoxels="$3"
270  local ConfigurationFileName="$4"
271  local JobTag="$5"
272 
273  # ----------------------------------------------------------------------------
274  # --- BEGIN FCL HERE
275  # ----------------------------------------------------------------------------
276  local ConfigurationFileBaseName
277  if [[ -n "$ConfigurationFileName" ]]; then
278  ConfigurationFileBaseName="$(basename "${ConfigurationFileName%.fcl}")"
279  cat <<EOH
280 #
281 # File: ${ConfigurationFileName}
282 EOH
283  fi
284 
285  cat <<EOF
286 #
287 # Configuration file for ${NVoxels} voxels starting from ${FirstVoxel}${JobTag:+" (${JobTag}${NJobs:+" / ${NJobs} jobs"})"}
288 #
289 # Template configuration file: '${TemplateFHiCL}'
290 #
291 # Created on $(date) for ${ReferenceBaseName} (${CampaignTag}) by ${UserName} on ${HostName}
292 # with ${SCRIPTNAME} version ${SCRIPTVERSION}
293 #
294 
295 #include "${TemplateFHiCL}"
296 
297 ${ConfigurationAmend:+"# ------------------------------------------------------------------------------"}
298 ${ConfigurationAmend:+"# Additional configuration "}
299 ${ConfigurationAmend:+"# -------------------------"}
300 ${ConfigurationAmend}
301 
302 # ------------------------------------------------------------------------------
303 
304 #
305 # set the library range
306 #
307 services.PhotonVisibilityService: {
308  @table::services.PhotonVisibilityService
309 
310  UseCryoBoundary: false
311  XMin: ${XMin} # cm
312  XMax: ${XMax} # cm
313  YMin: ${YMin} # cm
314  YMax: ${YMax} # cm
315  ZMin: ${ZMin} # cm
316  ZMax: ${ZMax} # cm
317 
318  NX: ${NStepsX} # ${XStep} cm voxels filling ${XRange} cm
319  NY: ${NStepsY} # ${YStep} cm voxels filling ${YRange} cm
320  NZ: ${NStepsZ} # ${ZStep} cm voxels filling ${ZRange} cm
321 
322 } # services.PhotonVisibilityService
323 
324 
325 #
326 # set the range of voxels processed by this job
327 #
328 
329 physics.producers.${GeneratorLabel}: {
330  @table::physics.producers.${GeneratorLabel}
331 
332  N: ${PhotonsPerVoxel}
333  FirstVoxel: ${FirstVoxel}
334  LastVoxel: -1 # keeps increasing at each event (limited by \`maxEvents\` below)
335 
336 } # physics.producers.${GeneratorLabel}
337 
338 source.maxEvents: ${NVoxels}
339 ${ConfigurationFileBaseName:+"services.TFileService.fileName: '${ConfigurationFileBaseName}-PhotonLibraryData.root'"}
340 
341 # ------------------------------------------------------------------------------
342 
343 EOF
344  # ----------------------------------------------------------------------------
345  # --- END FCL
346  # ----------------------------------------------------------------------------
347 
348 } # CreateFHiCL()
349 
350 
351 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
352 function CreateXML() {
353 
354  local -r JobOutputDir="$1"
355  local -r JobConfiguration="$2"
356  local -i NVoxels="$3"
357  local JobTag="$4"
358 
359  local -r JobConfigurationName="$(basename "$JobConfiguration")"
360  local -r JobConfigurationDir="$(dirname "$JobConfiguration")"
361 
362 
363  # ----------------------------------------------------------------------------
364  # --- BEGIN XML HERE
365  # ----------------------------------------------------------------------------
366  cat <<EOF
367 <?xml version="1.0"?>
368 
369 <!-- Production Project -->
370 
371 <!DOCTYPE project [
372 <!ENTITY release "${ProductionVersion}" >
373 <!ENTITY file_type "mc" >
374 <!ENTITY run_type "physics" >
375 <!ENTITY name "${ReferenceBaseName}${JobTag:+"-${JobTag}"}" >
376 <!ENTITY output_base_name "${JobOutputDir}" >
377 <!ENTITY qualifiers "${Qualifiers}" >
378 ]>
379 
380 <job>
381 
382  <project name="&name;">
383 
384  <!-- Project size -->
385  <numevents>${NVoxels}</numevents>
386 
387  <!-- Operating System -->
388  <os>${ExecutionNodeOS}</os>
389 
390  <!-- Batch resources -->
391  <resource>DEDICATED,OPPORTUNISTIC</resource>
392  <cpu>1</cpu>
393  <memory>${ExpectedMemoryUsage}</memory>
394  <disk>5GB</disk>
395 
396  <!-- LArSoft information -->
397  <larsoft>
398  <tag>&release;</tag>
399  <qual>&qualifiers;</qual>
400  </larsoft>
401 
402  <fcldir>${JobConfigurationDir}</fcldir>
403 
404  <!-- Project stages -->
405 
406  <stage name="${StageName}">
407 
408  <fcl>${JobConfigurationName}</fcl>
409  <outdir>&output_base_name;/out</outdir>
410  <workdir>&output_base_name;/log</workdir>
411  <numjobs>1</numjobs>
412  <datatier>generated</datatier>
413 
414  <!-- AutoRelease+Grace: if expected life time is exceeded, ask for the job to be rescheduled with 1.5 more days -->
415  <!-- jobsub>--expected-lifetime ${ExpectedJobTime} --lines '+FERMIHTC_AutoRelease=True' --lines '+FERMIHTC_GraceLifetime=129600'${ExtraJobsubOptions:+ "${ExtraJobsubOptions[@]}"}</jobsub -->
416  <!-- AutoRelease+Grace: release, with the same time requirement -->
417  <!-- jobsub>--expected-lifetime ${ExpectedJobTime} --lines '+FERMIHTC_AutoRelease=True' --lines '+FERMIHTC_GraceLifetime=0'${ExtraJobsubOptions:+ "${ExtraJobsubOptions[@]}"}</jobsub -->
418 
419  <!-- if the job has been held (JobStatus==5) for more than 10 minutes ((CurrentTime-EnteredCurrentStatus)>600) and has not restarted fewer than 4 times (NumJobStarts<4),
420  then release it; this is Vito's magic -->
421  <jobsub>--expected-lifetime ${ExpectedJobTime} --lines='+PeriodicRelease=(JobStatus==5)&amp;&amp;(NumJobStarts&lt;4)&amp;&amp;((CurrentTime-EnteredCurrentStatus)&gt;600)'</jobsub>
422 
423  <TFileName>&name;-PhotonLibraryData.root</TFileName>
424 
425  <!-- analysis job, i.e. do not look for a art ROOT file -->
426  <ana>1</ana>
427  <anadatatier>root-tuple</anadatatier>
428 
429  </stage>
430 
431  <!-- file type -->
432  <filetype>&file_type;</filetype>
433 
434  <!-- run type -->
435  <runtype>&run_type;</runtype>
436 
437  </project>
438 
439 </job>
440 EOF
441  # ----------------------------------------------------------------------------
442  # --- END XML
443  # ----------------------------------------------------------------------------
444 } # CreateXML()
445 
446 
447 ################################################################################
448 ### main program
449 ################################################################################
450 
451 cat <<EOM
452 
453 =================================================
454  ICARUS photon library configuration builder
455 =================================================
456 
457 Physics configuration
458 -----------------------
459 
460 Coverage:
461  X: ${XMin} -- ${XMax} cm in ${NStepsX} x ${XStep}-cm steps
462  Y: ${YMin} -- ${YMax} cm in ${NStepsY} x ${YStep}-cm steps
463  Z: ${ZMin} -- ${ZMax} cm in ${NStepsZ} x ${ZStep}-cm steps
464 
465 Total voxels: ${TotalVoxels} in ${NJobs} jobs with ${VoxelsPerJob} voxels each (last: ${LastJobVoxels}).
466 
467 Photons: ${PhotonsPerVoxel} / voxel
468 
469 
470 Job configuration
471 -------------------
472 
473 Job name: '${ReferenceBaseName}'
474 Campaign tag: '${CampaignTag}'
475 Output directory: '${BaseOutputDir}'
476 EOM
477 
478 [[ "$BaseOutputDir" != "$ScriptOutputDir" ]] && echo "Script directory: '${ScriptOutputDir}'"
479 
480 cat <<EOM
481 
482 XML file list: '${XMLlistPath}'
483 Submission script: '${SubmitScriptPath}'
484 
485 EOM
486 
487 
488 if [[ "${#ExtraJobsubOptions[@]}" -gt 0 ]]; then
489  cat <<EOM
490 
491 Extra jobsub options: ${ExtraJobsubOptions[@]}
492 EOM
493 fi
494 
495 
496 if [[ -n "${ConfigurationAmend// }" ]]; then
497  cat <<EOM
498 
499 Extra configuration:
500 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
501 ${ConfigurationAmend}
502 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
503 EOM
504 fi
505 
506 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
507 
508 #
509 # preparation of directories and scripts
510 #
511 
512 # start the log (will be deleted on successful termination);
513 # not everything is going to be logged...
514 declare ErrorLog="${MyTempDir}/${SCRIPTNAME%.sh}.log"
515 cat <<EOH > "$ErrorLog"
516 ================================================================================
517 ${SCRIPTNAME} log file started at $(date) by ${USER}
518 
519 Working directory: $(pwd)
520 
521 Command: $*
522 
523 ================================================================================
524 EOH
525 
526 
527 # test the transfer to destination:
528 # we don't want to find out we can't transfer only at the end!
529 mkdir -p "$ScriptOutputDir" || FATAL $? "Can't create output directory '${ScriptOutputDir}'."
530 TestFile='test.file'
531 rm -f "$TestFile" "${ScriptOutputDir}/${TestFile}"
532 echo "Test file ($(date))" > "$TestFile"
533 declare -a Cmd=( ifdh cp '-D' "$TestFile" "$ScriptOutputDir" )
534 echo -n "Testing IFDH file transfer..."
535 cat <<EOM >> "$ErrorLog"
536 $(date) - testing IFDH file transfer...
537 CMD> ${Cmd[@]}
538 EOM
539 "${Cmd[@]}" >> "$ErrorLog" 2>&1 || FATAL $? "Test transfer failed."
540 [[ -r "${ScriptOutputDir}/${TestFile}" ]] || FATAL 2 "Test transfer completed, but test file is not available at '${ScriptOutputDir}/${TestFile}'."
541 rm -f "$TestFile" "${ScriptOutputDir}/${TestFile}"
542 echo " done."
543 cat <<EOM >> "$ErrorLog"
544 $(date) - IFDH file transfer test successful
545 --------------------------------------------------------------------------------
546 CMD> ${Cmd[@]}
547 EOM
548 
549 # this file holds the temporary files and their final destination;
550 # IFDH will take care of the transfer at the end of the script.
551 TransferListTempFile="${MyTempDir}/TransferFileList.txt"
552 
553 
554 XMLlistTempFile="${MyTempDir}/${XMLlistName}"
555 SubmitTempFile="${MyTempDir}/${SubmitScriptName}"
556 CreateDirectoryFor "${MyTempDir}/fcl/" "${MyTempDir}/xml/" || FATAL 2 "Can't create temporary directories!"
557 ScheduleForTransfer "$XMLlistTempFile" "$SubmitTempFile"
558 
559 CreateDirectoryFor "${FHiCLdir}/" "${XMLdir}/" "$XMLlistPath" "$SubmitScriptPath"
560 AbsFHiCLdir="$(readlink -f "$FHiCLdir")"
561 
562 
563 cat <<EOH > "$SubmitTempFile"
564 #!/usr/bin/env bash
565 #
566 # Run with no argument to execute '--submit', or with the arguments \`to project.py\`.
567 #
568 
569 declare -ar Arguments=( "\${@:-"--submit"}" )
570 declare -i nErrors=0
571 
572 cat <<EOM
573 Running project.py command: \${Arguments[@]}
574  on ${NJobs} jobs from ${XMLdir}
575 
576 EOM
577 
578 EOH
579 
580 #
581 # job loop
582 #
583 echo -n "$(date) - Creating ${NJobs} job XML and FHiCL files:"
584 declare -ri JobPadding="$(CounterPadding "$NJobs")"
585 
586 declare -i FirstVoxel=0
587 declare -i iJob=0
588 while [[ $FirstVoxel -lt $TotalVoxels ]]; do
589 
590  JobTag="job$(PadCounter "$iJob" "$JobPadding")"
591 
592  if [[ $iJob == $LastJob ]]; then
593  JobVoxels="$LastJobVoxels"
594  else
595  JobVoxels="$VoxelsPerJob"
596  fi
597 
598  #
599  # create the configuration file
600  #
601  JobConfigurationFileName="${ReferenceBaseName}-${JobTag}.fcl"
602  JobConfigurationTempPath="${MyTempDir}/fcl/${JobConfigurationFileName}"
603  JobConfigurationPath="${ScriptOutputDir%/}/fcl/${JobConfigurationFileName}"
604  JobConfigurationXMLTempPath="${MyTempDir}/xml/$(FHiCLtoXMLname "$JobConfigurationFileName")"
605  JobConfigurationXML="${ScriptOutputDir%/}/xml/$(FHiCLtoXMLname "$JobConfigurationFileName")"
606  JobOutputDir="${BaseJobOutputDir%/}/${JobTag}"
607 
608  # for fast debug of the loop:
609 # echo "Job ${iJob}: ${JobVoxels} voxels from ${FirstVoxel} => ${JobConfigurationXML}"
610 
611  # dCache also does not support overwriting with redirection...
612  rm -f "$JobConfigurationTempPath" "$JobConfigurationXMLTempPath"
613  CreateFHiCL "$(basename "$ReferenceConfiguration")" "$FirstVoxel" "$JobVoxels" "$JobConfigurationFileName" "$JobTag" > "$JobConfigurationTempPath"
614  CreateXML "$JobOutputDir" "$JobConfigurationPath" "$JobVoxels" "$JobTag" > "$JobConfigurationXMLTempPath"
615 
616  ScheduleForTransfer "$JobConfigurationTempPath" "$JobConfigurationXMLTempPath"
617  echo "$JobConfigurationXML" >> "$XMLlistTempFile"
618 
619  echo "echo '[${JobTag}] ${JobConfigurationXML}' ; project.py --xml \"${JobConfigurationXML}\" --stage \"${StageName}\" \"\${Arguments[@]}\" || let ++nErrors" >> "$SubmitTempFile"
620 
621  # print on screen a dot for each iteration
622  Pager "$iJob" "$NJobs" '20'
623 
624  let ++iJob
625  let FirstVoxel+=JobVoxels
626 
627 # [[ $iJob -ge 4 ]] && break # another debug shortcut
628 done
629 
630 # some sanity checks
631 [[ $FirstVoxel == $TotalVoxels ]] || FATAL 1 "Stop everything!! there should be ${TotalVoxels} in total, but we covered ${FirstVoxel}!!"
632 [[ $iJob == $NJobs ]] || FATAL 1 "Stop everything!! there should be ${NJobs} in total, but we created ${iJob}!!"
633 
634 Pager "$iJob" "$NJobs" '20' # complete paging output
635 
636 #
637 # finish
638 #
639 cat <<EOF >> "$SubmitTempFile"
640 
641 echo "Execution of ${NJobs} commands completed (\${nErrors} errors)."
642 [[ \$nErrors == 0 ]]
643 EOF
644 
645 #
646 # transfer files to the final destination;
647 # in principle if IFDH is not available we could work around it with NFS/POSIX,
648 # but we are trying to avoid that.
649 #
650 # while read Source Dest ; do
651 # cp -a "$Source" "$Dest"
652 # done < "$TransferListTempFile"
653 #
654 #
655 
656 # remove the old versions of the output files, if any
657 # (except for the XML and FHiCL)
658 rm -f "$SubmitScriptPath" "$XMLlistPath"
659 
660 
661 echo -n "$(date) - Transferring the files to the final destination (it may take a while)..."
662 Cmd=( ifdh cp '-f' "$TransferListTempFile" )
663 cat <<EOM >> "$ErrorLog"
664 $(date) - final file transfer
665 CMD> ${Cmd[@]}
666 EOM
667 "${Cmd[@]}" >> "$ErrorLog" 2>&1 || FATAL $? "Error transferring the files to '${ScriptOutputDir}'."
668 chmod a+x "$SubmitScriptPath"
669 echo " done."
670 
671 cat <<EOM >> "$ErrorLog"
672 $(date) - final file transfer completed.
673 --------------------------------------------------------------------------------
674 EOM
675 
676 echo "$(date) - all done."
677 
678 
679 ################################################################################
process_name standard_reco_uboone fcl
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics sequence::physics pathW services
opportunistic OPPORTUNISTIC
Definition: submit_lar.sh:296
process_name can override from command line with o or output photon
Definition: runPID.fcl:28
then PhotonsPerVoxel
Definition: neoSmazza.sh:96
stream1 physics producers generator YRange
then echo FATAL
process_name opflash particleana ie x
process_name can override from command line with o or output proton mvapid_weights muon_all_BDT weights xml
Definition: runPID.fcl:28
static std::string format(PyObject *obj, unsigned int pos, unsigned int indent, unsigned int maxlen, unsigned int depth)
Definition: fclmodule.cxx:374
process_name drop raw::OpDetWaveforms_DataApr2016RecoStage1_saturation_ * physics
do source
* file
Definition: file_to_url.sh:69
pdgs p
Definition: selectors.fcl:22
#define the
SCRIPTNAME
Definition: publish.sh:21
std::size_t size(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:561
process_name opflashCryoW ana
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 echo see *Note or object file format specific echo echo For Mac OS X
source drop raw::ubdaqSoftwareTriggerData_ *_ *_ * maxEvents
Definition: frame-shunt.fcl:6
function STDERR()
Definition: utilities.sh:17
shift
Definition: fcl_checks.sh:26
then help exit fi declare r SourceFile
process_name gaushit a
then qual
then local
BEGIN_PROLOG dataFFTHistosEW root
for($it=0;$it< $RaceTrack_number;$it++)
BEGIN_PROLOG Ave chg rms true true true set to to turn off had been working not really
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
return match has_match and(match.match_pdg==11 or match.match_pdg==-11)
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
createEngine this
BEGIN_PROLOG XRange
then echo Work directory not specified exit fi echo Work directory
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
Definition: run_job.sh:29
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
process_name largeant stream1 can override from command line with o or output physics producers generator N
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 options
then echo fcl name
BEGIN_PROLOG hitmakerfive clustermakerfour pfparticlemakerthree showermakertwo END_PROLOG hitmakerfive clustermakerfour pfparticlemakerthree sequence::inline_paths sequence::inline_paths sequence::inline_paths showermakers test
my $NJobs
esac echo uname r
list
Definition: file_to_url.sh:28
stream1 physics producers generator physics producers generator ZRange
then echo echo For Linux