Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
detector_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
detector_benchmarks
Commits
a3cc33d7
Commit
a3cc33d7
authored
9 months ago
by
Dmitry Kalinkin
Browse files
Options
Downloads
Patches
Plain Diff
treewide: use `set -m` and `trap` to cleanup lingering processes
parent
1f0ca504
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/backgrounds/Snakefile
+7
-1
7 additions, 1 deletion
benchmarks/backgrounds/Snakefile
benchmarks/ecal_gaps/Snakefile
+1
-0
1 addition, 0 deletions
benchmarks/ecal_gaps/Snakefile
with
8 additions
and
1 deletion
benchmarks/backgrounds/Snakefile
+
7
−
1
View file @
a3cc33d7
...
@@ -72,6 +72,13 @@ rule backgrounds_ecal_backwards:
...
@@ -72,6 +72,13 @@ rule backgrounds_ecal_backwards:
threads: workflow.cores
threads: workflow.cores
shell:
shell:
"""
"""
set -m # monitor mode to prevent lingering shells
cleanup() {{
echo Cleaning up
kill $WORKER_PID $SCHEDULER_PID
}}
trap cleanup EXIT
PORT=$RANDOM
PORT=$RANDOM
dask scheduler --port $PORT &
dask scheduler --port $PORT &
export DASK_SCHEDULER=localhost:$PORT
export DASK_SCHEDULER=localhost:$PORT
...
@@ -87,5 +94,4 @@ PROTON_BEAM_GAS_GEN=$(realpath {input.proton_beam_gas_gen}) \
...
@@ -87,5 +94,4 @@ PROTON_BEAM_GAS_GEN=$(realpath {input.proton_beam_gas_gen}) \
PROTON_BEAM_GAS_SIM=$(realpath {input.proton_beam_gas_sim}) \
PROTON_BEAM_GAS_SIM=$(realpath {input.proton_beam_gas_sim}) \
OUTPUT_DIR={output} \
OUTPUT_DIR={output} \
python {input.script}
python {input.script}
kill $WORKER_PID $SCHEDULER_PID
"""
"""
This diff is collapsed.
Click to expand it.
benchmarks/ecal_gaps/Snakefile
+
1
−
0
View file @
a3cc33d7
...
@@ -66,6 +66,7 @@ rule ecal_gaps:
...
@@ -66,6 +66,7 @@ rule ecal_gaps:
threads: workflow.cores
threads: workflow.cores
shell:
shell:
"""
"""
set -m # monitor mode to prevent lingering shells
cleanup() {{
cleanup() {{
echo Cleaning up
echo Cleaning up
kill $WORKER_PID $SCHEDULER_PID
kill $WORKER_PID $SCHEDULER_PID
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment