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 "hepmcmerger.prmon.txt",
0014 "eicrecon.dot",
0015 "hepmcmerger.prmon.json",
0016 "eicrecon.prmon.json",
0017 "npsim.prmon.txt",
0018 "hepmcmerger.log",
0019 "eicrecon.log",
0020 ],
0021 ),
0022 #log:
0023 # "log",
0024 wildcard_constraints:
0025 DETECTOR_VERSION="[^/]+",
0026 DETECTOR_CONFIG="[^/]+",
0027 params:
0028 N_EVENTS=100,
0029 shell:
0030 """
0031 env \
0032 DETECTOR_VERSION={wildcards.DETECTOR_VERSION} \
0033 DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
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 shell:
0048 """
0049 case "{wildcards.MODE}" in
0050 load)
0051 flags=( --xvar wtime --yvar utime,stime --yunit SEC --diff --stacked )
0052 ;;
0053
0054 memory)
0055 flags=( --xvar wtime --yvar vmem,pss,rss,swap --yunit GB )
0056 ;;
0057 esac
0058 prmon_plot.py --input "{wildcards.PATH}.prmon.txt" "${{flags[@]}}" --otype {wildcards.EXTENSION} --output "{wildcards.PATH}.{wildcards.MODE}"
0059 """
0060
0061
0062 rule campaign_benchmark:
0063 input:
0064 expand(
0065 "LOG/main/epic/DIS/NC/10x100/minQ2=1/pythia8NCDIS_10x100_minQ2=1_beamEffects_xAngle=-0.025_hiDiv_1.{PROG}.{MODE}.png",
0066 PROG=[
0067 "hepmcmerger",
0068 "npsim",
0069 "eicrecon",
0070 ],
0071 MODE=[
0072 "load",
0073 "memory",
0074 ],
0075 ),
0076 output:
0077 directory("results/campaign"),
0078 shell:
0079 """
0080 mkdir -p {output}
0081 cp {input} {output}
0082 """