Skip to content

Commit

Permalink
change your_benchmark to dglazier_benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
dglazier committed Oct 23, 2024
1 parent da965df commit 5b0ce94
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions benchmarks/dglazier_benchmark/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ ENV_MODE = os.getenv("ENV_MODE", "local") # Defaults to "local" if not set
# Output directory based on environment
OUTPUT_DIR = "../../sim_output/" if ENV_MODE == "eicweb" else "sim_output/"
# Benchmark directory based on environment
BENCH_DIR = "benchmarks/your_benchmark/" if ENV_MODE == "eicweb" else "./"
BENCH_DIR = "benchmarks/dglazier_benchmark/" if ENV_MODE == "eicweb" else "./"

rule your_benchmark_campaign_reco_get:
rule dglazier_benchmark_campaign_reco_get:
output:
f"{OUTPUT_DIR}rho_10x100_uChannel_Q2of0to10_hiDiv.{{INDEX}}.eicrecon.tree.edm4eic.root",
shell: """
xrdcp root://dtn-eic.jlab.org//work/eic2/EPIC/RECO/24.07.0/epic_craterlake/EXCLUSIVE/UCHANNEL_RHO/10x100/rho_10x100_uChannel_Q2of0to10_hiDiv.{wildcards.INDEX}.eicrecon.tree.edm4eic.root {output}
"""

rule your_benchmark_analysis:
rule dglazier_benchmark_analysis:
input:
script=f"{BENCH_DIR}analysis/uchannelrho.cxx",
data=f"{OUTPUT_DIR}rho_10x100_uChannel_Q2of0to10_hiDiv.{{INDEX}}.eicrecon.tree.edm4eic.root",
Expand All @@ -27,7 +27,7 @@ mkdir -p $(dirname "{output.plots}")
root -l -b -q '{input.script}+("{input.data}","{output.plots}")'
"""

rule your_benchmark_combine:
rule dglazier_benchmark_combine:
input:
lambda wildcards: expand(
f"{OUTPUT_DIR}campaign_24.07.0_{{INDEX:04d}}.eicrecon.tree.edm4eic/plots.root",
Expand All @@ -42,7 +42,7 @@ rule your_benchmark_combine:
hadd {output} {input}
"""

rule your_benchmark_plots:
rule dglazier_benchmark_plots:
input:
script=f"{BENCH_DIR}macros/plot_rho_physics_benchmark.C",
plots=f"{OUTPUT_DIR}campaign_24.07.0_combined_{{N}}files.eicrecon.tree.edm4eic.plots.root",
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/dglazier_benchmark/analyze.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
source strict-mode.sh
source benchmarks/your_benchmark/setup.config $*
source benchmarks/dglazier_benchmark/setup.config $*

OUTPUT_PLOTS_DIR=sim_output/nocampaign
mkdir -p ${OUTPUT_PLOTS_DIR}
# Analyze
command time -v \
root -l -b -q "benchmarks/your_benchmark/analysis/uchannelrho.cxx(\"${REC_FILE}\",\"${OUTPUT_PLOTS_DIR}/plots.root\")"
root -l -b -q "benchmarks/dglazier_benchmark/analysis/uchannelrho.cxx(\"${REC_FILE}\",\"${OUTPUT_PLOTS_DIR}/plots.root\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR analysis failed"
exit 1
Expand All @@ -18,5 +18,5 @@ if [ ! -d "${OUTPUT_PLOTS_DIR}/plots_figures" ]; then
else
echo "${OUTPUT_PLOTS_DIR}/plots_figures directory already exists."
fi
root -l -b -q "benchmarks/your_benchmark/macros/plot_rho_physics_benchmark.C(\"${OUTPUT_PLOTS_DIR}/plots.root\")"
root -l -b -q "benchmarks/dglazier_benchmark/macros/plot_rho_physics_benchmark.C(\"${OUTPUT_PLOTS_DIR}/plots.root\")"
cat benchmark_output/*.json
10 changes: 5 additions & 5 deletions benchmarks/dglazier_benchmark/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ dglazier_benchmark:results:
- ["dglazier_benchmark:simulate"]
script:
- echo "I will collect results here!"
- mkdir -p results/your_benchmark
- mkdir -p results/dglazier_benchmark
- mkdir -p benchmark_output
- config_file=benchmarks/your_benchmark/setup.config
- config_file=benchmarks/dglazier_benchmark/setup.config
- source $config_file
- if [ "$USE_SIMULATION_CAMPAIGN" = true ] ; then
- echo "Using simulation campaign!"
- snakemake --cores 2 ../../sim_output/campaign_24.07.0_combined_45files.eicrecon.tree.edm4eic.plots_figures/benchmark_rho_mass.pdf
- cp ../../sim_output/campaign_24.07.0_combined_45files.eicrecon.tree.edm4eic.plots_figures/*.pdf results/your_benchmark/
- cp ../../sim_output/campaign_24.07.0_combined_45files.eicrecon.tree.edm4eic.plots_figures/*.pdf results/dglazier_benchmark/
- else
- echo "Not using simulation campaign!"
- bash benchmarks/your_benchmark/analyze.sh
- cp sim_output/nocampaign/plots_figures/*.pdf results/your_benchmark/
- bash benchmarks/dglazier_benchmark/analyze.sh
- cp sim_output/nocampaign/plots_figures/*.pdf results/dglazier_benchmark/
- fi
- echo "Finished copying!"
2 changes: 1 addition & 1 deletion benchmarks/dglazier_benchmark/reconstruct.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
source strict-mode.sh
source benchmarks/your_benchmark/setup.config $*
source benchmarks/dglazier_benchmark/setup.config $*

# Reconstruct
if [ ${RECO} == "eicrecon" ] ; then
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dglazier_benchmark/simulate.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
source strict-mode.sh
source benchmarks/your_benchmark/setup.config $*
source benchmarks/dglazier_benchmark/setup.config $*

if [ -f ${INPUT_FILE} ]; then
echo "ERROR: Input simulation file does ${INPUT_FILE} not exist."
Expand Down

0 comments on commit 5b0ce94

Please sign in to comment.