-
-
Notifications
You must be signed in to change notification settings - Fork 295
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.mfilter: implement parallelization with OpenMP #1708
Conversation
c5911b9
to
d11db3c
Compare
|
The previous workflow run has all passsing checks, except for OSGeo4W, where the download link is no longer available. |
d11db3c
to
74eb924
Compare
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.
Code looks OK. I only could not run some tests as I don't have "slope" map – would be nice to replace with one present in the basic version of NC location.
| filter = self.create_filter(self.filter_options["sequential"]) | ||
| self.assertModule( | ||
| "r.mfilter", | ||
| input="slope", |
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.
My version of nc_basic_spm_grass7 location does not have a slope map. Can it be replaced with something else to allow testing on a basic location?
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.
@aaronsms Slope is missing in the basic location. It can be a good idea to use the basic location for writing test scripts.
@marisn Any specific reasons why you don't (cannot?) use the full nc_spm_08_grass7?
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.
I will replace 'slope' with 'lakes'.
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.
Why not elevation?
|
I tested it with bigger data and it crashes with |
@aaronsms Please check nprocs=1 code again. In this case, I think we need to revert back to the original behavior for nprocs=1. I thought we're not creating more tempfiles for r.mfilter, but are they bigger now even for nrpcos=1? |
|
Also, I ran it with valgrind and it gave me one error, and although it didn't look too related as far as I remember, it's worth checking that. |
74eb924
to
5ff8b6b
Compare
For r.mfilter, we are not changing the default behavior. The original one uses a temporary file as buffer as well.
@petrasovaa, can I clarify that whether you meant, it works with the mentioned two cases or, you achieve different results with (nprocs = 1 vs = 2)? Also, may I also ask at what cell count did it crash with the |
|
Currently, I have found some issues when grass is compiled without OpenMP, will follow up soon. But I haven't found issues with the one compiled with OpenMP. |
16.832.104.560 cells and nprocs=1 With just 1.000.000 cells everything worked, although I haven't looked at the resulting raster closely. |
1b95fdf
to
05cca82
Compare
|
@petrasovaa I have solved the overflow issues, so it should now work for larger raster map as per previous behavior. |
05cca82
to
035390c
Compare
Hi @petrasovaa, I was wondering if I can make use of this benchmark result for the twitter post to show the result on large map? Thanks. |
3f12285
to
84f1ca5
Compare
84f1ca5
to
3dfdf0e
Compare
3dfdf0e
to
9b1e32d
Compare
For r.mfilter, the original behavior is we use at most 2 temp files for processes requiring 2 or more sequential filters. This PR maintains that behavior of using temp files. I think there can be improvements from r.neighbor that would be relevant here (similar approach but will change the current behavior), e.g., if the users want to use memory instead of disk. For example, if a chunk of memory is used, then we can propagate from start all the way to finish, before moving on to the next chunk. Could be worth exploring, then it would remove the need for temp files altogether. |
|
Thanks for replying, now I remember I ran into this before. Since this was the original behavior, I plan to merge this as it is now. |
|
I updated manual page with performance section, not sure if there is something else that needs to go in there. |
Very good idea! Another keyword might be |
👍 |
Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Co-authored-by: Anna Petrasova <kratochanna@gmail.com>




Checklists before merging: