Skip to content

add campaign benchmark #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 60 additions & 58 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,69 +121,71 @@ common:setup:
- runner_system_failure

include:
- local: 'benchmarks/backgrounds/config.yml'
- local: 'benchmarks/backwards_ecal/config.yml'
- local: 'benchmarks/beamline/config.yml'
- local: 'benchmarks/calo_pid/config.yml'
- local: 'benchmarks/ecal_gaps/config.yml'
- local: 'benchmarks/tracking_detectors/config.yml'
- local: 'benchmarks/tracking_performances/config.yml'
- local: 'benchmarks/tracking_performances_dis/config.yml'
- local: 'benchmarks/barrel_ecal/config.yml'
- local: 'benchmarks/lfhcal/config.yml'
- local: 'benchmarks/zdc/config.yml'
- local: 'benchmarks/zdc_lyso/config.yml'
- local: 'benchmarks/zdc_neutron/config.yml'
- local: 'benchmarks/zdc_photon/config.yml'
- local: 'benchmarks/zdc_pi0/config.yml'
- local: 'benchmarks/material_scan/config.yml'
- local: 'benchmarks/pid/config.yml'
- local: 'benchmarks/rich/config.yml'
- local: 'benchmarks/timing/config.yml'
- local: 'benchmarks/b0_tracker/config.yml'
- local: 'benchmarks/insert_muon/config.yml'
- local: 'benchmarks/insert_tau/config.yml'
- local: 'benchmarks/zdc_sigma/config.yml'
- local: 'benchmarks/zdc_lambda/config.yml'
- local: 'benchmarks/insert_neutron/config.yml'
- local: 'benchmarks/femc_electron/config.yml'
- local: 'benchmarks/femc_photon/config.yml'
- local: 'benchmarks/femc_pi0/config.yml'
- local: 'benchmarks/nhcal_acceptance/config.yml'
- local: 'benchmarks/nhcal_basic_distribution/config.yml'
#- local: 'benchmarks/backgrounds/config.yml'
#- local: 'benchmarks/backwards_ecal/config.yml'
#- local: 'benchmarks/beamline/config.yml'
#- local: 'benchmarks/calo_pid/config.yml'
- local: 'benchmarks/campaign/config.yml'
#- local: 'benchmarks/ecal_gaps/config.yml'
#- local: 'benchmarks/tracking_detectors/config.yml'
#- local: 'benchmarks/tracking_performances/config.yml'
#- local: 'benchmarks/tracking_performances_dis/config.yml'
#- local: 'benchmarks/barrel_ecal/config.yml'
#- local: 'benchmarks/lfhcal/config.yml'
#- local: 'benchmarks/zdc/config.yml'
#- local: 'benchmarks/zdc_lyso/config.yml'
#- local: 'benchmarks/zdc_neutron/config.yml'
#- local: 'benchmarks/zdc_photon/config.yml'
#- local: 'benchmarks/zdc_pi0/config.yml'
#- local: 'benchmarks/material_scan/config.yml'
#- local: 'benchmarks/pid/config.yml'
#- local: 'benchmarks/rich/config.yml'
#- local: 'benchmarks/timing/config.yml'
#- local: 'benchmarks/b0_tracker/config.yml'
#- local: 'benchmarks/insert_muon/config.yml'
#- local: 'benchmarks/insert_tau/config.yml'
#- local: 'benchmarks/zdc_sigma/config.yml'
#- local: 'benchmarks/zdc_lambda/config.yml'
#- local: 'benchmarks/insert_neutron/config.yml'
#- local: 'benchmarks/femc_electron/config.yml'
#- local: 'benchmarks/femc_photon/config.yml'
#- local: 'benchmarks/femc_pi0/config.yml'
#- local: 'benchmarks/nhcal_acceptance/config.yml'
#- local: 'benchmarks/nhcal_basic_distribution/config.yml'

