-
Notifications
You must be signed in to change notification settings - Fork 59
Grainsize calculation on TinyThreads #142
Copy link
Copy link
Closed
Description
| std::vector<IndexRange> splitInputRange(const IndexRange& range, |
I was working fine with TBB in my app on Windows, defining the grainsize, but I got problems when porting to Linux and using TinyThreads. So I looked at the code.
Here I can see that, if I have a vector of size 767, and I set the grainsize to 64 I get the following:
- Total threads is
8 - So,
767/8is not exact, and the algorithm chooses to do767/(8-1) ~= 109 - So each chunk will be of size
109. That is fine for my algorithm that needs a chunk larger than, let's say,60. - There will be
767 / 109 = 7.0366jobs. That means one job will be of size4that is below my grainsize of64. And this will break my algorithm.
So, what about the last chunk to be of size 113 instead of 109 + 4? This will be in conformity with what is expected from grainsize.
I can write a pull request. For now, I'm just discussing the case.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels