Skip to content

Commit

Permalink
Benchmark run_tardis with track_rpacket enabled (#2720)
Browse files Browse the repository at this point in the history
* Benchmark run_tardis with track_rpacket enabled

* Update config to resemble time_run_tardis config

* Fix Benchmark error

* Cache Benchmark Property

* Remove Cached Property decorator
  • Loading branch information
Sumit112192 authored Jul 31, 2024
1 parent 9339cd2 commit c57d74d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions benchmarks/benchmark_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ def tardis_config_verysimple(self):
YAMLLoader,
)

@property
def config_rpacket_tracking(self):
config = Configuration.from_yaml(
f"{self.example_configuration_dir}/tardis_configv1_verysimple.yml"
)
config.montecarlo.tracking.track_rpacket = True
return config

@property
def tardis_ref_path(self):
# TODO: This route is fixed but needs to get from the arguments given in the command line.
Expand Down
8 changes: 8 additions & 0 deletions benchmarks/run_tardis.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from benchmarks.benchmark_base import BenchmarkBase
from tardis import run_tardis


class BenchmarkRunTardis(BenchmarkBase):
"""
Class to benchmark the `run tardis` function.
Expand All @@ -16,3 +17,10 @@ def time_run_tardis(self):
atom_data=self.atomic_dataset,
show_convergence_plots=False,
)

def time_run_tardis_rpacket_tracking(self):
run_tardis(
self.config_rpacket_tracking,
atom_data=self.atomic_dataset,
show_convergence_plots=False,
)

0 comments on commit c57d74d

Please sign in to comment.