-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add utility methods to parallelize over blocks #53
Conversation
#40 is also relevant for this, in particular for |
@imglib/admins please comment |
Sounds reasonable but in practice I always needed more. We should have a look at this class |
- Rename `BlockOffsets` to `Grids` to be closer to imglib2 namespace (`CellGrid` etc) - Add tests (detected a bug for min != 0) - new convenience methods for: - retrieving complete intervals (instead of just min) - retrieving complete intervals and position within cell grid
We should still consider moving the |
I had a more common use case like this: void forEachOffset( long[] min, long[] max, int[] step, Consumer< long[] > doAtOffset ); This can be generalized to allow for use with |
… grid. This addresses the conversation in #53
Any comments/objections against a merge? I would like to go ahead and merge this. |
@imglib/admins if there are no further objections or comments, I will go ahead and merge this PR. |
This commits adds
ParallelizeOverBlocks.parallelize
- parallelize a task over blocks and return futuresParallelizeOverBlocks.parallelizeAndWait
- parallelize a task over blocks and wait for the resultwith various signatures. The three signatures are distingished by the way the blocks for parallelization are specified:
Interval interval
,int[] blockSize
long[] min
,long[] max
,int[] blockSize
List< Interval > blocks
This is a common pattern that I have used multiple times and I think that imglib2-algorithm is the adequate package for such methods.
BlockOffsets.java
contains helper methods for generating lists of blocks from intervals and block sizes.