Warning, /detector_benchmarks/benchmarks/campaign/Snakefile is written in an unsupported language. File is not indexed.
0001 rule campaign_run:
0002 input:
0003 run_script="/opt/campaigns/hepmc3/scripts/run.sh",
0004 output:
0005 expand(
0006 "LOG/{{DETECTOR_VERSION}}/{{DETECTOR_CONFIG}}/{{BASENAME}}.{EXTENSION}",
0007 EXTENSION=[
0008 "eicrecon.prmon.log",
0009 "npsim.log",
0010 "npsim.prmon.log",
0011 "eicrecon.prmon.txt",
0012 "npsim.prmon.json",
0013 "eicrecon.dot",
0014 "eicrecon.prmon.json",
0015 "npsim.prmon.txt",
0016 "eicrecon.log",
0017 ],
0018 ),
0019 #log:
0020 # "log",
0021 wildcard_constraints:
0022 DETECTOR_VERSION="[^/]+",
0023 DETECTOR_CONFIG="[^/]+",
0024 params:
0025 N_EVENTS=100,
0026 shell:
0027 """
0028 curl -L -o bg_files.json "https://eicweb.phy.anl.gov/EIC/campaigns/datasets/-/raw/main/config_data/synrad_egasbrems_egascoulomb_egastouschek_hgas_18GeVx275GeV_vacuum_10000Ahr_machineruntime_50s.json"
0029 env \
0030 DETECTOR_VERSION={wildcards.DETECTOR_VERSION} \
0031 DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
0032 BG_FILES=bg_files.json \
0033 SLURM_TMPDIR=$PWD \
0034 {input.run_script} EVGEN/{wildcards.BASENAME} hepmc3.tree.root {params.N_EVENTS}
0035 """
0036
0037
0038 rule campaign_prmon_plot_memory:
0039 input:
0040 "{PATH}.prmon.txt",
0041 output:
0042 "{PATH}.{MODE}.{EXTENSION}",
0043 wildcard_constraints:
0044 EXTENSION="(png|pdf|svg)",
0045 MODE="(load|memory)",
0046 shell:
0047 """
0048 case "{wildcards.MODE}" in
0049 load)
0050 flags=( --xvar wtime --yvar utime,stime --yunit SEC --diff --stacked )
0051 ;;
0052
0053 memory)
0054 flags=( --xvar wtime --yvar vmem,pss,rss,swap --yunit GB )
0055 ;;
0056 esac
0057 prmon_plot.py --input "{wildcards.PATH}.prmon.txt" "${{flags[@]}}" --otype {wildcards.EXTENSION} --output "{wildcards.PATH}.{wildcards.MODE}"
0058 """
0059
0060
0061 rule campaign_benchmark:
0062 input:
0063 expand(
0064 "LOG/main/epic/DIS/NC/10x100/minQ2=1/pythia8NCDIS_10x100_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.{PROG}.{MODE}.png",
0065 PROG=[
0066 "npsim",
0067 "eicrecon",
0068 ],
0069 MODE=[
0070 "load",
0071 "memory",
0072 ],
0073 ),
0074 output:
0075 directory("results/campaign"),
0076 shell:
0077 """
0078 mkdir -p {output}
0079 cp {input} {output}
0080 """