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