grass-addons icon indicating copy to clipboard operation
grass-addons copied to clipboard

r.accumulate: Add parallelization

Open shreyasudaya opened this issue 1 year ago • 2 comments

OpenMP parallelization added. To do: Test timing and parallelization. This along with r.horizon is where I am confused about testing.

shreyasudaya avatar Dec 07 '23 09:12 shreyasudaya

@shreyasudaya Have you actually compiled and tested your parallelized code? Parallelization was not in my mind at all when I first wrote this module and I'm not so sure if simply adding parallel for loops will correctly parallelize all the algorithms. Just tested this PR and I wasn't able to compile it:

calculate_lfp_iterative.c: In function ‘calculate_lfp_iterative’:
calculate_lfp_iterative.c:79:52: error: ‘j’ undeclared (first use in this function)
   79 | #pragma omp parallel for schedule(dynamic) private(j)
      |                                                    ^
calculate_lfp_iterative.c:79:52: note: each undeclared identifier is reported only once for each function it appears in

j is declared inside the for loop and isn't visible to OMP outside of it.

HuidaeCho avatar Dec 07 '23 19:12 HuidaeCho

@HuidaeCho, would you have any suggestion for a different tool that could be easier to implement parallelization for? I don't think there are many low hanging fruits, but maybe v.surf.idw?

petrasovaa avatar Dec 07 '23 20:12 petrasovaa

Closing this PR.

HuidaeCho avatar May 14 '24 23:05 HuidaeCho