Skip to content

Commit

Permalink
update benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumit112192 committed Jul 27, 2024
1 parent 49c0ca6 commit f04bb84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion benchmarks/benchmark_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
from tardis.transport.montecarlo.packet_collections import (
VPacketCollection,
)
from tardis.transport.montecarlo.packet_trackers import RPacketTracker
from tardis.transport.montecarlo.packet_trackers import (
RPacketTracker,
RPacketLastInteractionTracker,
generate_rpacket_last_interaction_tracker,
)


class BenchmarkBase:
Expand Down Expand Up @@ -414,3 +418,8 @@ def estimators(self):
stim_recomb_cooling_estimator=np.empty((0, 0), dtype=np.float64),
photo_ion_estimator_statistics=np.empty((0, 0), dtype=np.int64),
)

@property
def rpacket_tracker(self):
no_of_packets = len(self.transport_state.packet_collection)
return generate_rpacket_last_interaction_tracker_list(no_of_packets)
2 changes: 1 addition & 1 deletion benchmarks/transport_montecarlo_main_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def time_montecarlo_main_loop(self):
self.montecarlo_configuration,
self.transport_state.radfield_mc_estimators,
self.nb_simulation_verysimple.transport.spectrum_frequency_grid.value,
self.transport_state.rpacket_tracker,
self.rpacket_tracker,
self.montecarlo_configuration.NUMBER_OF_VPACKETS,
iteration=0,
show_progress_bars=False,
Expand Down

0 comments on commit f04bb84

Please sign in to comment.