Skip to content

Commit

Permalink
treewide: use set -m and exec to avoid lingering ddsim processes
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Aug 5, 2024
1 parent 9b44f60 commit 29d8c35
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ rule warmup_run:
"warmup/{DETECTOR_CONFIG}.edm4hep.root",
message: "Ensuring that calibrations/fieldmaps are available for {wildcards.DETECTOR_CONFIG}"
shell: """
ddsim \
set -m # monitor mode to prevent lingering processes
exec ddsim \
--runType batch \
--numberOfEvents 1 \
--compactFile "$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml" \
Expand Down
5 changes: 3 additions & 2 deletions benchmarks/backgrounds/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ rule backgrounds_sim:
N_EVENTS=100
shell:
"""
ddsim \
set -m # monitor mode to prevent lingering processes
exec ddsim \
--runType batch \
--part.minimalKineticEnergy 100*GeV \
--filter.tracker edep0 \
Expand All @@ -39,7 +40,7 @@ rule backgrounds_ecal_backwards:
threads: workflow.cores
shell:
"""
set -m # monitor mode to prevent lingering shells
set -m # monitor mode to prevent lingering processes
cleanup() {{
echo Cleaning up
kill $WORKER_PID $SCHEDULER_PID
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/barrel_ecal/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ rule emcal_barrel_particles:
"{DETECTOR_CONFIG}/sim_output/sim_emcal_barrel_{PARTICLE}_energies{E_MIN}_{E_MAX}.edm4hep.root"
shell:
"""
ddsim \
set -m # monitor mode to prevent lingering processes
exec ddsim \
--runType batch \
-v WARNING \
--part.minimalKineticEnergy 0.5*GeV \
Expand Down
6 changes: 4 additions & 2 deletions benchmarks/ecal_gaps/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ rule ecal_gaps_sim:
N_EVENTS=1000
shell:
"""
ddsim \
set -m # monitor mode to prevent lingering processes
exec ddsim \
--runType batch \
--enableGun \
--steeringFile "{input.steering_file}" \
Expand All @@ -41,7 +42,8 @@ rule ecal_gaps_recon:
wildcard_constraints:
INDEX="\d{4}",
shell: """
env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
set -m # monitor mode to prevent lingering processes
exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
eicrecon {input} -Ppodio:output_file={output} \
-Ppodio:output_include_collections=EcalEndcapNRecHits,EcalBarrelScFiRecHits,EcalBarrelImagingRecHits,EcalEndcapPRecHits,MCParticles
"""
Expand Down
6 changes: 4 additions & 2 deletions benchmarks/tracking_performances/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ rule tracking_performance_sim:
N_EVENTS=10000
shell:
"""
ddsim \
set -m # monitor mode to prevent lingering processes
exec ddsim \
--runType batch \
--enableGun \
--steeringFile "{input.steering_file}" \
Expand All @@ -38,7 +39,8 @@ rule tracking_performance_recon:
wildcard_constraints:
INDEX="\d{4}",
shell: """
env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
set -m # monitor mode to prevent lingering processes
exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
eicrecon {input} -Ppodio:output_file={output} \
-Ppodio:output_include_collections=MCParticles,CentralCKFTrajectories,CentralCKFTrackParameters,CentralCKFSeededTrackParameters,CentralTrackVertices
"""
Expand Down

0 comments on commit 29d8c35

Please sign in to comment.