Skip to content

Commit

Permalink
benchmark single packet loop
Browse files Browse the repository at this point in the history
Signed-off-by: Asish Kumar <[email protected]>
  • Loading branch information
officialasishkumar committed Jul 9, 2024
1 parent a245a7d commit 7c8c362
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions benchmarks/benchmark_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from tardis.transport.montecarlo.packet_collections import (
VPacketCollection,
)
from tardis.transport.montecarlo.packet_trackers import RPacketTracker


class BenchmarkBase:
Expand Down Expand Up @@ -361,8 +362,8 @@ def montecarlo_configuration(self):
return montecarlo_configuration.MonteCarloConfiguration()

@property
def rpacket_tracker(self):
return self.simulation_rpacket_tracking_enabled.transport.transport_state.rpacket_tracker
def rpacket_tracker(self):
return RPacketTracker(0)

@property
def transport_state(self):
Expand Down
4 changes: 1 addition & 3 deletions benchmarks/transport_montecarlo_single_packet_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@

from benchmarks.benchmark_base import BenchmarkBase
from tardis.transport.montecarlo import single_packet_loop
from asv_runner.benchmarks.mark import skip_benchmark


class BenchmarkMontecarloMontecarloNumbaVpacket(BenchmarkBase):
"""
Class to benchmark the single packet loop function.
"""

@skip_benchmark
def time_single_packet_loop(self):
single_packet_loop.single_packet_loop(
self.packet,
self.verysimple_numba_radial_1d_geometry,
self.verysimple_time_explosion,
self.verysimple_opacity_state,
self.estimators,
self.verysimple_packet_collection,
self.verysimple_3vpacket_collection,
self.rpacket_tracker,
self.montecarlo_configuration
)

0 comments on commit 7c8c362

Please sign in to comment.