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.horizon: Support parallel computing for the raster mode by OpenMP #3890

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

cyliang368
Copy link
Contributor

This PR parallelizes r.horizon module by OpenMP and creates parallelization benchmarks. It was tested on my fork repository (cyliang368#10).

@cyliang368
Copy link
Contributor Author

cyliang368 commented Jun 18, 2024

r.horizon runs in two modes (point mode and raster mode). The raster mode requires calculation across every cell in the raster in the given area, which can be greatly improved by parallelization.

The point mode is multithreading for multi-directions. The point mode is highly serialized, especially when only a point and a direction are specified. The new_point function runs step by step accumulatively, so it is hard to parallelize it. Since it just does a small amount of computations, so I didn't parallelize it (r.horizon for 1 point & 1 direction the point mode is still serial).

The figures below show that running the point mode (1 point, 1 direction) takes around 100 times less time than the raster mode. Parallelization won't significantly benefit this. In conclusion, I will leave it serial now and work on other heavy computing modules.

r_horizon_point_time
r_horizon_raster_time

@cyliang368 cyliang368 changed the title r.horizon: support parallel computing by OpenMP Jun 18, 2024
@github-actions github-actions bot added raster Related to raster data processing Python Related code is in Python C Related code is in C module tests Related to Test Suite HTML Related code is in HTML docs labels Jun 18, 2024
@cyliang368 cyliang368 changed the title r.horizon: Support parallel computing by OpenMP Jun 22, 2024
@cyliang368 cyliang368 marked this pull request as draft June 22, 2024 03:35
@cyliang368 cyliang368 marked this pull request as ready for review June 22, 2024 12:34
@cyliang368 cyliang368 marked this pull request as draft June 29, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C docs HTML Related code is in HTML module Python Related code is in Python raster Related to raster data processing tests Related to Test Suite
2 participants