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 singularity: EIC_SINGULARITY_CONTAINER,
0027 shell:
0028 """
0029 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"
0030 env \
0031 DETECTOR_VERSION={wildcards.DETECTOR_VERSION} \
0032 DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
0033 BG_FILES=bg_files.json \
0034 SLURM_TMPDIR=$PWD \
0035 {input.run_script} EVGEN/{wildcards.BASENAME} hepmc3.tree.root {params.N_EVENTS}
0036 """
0037
0038
0039 rule campaign_prmon_plot_memory:
0040 input:
0041 "{PATH}.prmon.txt",
0042 output:
0043 "{PATH}.{MODE}.{EXTENSION}",
0044 wildcard_constraints:
0045 EXTENSION="(png|pdf|svg)",
0046 MODE="(load|memory)",
0047 singularity: EIC_SINGULARITY_CONTAINER,
0048 shell:
0049 """
0050 case "{wildcards.MODE}" in
0051 load)
0052 flags=( --xvar wtime --yvar utime,stime --yunit SEC --diff --stacked )
0053 ;;
0054
0055 memory)
0056 flags=( --xvar wtime --yvar vmem,pss,rss,swap --yunit GB )
0057 ;;
0058 esac
0059 prmon_plot.py --input "{wildcards.PATH}.prmon.txt" "${{flags[@]}}" --otype {wildcards.EXTENSION} --output "{wildcards.PATH}.{wildcards.MODE}"
0060 """
0061
0062
0063 rule campaign_benchmark:
0064 input:
0065 expand(
0066 "LOG/main/epic/DIS/NC/10x100/minQ2=1/pythia8NCDIS_10x100_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.{PROG}.{MODE}.png",
0067 PROG=[
0068 "npsim",
0069 "eicrecon",
0070 ],
0071 MODE=[
0072 "load",
0073 "memory",
0074 ],
0075 ),
0076 output:
0077 directory("results/campaign"),
0078 singularity: EIC_SINGULARITY_CONTAINER,
0079 shell:
0080 """
0081 mkdir -p {output}
0082 cp {input} {output}
0083 """