GRASS GSoC 2026 Parallelizing r.proj and Raster Processing Modules in GRASS
| Student Name | Kaushik Raja |
| Organization | NumFOCUS |
| Mentor Name | Huidae Cho, Anna Petrasova, Vaclav Petras |
| GitHub Fork | View Repo |
| LinkedIn Profile | View LinkedIn |
Abstract
r.proj is one of the most commonly used modules in GRASS. It reprojects raster maps between coordinate systems. It has always been single threaded, so on modern multi core hardware most CPU cores sit idle and large reprojections take longer than they need to.
This project parallelizes r.proj and r.param.scale using OpenMP, with r.geomorphon planned as a third module. The two main obstacles are memory and the PROJ library. A naive parallel version holds the entire input map in RAM, which does not scale to large maps, and PROJ transformation objects cannot be shared between threads. The approach here processes the output map in horizontal bands sized to stay under a user controlled memory cap. For strongly tilted projections where even a single row of output needs more input than the cap allows, each band is further split into smaller column sections until every piece fits. Reading the input and computing the reprojection both run in parallel, with each thread using its own file descriptor and its own PROJ context, while the output is still written in row order so the result is exactly identical to the serial module.
r.param.scale, a terrain analysis module, was parallelized with the same memory bounded idea. Its sequential sliding window was replaced with a two level band and chunk design that honors the memory option. During that work a long standing data race was found in the GRASS math library and fixed. Together these changes give future GRASS contributors a reusable pattern for parallelizing raster modules under a memory constraint.
Project Scope
- Parallelize r.proj with a memory bounded band design and a user controlled memory option
- Split bands into column sections for tilted projections that do not fit the memory cap at full width
- Give each thread its own PROJ context through new gproj library functions
- Parallelize input reading with per thread file descriptors
- Parallelize r.param.scale with a band and chunk design that honors the memory option
- Find and fix the data race in G_ludcmp in the GRASS math library
- Verify every parallel version produces output exactly identical to the serial version
- Benchmark all modules across thread counts
- Parallelize r.geomorphon as a third module
- Document all parallelized modules
Timeline
| Period | Timeline | Tasks | Status |
|---|---|---|---|
| Community Bonding Period | May 1 - May 25 |
|
Done |
| Official Coding Period | May 25 - June 8 |
|
Done |
| June 9 - June 22 |
|
Done | |
| June 23 - July 6 |
|
Done | |
| July 7 - July 11 |
|
Done | |
| July 20 - August 3 |
|
In progress | |
| August 4 - August 11 |
|
||
| August 12 - August 18 |
|
||
| Final Week | August 19 - August 26 |
|
Reports
Community Bonding Period
Coding Period
Log of Pull Requests
- PR #7440 - r.param.scale parallelization and G_ludcmp race fix, ready for review
- PR #7627 - r.proj parallelization with memory bounded bands, in review
- Issue #7539 - G_ludcmp data race report
- PR #7185 - r.proj proof of concept, closed in favor of #7627
- PR #7236 - r.param.scale proof of concept, closed in favor of #7440