Skip to content

Commit

Permalink
RoundRobinPointQueue: remove prints, reduce memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesBuchner committed Jan 27, 2025
1 parent 0d1784d commit eb2d30c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ultranest/netiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ class RoundRobinPointQueue:
then extracting them in order.
"""

def __init__(self, udim, pdim, chunksize=1000):
def __init__(self, udim, pdim, chunksize=100):
"""Set up point pile.
Parameters
Expand Down Expand Up @@ -514,7 +514,6 @@ def add_many(self, newpointu, newpointp, newpointL, newquality, newrank):
n_needed = len(newpointL)
if n_available < n_needed:
# grow space
print("RoundRobinPointQueue: growing space", n_available, n_needed, self.us.shape)
self.us = np.concatenate((self.us, np.zeros((self.chunksize, self.udim))))
self.ps = np.concatenate((self.ps, np.zeros((self.chunksize, self.pdim))))
self.Ls = np.concatenate((self.Ls, np.zeros(self.chunksize)))
Expand All @@ -530,7 +529,6 @@ def add_many(self, newpointu, newpointp, newpointL, newquality, newrank):
assert newpointu.shape[1] == self.us.shape[1], (newpointu.shape, self.us.shape)
assert newpointp.shape[1] == self.ps.shape[1], (newpointp.shape, self.ps.shape)
i = np.where(~self.filled)[0][:n_needed]
print("RoundRobinPointQueue: inserting at:", i)
self.us[i, :] = newpointu
self.ps[i, :] = newpointp
self.Ls[i] = newpointL
Expand Down

0 comments on commit eb2d30c

Please sign in to comment.