deploy_results:
allow_failure: true
stage: deploy
needs:
- "collect_results:backgrounds"
- "collect_results:backwards_ecal"
- "collect_results:barrel_ecal"
- "collect_results:beamline"
- "collect_results:calo_pid"
- "collect_results:ecal_gaps"
- "collect_results:lfhcal"
- "collect_results:material_scan"
- "collect_results:pid"
- "collect_results:rich"
- "collect_results:tracking_performance"
- "collect_results:tracking_performance_campaigns"
- "collect_results:zdc_sigma"
- "collect_results:zdc_lambda"
- "collect_results:insert_neutron"
- "collect_results:tracking_performances_dis"
- "collect_results:zdc"
- "collect_results:zdc_lyso"
- "collect_results:zdc_neutron"
- "collect_results:insert_muon"
- "collect_results:insert_tau"
- "collect_results:zdc_photon"
- "collect_results:zdc_pi0"
- "collect_results:femc_electron"
- "collect_results:femc_photon"
- "collect_results:femc_pi0"
- "collect_results:nhcal_acceptance"
- "collect_results:nhcal_basic_distribution"
#- "collect_results:backgrounds"
#- "collect_results:backwards_ecal"
#- "collect_results:barrel_ecal"
#- "collect_results:beamline"
#- "collect_results:calo_pid"
- "collect_results:campaign"
#- "collect_results:ecal_gaps"
#- "collect_results:lfhcal"
#- "collect_results:material_scan"
#- "collect_results:pid"
#- "collect_results:rich"
#- "collect_results:tracking_performance"
#- "collect_results:tracking_performance_campaigns"
#- "collect_results:zdc_sigma"
#- "collect_results:zdc_lambda"
#- "collect_results:insert_neutron"
#- "collect_results:tracking_performances_dis"
#- "collect_results:zdc"
#- "collect_results:zdc_lyso"
#- "collect_results:zdc_neutron"
#- "collect_results:insert_muon"
#- "collect_results:insert_tau"
#- "collect_results:zdc_photon"
#- "collect_results:zdc_pi0"
#- "collect_results:femc_electron"
#- "collect_results:femc_photon"
#- "collect_results:femc_pi0"
#- "collect_results:nhcal_acceptance"
#- "collect_results:nhcal_basic_distribution"
script:
- snakemake $SNAKEMAKE_FLAGS --cores 1 results/metadata.json
- find results -print | sort | tee summary.txt
Expand Down
1 change: 1 addition & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ include: "benchmarks/backwards_ecal/Snakefile"
include: "benchmarks/barrel_ecal/Snakefile"
include: "benchmarks/beamline/Snakefile"
include: "benchmarks/calo_pid/Snakefile"
include: "benchmarks/campaign/Snakefile"
include: "benchmarks/ecal_gaps/Snakefile"
include: "benchmarks/material_scan/Snakefile"
include: "benchmarks/tracking_performances/Snakefile"
Expand Down
75 changes: 75 additions & 0 deletions benchmarks/campaign/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
rule campaign_run:
input:
run_script="/opt/campaigns/hepmc3/scripts/run.sh",
output:
expand(
"LOG/{{DETECTOR_VERSION}}/{{DETECTOR_CONFIG}}/{{BASENAME}}.{EXTENSION}",
EXTENSION=[
"eicrecon.prmon.log",
"npsim.log",
"npsim.prmon.log",
"eicrecon.prmon.txt",
"npsim.prmon.json",
"hepmcmerger.prmon.txt",
"eicrecon.dot",
"hepmcmerger.prmon.json",
"eicrecon.prmon.json",
"npsim.prmon.txt",
"hepmcmerger.log",
"eicrecon.log",
],
),
#log:
# "log",
wildcard_constraints:
DETECTOR_VERSION="[^/]+",
DETECTOR_CONFIG="[^/]+",
params:
N_EVENTS=100,
shell:
"""
env \
DETECTOR_VERSION={wildcards.DETECTOR_VERSION} \
DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
SLURM_TMPDIR=$PWD \
{input.run_script} EVGEN/{wildcards.BASENAME} hepmc3.tree.root {params.N_EVENTS}
"""


rule campaign_prmon_plot_memory:
input:
"{PATH}.prmon.txt",
output:
"{PATH}.{MODE}.{EXTENSION}",
wildcard_constraints:
EXTENSION="(png|pdf|svg)",
MODE="(load|memory)",
shell:
"""
case "{wildcards.MODE}" in
load)
flags=( --xvar wtime --yvar utime,stime --yunit SEC --diff --stacked )
;;

memory)
flags=( --xvar wtime --yvar vmem,pss,rss,swap --yunit GB )
;;
esac
prmon_plot.py --input "{wildcards.PATH}.prmon.txt" "${{flags[@]}}" --otype {wildcards.EXTENSION} --output "{wildcards.PATH}.{wildcards.MODE}"
"""


rule campaign_benchmark:
input:
expand(
"LOG/main/epic/DIS/NC/10x100/minQ2=1/pythia8NCDIS_10x100_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.{PROG}.{MODE}.png",
PROG=[
"hepmcmerger",
"npsim",
"eicrecon",
],
MODE=[
"load",
"memory",
],
),
16 changes: 16 additions & 0 deletions benchmarks/campaign/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
bench:campaign:
extends: .det_benchmark
stage: benchmarks
script:
- snakemake $SNAKEMAKE_FLAGS --cores 1 campaign_benchmark

collect_results:campaign:
extends: .det_benchmark
stage: collect
needs:
- "bench:campaign"
script:
- ls -lrht
- mv results{,_save}/ # move results directory out of the way to preserve it
- snakemake $SNAKEMAKE_FLAGS --cores 1 --delete-all-output campaign_benchmark
- mv results{_save,}/