Skip to content

Commit

Permalink
Snakefile: add warmup job to avoid parallel gdml downloads
Browse files Browse the repository at this point in the history
This is needed to facilitate running benchmarks where downloads may
happen.

eic/epic#588
fails in
https://eicweb.phy.anl.gov/EIC/benchmarks/detector_benchmarks/-/jobs/2627824

This is similar to eic/physics_benchmarks#5
  • Loading branch information
veprbl committed Mar 3, 2024
1 parent 6a9eab5 commit 9349933
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
15 changes: 15 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ include: "benchmarks/backgrounds/Snakefile"
include: "benchmarks/barrel_ecal/Snakefile"
include: "benchmarks/ecal_gaps/Snakefile"


rule warmup_run:
output:
"warmup/{DETECTOR_CONFIG}.edm4hep.root",
message: "Ensuring that calibrations/fieldmaps are available for {wildcards.DETECTOR_CONFIG}"
shell: """
ddsim \
--runType batch \
--numberOfEvents 1 \
--compactFile "$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml" \
--outputFile "{output}" \
--enableGun
"""


rule matplotlibrc:
output:
".matplotlibrc",
Expand Down
5 changes: 3 additions & 2 deletions benchmarks/backgrounds/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ rule backgrounds_get_DIS:

rule backgrounds_sim:
input:
"input/backgrounds/{NAME}.hepmc",
hepmc="input/backgrounds/{NAME}.hepmc",
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
"sim_output/{DETECTOR_CONFIG}/backgrounds/{NAME}.edm4hep.root",
log:
Expand All @@ -50,7 +51,7 @@ ddsim \
-v WARNING \
--numberOfEvents {params.N_EVENTS} \
--compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \
--inputFiles {input} \
--inputFiles {input.hepmc} \
--outputFile {output}
"""

Expand Down
1 change: 1 addition & 0 deletions benchmarks/ecal_gaps/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import os
rule ecal_gaps_sim:
input:
steering_file=provider.remote(remote_path("EPIC/EVGEN/SINGLE/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.steer")),
warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root",
output:
"sim_output/{DETECTOR_CONFIG}/{PARTICLE}/{ENERGY}/{PHASE_SPACE}/{PARTICLE}_{ENERGY}_{PHASE_SPACE}.{INDEX}.edm4hep.root",
log:
Expand Down

0 comments on commit 9349933

Please sign in to comment.