[GRASS-git] [OSGeo/grass] c80cbf: r.param.scale: parallelize with OpenMP (#7440)

Kaushik Raja noreply at github.com
Thu Jul 16 23:48:01 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: c80cbf1f6721ac35724fa5a8a480c5a11c2145eb
      https://github.com/OSGeo/grass/commit/c80cbf1f6721ac35724fa5a8a480c5a11c2145eb
  Author: Kaushik Raja <85415462+krcoder123 at users.noreply.github.com>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M lib/gmath/lu.c
    M raster/CMakeLists.txt
    M raster/r.param.scale/Makefile
    A raster/r.param.scale/benchmark/benchmark_r_param_scale_nprocs.py
    M raster/r.param.scale/close_down.c
    M raster/r.param.scale/find_normal.c
    M raster/r.param.scale/interface.c
    M raster/r.param.scale/main.c
    M raster/r.param.scale/open_files.c
    M raster/r.param.scale/param.h
    M raster/r.param.scale/process.c
    M raster/r.param.scale/r.param.scale.md
    M raster/r.param.scale/tests/r_param_scale_test.py

  Log Message:
  -----------
  r.param.scale: parallelize with OpenMP (#7440)

Instead of giving each thread a strip with the whole map, there's now an outer loop over a band of rows, and the work inside each band is split across the threads. Each thread keeps a small ring buffer of wsize rows and rotates it as it goes, reading a new row from disk per output row. So, a thread's input memory only depends on the window height, not the size of the map.

Memory is now limited by the usual memory= option, which sets how many rows are
in a band. A single shared output buffer for the band replaces each row having an allocation and row pointer arrays for the whole map. 

I also reworked find_obs() to precompute the window coordinates once and reuse
w*z across the six weighted sums. This does less floating-point work per cell and
the output is bit-identical to before.
---------

Co-authored-by: Edouard Choinière <27212526+echoix at users.noreply.github.com>
Co-authored-by: Anna Petrasova <kratochanna at gmail.com>
Co-authored-by: Nicklas Larsson <n_larsson at yahoo.com>



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list