Skip to content
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.neighbors: Add parallel support #1654

Closed
wants to merge 9 commits into from

Conversation

aaronsms
Copy link
Contributor

  • Update Makefile
  • Refactor inputs to use pointers
  • Refactor to use segment libraries
  • Add parallel region
  • Add parallel test cases

All input and output variables are transformed into pointers to support parallel execution. There is no change in the underlying algorithm except of the introduction of segmented temporary files to allow for random access write. So the extra memory usage will be scaled according to the number of threads used plus a constant overhead from the usage of segmented files. I think we should introduce a memory parameter to allow users to control the how much memory to be used for the segment. Right now, it is just a fixed constant, which is to be changed.

This PR contains an addition of a test file which contains the parallel version of the original sequential test cases. Upon addition of benchmark script, this will be combined into the original test file to avoid code duplication. On my machine, there is some speedup of ~2x on 4 threads, though this is not accurate without the benchmark.

I am thinking to refactor my code to encapsulate the usage of Segments.

@ninsbl ninsbl added the gsoc Reserved for Google Summer of Code student(s) label Jun 17, 2021
@ninsbl
Copy link
Member

ninsbl commented Jun 17, 2021

Nice!
Could this be coordinated with: #597
Sorry for not having committed before you started on r.neighbors...

@aaronsms
Copy link
Contributor Author

Nice!
Could this be coordinated with: #597
Sorry for not having committed before you started on r.neighbors...

No worries, yeap will incorporate the changes once #597 is merged.

@aaronsms
Copy link
Contributor Author

  • Fix CentOS build fail due to C98 incompatibility (will take note of this in the future)

test_pygrass_modules_interface_doctests.py was failing, I am guessing this has to do with the newly added test cases. 20.04 build fail is incidental, due to connection issues to repository.

@HuidaeCho
Copy link
Member

@aaronsms Please consider using the standard option G_OPT_M_NPROCS introduced in #1644.

@aaronsms
Copy link
Contributor Author

@aaronsms Please consider using the standard option G_OPT_M_NPROCS introduced in #1644.

Noted! Will use that for future modules.

@aaronsms
Copy link
Contributor Author

I will close this PR in favor of #1724.

@aaronsms aaronsms closed this Jul 16, 2021
Raster Parallelization GSoC 2021 automation moved this from In progress to Done Jul 16, 2021
@neteler neteler added this to the 8.0.0 milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc Reserved for Google Summer of Code student(s)
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants