Skip to content
Snippets Groups Projects
Unverified Commit 5b6564ca authored by Dmitry Kalinkin's avatar Dmitry Kalinkin Committed by GitHub
Browse files

treewide: use `set -m` and exec to avoid lingering ddsim processes (#42)

parent 44c31c3c
No related branches found
No related tags found
No related merge requests found
Pipeline #99991 canceled with stages
...@@ -18,7 +18,8 @@ rule warmup_run: ...@@ -18,7 +18,8 @@ rule warmup_run:
"warmup/{DETECTOR_CONFIG}.edm4hep.root", "warmup/{DETECTOR_CONFIG}.edm4hep.root",
message: "Ensuring that calibrations/fieldmaps are available for {wildcards.DETECTOR_CONFIG}" message: "Ensuring that calibrations/fieldmaps are available for {wildcards.DETECTOR_CONFIG}"
shell: """ shell: """
ddsim \ set -m # monitor mode to prevent lingering processes
exec ddsim \
--runType batch \ --runType batch \
--numberOfEvents 1 \ --numberOfEvents 1 \
--compactFile "$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml" \ --compactFile "$DETECTOR_PATH/{wildcards.DETECTOR_CONFIG}.xml" \
......
...@@ -13,7 +13,8 @@ rule backgrounds_sim: ...@@ -13,7 +13,8 @@ rule backgrounds_sim:
N_EVENTS=100 N_EVENTS=100
shell: shell:
""" """
ddsim \ set -m # monitor mode to prevent lingering processes
exec ddsim \
--runType batch \ --runType batch \
--part.minimalKineticEnergy 100*GeV \ --part.minimalKineticEnergy 100*GeV \
--filter.tracker edep0 \ --filter.tracker edep0 \
...@@ -39,7 +40,7 @@ rule backgrounds_ecal_backwards: ...@@ -39,7 +40,7 @@ rule backgrounds_ecal_backwards:
threads: workflow.cores threads: workflow.cores
shell: shell:
""" """
set -m # monitor mode to prevent lingering shells set -m # monitor mode to prevent lingering processes
cleanup() {{ cleanup() {{
echo Cleaning up echo Cleaning up
kill $WORKER_PID $SCHEDULER_PID kill $WORKER_PID $SCHEDULER_PID
......
...@@ -26,7 +26,8 @@ rule emcal_barrel_particles: ...@@ -26,7 +26,8 @@ rule emcal_barrel_particles:
"{DETECTOR_CONFIG}/sim_output/sim_emcal_barrel_{PARTICLE}_energies{E_MIN}_{E_MAX}.edm4hep.root" "{DETECTOR_CONFIG}/sim_output/sim_emcal_barrel_{PARTICLE}_energies{E_MIN}_{E_MAX}.edm4hep.root"
shell: shell:
""" """
ddsim \ set -m # monitor mode to prevent lingering processes
exec ddsim \
--runType batch \ --runType batch \
-v WARNING \ -v WARNING \
--part.minimalKineticEnergy 0.5*GeV \ --part.minimalKineticEnergy 0.5*GeV \
......
...@@ -18,7 +18,8 @@ rule ecal_gaps_sim: ...@@ -18,7 +18,8 @@ rule ecal_gaps_sim:
N_EVENTS=1000 N_EVENTS=1000
shell: shell:
""" """
ddsim \ set -m # monitor mode to prevent lingering processes
exec ddsim \
--runType batch \ --runType batch \
--enableGun \ --enableGun \
--steeringFile "{input.steering_file}" \ --steeringFile "{input.steering_file}" \
...@@ -41,7 +42,8 @@ rule ecal_gaps_recon: ...@@ -41,7 +42,8 @@ rule ecal_gaps_recon:
wildcard_constraints: wildcard_constraints:
INDEX="\d{4}", INDEX="\d{4}",
shell: """ 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} \ eicrecon {input} -Ppodio:output_file={output} \
-Ppodio:output_include_collections=EcalEndcapNRecHits,EcalBarrelScFiRecHits,EcalBarrelImagingRecHits,EcalEndcapPRecHits,MCParticles -Ppodio:output_include_collections=EcalEndcapNRecHits,EcalBarrelScFiRecHits,EcalBarrelImagingRecHits,EcalEndcapPRecHits,MCParticles
""" """
......
...@@ -15,7 +15,8 @@ rule tracking_performance_sim: ...@@ -15,7 +15,8 @@ rule tracking_performance_sim:
N_EVENTS=10000 N_EVENTS=10000
shell: shell:
""" """
ddsim \ set -m # monitor mode to prevent lingering processes
exec ddsim \
--runType batch \ --runType batch \
--enableGun \ --enableGun \
--steeringFile "{input.steering_file}" \ --steeringFile "{input.steering_file}" \
...@@ -38,7 +39,8 @@ rule tracking_performance_recon: ...@@ -38,7 +39,8 @@ rule tracking_performance_recon:
wildcard_constraints: wildcard_constraints:
INDEX="\d{4}", INDEX="\d{4}",
shell: """ 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} \ eicrecon {input} -Ppodio:output_file={output} \
-Ppodio:output_include_collections=MCParticles,CentralCKFTrajectories,CentralCKFTrackParameters,CentralCKFSeededTrackParameters,CentralTrackVertices -Ppodio:output_include_collections=MCParticles,CentralCKFTrajectories,CentralCKFTrackParameters,CentralCKFSeededTrackParameters,CentralTrackVertices
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment