-
-
Notifications
You must be signed in to change notification settings - Fork 361
r.mapcalc: Support parallel computing by OpenMP #5742
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
NOTE: this is not valid benchmark beyond 4 cores, see the one below I ran a benchmark on my desktop and it looks very good! I compared different data size and complexity of expression: My machine info:
Overall I don't see any slow down with more cores as @cyliang368 showed me before, so it may behave differently on different machines. I will do more testing but this looks very promising! To clarify the plots, 'simple' means A+B, complex is |
So, in the tests you ran, there's not much benefit after 4 cores. Does it apply to everything, or just the expressions tested? |
I suspect much larger data and more complex expression (like with eval function), we would see benefit with couple more cores. But most parallel tools in GRASS in my experience behave like that. |
This reminds me of a similar behavior I observed while running benchmarks for Overall, I think the benchmarks from @petrasovaa 's machine look good. I will add notes and these benchmarks to the document when I have time. |
So I needed to run new benchmarks because I missed the fact that the code was already constrained to 4 cores max... So I removed locally the restriction and luckily the new results are not that much different: Based on this I would suggest to not constrain it, there may be some slow down for simple expressions, but it doesn't look that significant. Also, the more complex expression was able to take advantage of more than 4 cores. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Hm, I meant to test it on my fork, but apparently pushed it here... |
It looks like |
My guess is, it is connected to using static variables: On my fork I removed the reallocation so it allocates every time and the tests are running now. If that's indeed the cause the question is how to deal with that, @HuidaeCho, @cyliang368 any idea? I assume the constant allocation would slow it down. Maybe there could be a smarter way to allocate it. |
I haven't had a good idea about this error, which only occurs on Windows, now. 😢 |
This PR parallelizes a part of the r.mapcalc module using OpenMP. Note that raster3d is still not parallelized yet.