Skip to content

Commit

Permalink
{background,ecal_gaps}/Snakefile: redirect dask scheduler/worker to .…
Browse files Browse the repository at this point in the history
…logs (#117)
  • Loading branch information
veprbl authored Dec 19, 2024
1 parent 5d1e783 commit 7111740
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions benchmarks/backgrounds/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ rule backgrounds_ecal_backwards:
proton_beam_gas_sim="sim_output/" + DETECTOR_CONFIG + "/backgrounds/EPIC/EVGEN/BACKGROUNDS/BEAMGAS/proton/pythia8.306-1.0/100GeV/pythia8.306-1.0_ProtonBeamGas_100GeV_run001.edm4hep.root",
output:
directory("results/backgrounds/backwards_ecal")
log:
scheduler=".logs/results/backgrounds/backwards_ecal/scheduler.log",
worker=".logs/results/backgrounds/backwards_ecal/worker.log",
threads: workflow.cores
shell:
"""
Expand All @@ -49,10 +52,10 @@ cleanup() {{
trap cleanup EXIT
PORT=$RANDOM
dask scheduler --port $PORT &
dask scheduler --port $PORT 2>{log.scheduler} &
export DASK_SCHEDULER=localhost:$PORT
SCHEDULER_PID=$!
dask worker tcp://$DASK_SCHEDULER --nworkers {threads} --nthreads 1 &
dask worker tcp://$DASK_SCHEDULER --nworkers {threads} --nthreads 1 2>{log.worker} &
WORKER_PID=$!
env \
MATPLOTLIBRC={input.matplotlibrc} \
Expand Down
7 changes: 5 additions & 2 deletions benchmarks/ecal_gaps/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ rule ecal_gaps:
),
output:
directory("results/{DETECTOR_CONFIG}/ecal_gaps"),
log:
scheduler=".logs/results/{DETECTOR_CONFIG}/ecal_gaps/scheduler.log",
worker=".logs/results/{DETECTOR_CONFIG}/ecal_gaps/worker.log",
threads: workflow.cores
shell:
"""
Expand All @@ -85,10 +88,10 @@ cleanup() {{
trap cleanup EXIT
PORT=$RANDOM
dask scheduler --port $PORT &
dask scheduler --port $PORT 2>{log.scheduler} &
export DASK_SCHEDULER=localhost:$PORT
SCHEDULER_PID=$!
dask worker tcp://$DASK_SCHEDULER --nworkers {threads} --nthreads 1 &
dask worker tcp://$DASK_SCHEDULER --nworkers {threads} --nthreads 1 2>{log.worker} &
WORKER_PID=$!
env \
MATPLOTLIBRC={input.matplotlibrc} \
Expand Down

0 comments on commit 7111740

Please sign in to comment.