-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
r.patch: implement parallelization with OpenMP #1782
Conversation
|
||
int computed = 0; | ||
int written = 0; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
row = 0;
to avoid
main.c:250:5: warning: ‘row’ may be used uninitialized in this function [-Wmaybe-uninitialized]
G_percent(row, nrows, 2);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap fixed it! Supposed to be G_percent(nrows, nrows, 2)
.
Please add a test script. |
ff5cc9c
to
c877dad
Compare
Compiling with GCC gives:
|
This will also need a update/rebase/merge with the main branch because there is a new flake8 job expected which needs to be completed before the merge to main can happen. |
b999e1e
to
f4bd1c4
Compare
I have fixed the compilation issues as well as rebased to the main branch. |
Here is a benchmark patching multiple tiles in 16 bil raster: @aaronsms Any idea why the memory has no effect? |
The result is interesting, I should expect the 4000MB should not be worse than 300MB at the very least (is it possible to run in between 300MB and 4000MB?). The memory option allows user to choose the amount of memory to allocate to enable parallelism, but it does not always improve the performance, as long as it is not below some level of memory, where the chunk size gets too small and the threads start waiting for each other. This begs the question: is the memory option then needed, if it turns out that even at very large files (16B), this optimal threshold of memory does not grow very large, then since the user should expect to use 200/300 MB anyway, perhaps that can be hidden from the user? Initially, the memory option is added because the initial implementation use close to nothing memory, but to enable parallelism, we need to start using the memory, and currently we are allowing the users to choose that amount. |
For memory=0, it auto sets to the bare minimum required for it to work, which is the number of threads * 1 row. |
2f0276a
to
9d60c5b
Compare
Checklists before merging: