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 c1e4c2f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 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_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
Basic TARDIS Benchmark.
"""

from asv_runner.benchmarks.mark import parameterize, skip_benchmark

import tardis.transport.montecarlo.interaction as interaction
from benchmarks.benchmark_base import BenchmarkBase
from tardis.transport.montecarlo.numba_interface import (
LineInteractionType,
)


@skip_benchmark

class BenchmarkMontecarloMontecarloNumbaInteraction(BenchmarkBase):
"""
Class to benchmark the numba interaction function.
Expand Down
1 change: 0 additions & 1 deletion benchmarks/transport_montecarlo_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def time_move_packet_across_shell_boundary_emitted(self, parameters):
packet, delta_shell, no_of_shells
)

@skip_benchmark
@parameterize(
{
"Parameters": [
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 c1e4c2f

Please sign in to comment.