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.flowaccumulation: Add a new addon that implements the Memory-Efficient Flow Accumulation parallel algorithm (Cho 2023) #954

Merged
merged 9 commits into from
Oct 17, 2023

Conversation

HuidaeCho
Copy link
Member

@HuidaeCho HuidaeCho commented Oct 15, 2023

This PR adds a new addon for fast parallel flow accumulation using OpenMP. It implements https://doi.org/10.1016/j.envsoft.2023.105771. Ported from https://github.com/HuidaeCho/mefa.

Benchmark against r.accumulate (28.216s vs. 50.181s) for 30m DEM for Texas on i7-1370P CPU with 64GB RAM
image

$ time r.accumulate direction=drain accumulation=accum_old
Input direction format assumed to be degrees CCW from East divided by 45
Reading direction map...
 100%
Allocating buffers...
 100%
Accumulating flows iteratively...
 100%
Writing accumulation map...
 100%

real    0m50.181s
user    0m46.074s
sys     0m3.938s

$ time r.flowaccumulation input=fdr output=accum_new 
Using 20 threads for parallel computation
Reading flow direction raster <fdr>...
Flow direction format assumed to be powers of 2 CW from East
 100%
Input time for flow direction: 6.835615 seconds
Accumulating flows...
Compute time for flow accumulation: 3.490350 seconds
Writing flow accumulation raster <accum_new>...
 100%
Output time for flow accumulation: 17.872626 seconds
Total elapsed time: 28.198680 seconds

real    0m28.216s
user    1m14.207s
sys     0m6.489s

@HuidaeCho HuidaeCho added new addon PR contains a new addon or issue proposes one C Related code is in C labels Oct 15, 2023
@HuidaeCho HuidaeCho changed the title r.accum: Add a new addon that implements the Memory-Efficient Flow Accumulation parallel algorithm (Cho 2023) r.flowaccumulation: Add a new addon that implements the Memory-Efficient Flow Accumulation parallel algorithm (Cho 2023) Oct 15, 2023
@HuidaeCho HuidaeCho merged commit 4d16fa7 into grass8 Oct 17, 2023
12 checks passed
@HuidaeCho HuidaeCho deleted the raccum branch October 17, 2023 00:57
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 new addon PR contains a new addon or issue proposes one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants