Skip to content

Commit

Permalink
Added documentation for parallel fixes for estimators (#2233)
Browse files Browse the repository at this point in the history
* Added documentation for parallel fixes for estimators

* run black

* remove comment
  • Loading branch information
1e9abhi1e10 authored Apr 3, 2023
1 parent 3174757 commit 21e86c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tardis/montecarlo/montecarlo_numba/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,14 @@ def montecarlo_main_loop(
)
rpacket_trackers.append(RPacketTracker())

# Get the ID of the main thread and the number of threads
main_thread_id = get_thread_id()
n_threads = get_num_threads()

estimator_list = List()
for i in range(n_threads): # betting get tid goes from 0 to num threads
# Note that get_thread_id() returns values from 0 to n_threads-1,
# so we iterate from 0 to n_threads-1 to create the estimator_list
estimator_list.append(
Estimators(
np.copy(estimators.j_estimator),
Expand Down

0 comments on commit 21e86c4

Please sign in to comment.