-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use queue instead of stack #22
Comments
@dpsanders Can you please point me to the place in the codebase this needs to be changed? |
This refers to the data structure used to store the boxes as they are
processed, and in particular the order in which they are processed.
Currently they are placed onto the vector with push! and removed with pop!
(?) which gives a stack (last in, first out).
This comment was along the lines of using a queue instead (first in, first
out).
…On Thu, 8 Mar 2018, 9:29 am Eeshan Gupta, ***@***.***> wrote:
@dpsanders <https://github.com/dpsanders> Can you please point me to the
place in the codebase this needs to be changed?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALtTkIlTUOqwUhy7_rJ6utcccxJUVImks5tcU5MgaJpZM4OGI1V>
.
|
This gives breadth-first vs depth-first search of the tree of boxes that gets created. |
I think we should decide what the desired outcome of each strategy is. memory In many cases depth-first strategy should be more memory efficient because after an interval is bisected its sub intervals are immediately pruned and quickly vanish from memory. A breadth-first search would bisect many intervals before eventually pruning their sub intervals, leading to potentially large fluctuations in queue size. time Both strategies should have identical speed on a single process. However, depth-first will find Roots more periodically throughout the iteration, whereas breadth-first will find most roots close to the end of iteration. parallelism However, a breadth-first strategy might be useful for a parallelized implementation. In that model work intervals should be bisected as early as possible to fill a task queue which can feed many worker processes. (Of course it would also look very nice in a visualization to watch intervals split, vanish and shrink in parallel. But aesthetics are probably irrelevant to most users.) Did I miss something? |
Thanks, that sounds like a good analysis. I think I was thinking more for optimization, where I think that breadth-first should be better. |
I was thinking about #59 and I realized that in the case of an accumulation of many zeros (for example with
Ideally both should be implemented, and it may be possible to even allow the user to provide a function to choose the next interval to be bisected (as a parameter of the |
I am currently working on this (I let you know to avoid the work being done twice). In fact I am trying to implement something more general, where the user can provide a data structure (currently we use |
It might be more user friendly to provide a set of specific strategies, rather than an abstract interface. (Of course an internal abstraction layer could still make sense.) I think a new dependency on DataStructures.jl would make that very simple. |
Fixed by the introduction of |
No description provided.
The text was updated successfully, but these errors were encountered: