From 123c1d5f269596a4d6b74e1ca8c50a3f79150827 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin <dkalinkin@bnl.gov> Date: Thu, 15 Feb 2024 14:17:43 -0500 Subject: [PATCH] Snakefile: add warmup job to avoid parallel gdml downloads (#5) --- Snakefile | 13 +++++++++++++ benchmarks/diffractive_vm/Snakefile | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Snakefile b/Snakefile index 7389e85f..b01ad5e2 100644 --- a/Snakefile +++ b/Snakefile @@ -17,4 +17,17 @@ rule compile_analysis: root -l -b -q -e '.L {input}+' """ +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 +""" + include: "benchmarks/diffractive_vm/Snakefile" diff --git a/benchmarks/diffractive_vm/Snakefile b/benchmarks/diffractive_vm/Snakefile index 602212c2..917169e6 100644 --- a/benchmarks/diffractive_vm/Snakefile +++ b/benchmarks/diffractive_vm/Snakefile @@ -40,7 +40,8 @@ ln {input} {output} rule diffractive_vm_sim: input: - "input/diffractive_vm/sartre_{PARTICLE}_{INDEX}.hepmc", + hepmc="input/diffractive_vm/sartre_{PARTICLE}_{INDEX}.hepmc", + warmup="warmup/{DETECTOR_CONFIG}.edm4hep.root", output: "sim/{DETECTOR_CONFIG}/sartre_{PARTICLE}_{INDEX}.edm4hep.root", params: @@ -54,7 +55,7 @@ ddsim \ -v WARNING \ --numberOfEvents {params.N_EVENTS} \ --compactFile $DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml \ - --inputFiles {input} \ + --inputFiles {input.hepmc} \ --outputFile {output} """ -- GitLab