Skip to content

r.mapcalc: Support parallel computing by OpenMP - #20

Closed
cyliang368 wants to merge 88 commits into
mainfrom
parallel_rmapcalc
Closed

r.mapcalc: Support parallel computing by OpenMP#20
cyliang368 wants to merge 88 commits into
mainfrom
parallel_rmapcalc

Conversation

@cyliang368

Copy link
Copy Markdown
Owner

No description provided.

Comment thread raster/r.mapcalc/testsuite/test_r_mapcalc_parallel.py Outdated
Comment thread raster/r.mapcalc/testsuite/test_r_mapcalc_parallel.py Outdated
renovate Bot and others added 28 commits July 15, 2025 21:16
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…SGeo#6070)

Simplified and adapted from  OSGeo#4792.
Fixes OSGeo#6066 (comment)

The action that checks for CRLF has been failing since at least this weekend.
Considering that that action has low chances of beeing fixed in a timely matter, I replaced the functionality with an .editorconfig file and validating against it with editorconfig-checker. Compared to OSGeo#4792, here I don’t attempt to make the line ending changes persist in the repo through .gitattributes, and ignore a bit more of non-ready config sections (since the functionality replaced was less detailed than what the .editorconfig I already had almost working).


I made the pre-commit run always, and made it faster in consequence to not add a big impact. With hot cache, it is taking 1min-1min10, which is about the same. I knew pre-commit could be faster in CI as I already saw how fast it was in ruff’s own CI when submitting one of my PRs there once. It can still be a bit faster, but it’s enough for today.

* CQ: Add initial .editorconfig file with basic settings

* CI: Add EditorConfig validation to super-linter workflow

* CI: Remove CRLF check from additional_checks.yml workflow

* CQ: Add editorconfig-checker to pre-commit config

* CI: Always run pre-commit in CI

* Update .editorconfig with new whitespace settings for mswindows

* CI: Run pre-commit step with uvx

* CI: Add caching for pre-commit checks in workflow

* Update .editorconfig for Windows batch files

* CI: Remove paths-filter step from additional_checks.yml

* Update additional_checks.yml step setup-uv
This adds JSON support to the db.columns module and keeps current output as plain. The JSON output is a list of names just like the plain output (see also discussion in OSGeo#6072 for more metadata).

The following changes are included:

1. Adds a `format` option with `plain`, and `json` modes for output formatting.
2. Adds tests covering each of the new formats.
3. Adds a Python example to the documentation for parsing JSON output.

Closes: OSGeo#6008

---------

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…SGeo#6090)

After comparing the .gitignore files from the main grass repo and the addons repo, I carried over some relevant exclusions here, notably the *.tmp.html exclusions, the whole point of this PR.
… no longer published (OSGeo#5942)

This vendors an updated copy of PLY (Python Lex-Yacc), and removes references indicating that PLY needs to be installed. The author doesn't want to publish newer versions, and believe users should be vendoring their copy of PLY.

The file is kept largely untouched, in order to update the file more easily in the future.


* temporal: Vendor ply dependency par repo's instructions as no longer published

* temporal: Add ply to makefile

* temporal: Remove ply from requirements

* temporal: Use relative ply package in grass.temporal code

* temporal: Create ply subdirectory in makefile

* temporal: Remove checks for ply imports in temporal modules

* temporal: Remove references to ply in manual pages

* checks: Ignore vendored ply from flake8 checks

* checks: Ignore vendored ply from pre-commit checks

* temporal: Remove optimize and nowarn keywords sent to ply.lex as removed in newer version

* temporal: Remove write_tables keyword sent to ply.yacc as removed in newer version

* temporal: Use debug=False for yacc constructor in TemporalOperatorParser

* cmake: Add temporal/ply folder to build

* checks: Ignore pylint in ply code as it is external
…files (OSGeo#6094)

* chore: Add *.tmp.md to .gitignore to exclude temporary markdown files

* chore: Ignore temporary files used in htmldox, latexdox and pdfdox targets
* man: Upgrade html Doxyfile to doxygen 1.9.1 defaults

Using `doxygen -u include/Make/Doxyfile_arch_html.in`

```
warning: Tag 'TCL_SUBST' at line 203 of file 'include/Make/Doxyfile_arch_html.in' has become obsolete.
         This tag has been removed.
warning: Tag 'COLS_IN_ALPHA_INDEX' at line 879 of file 'include/Make/Doxyfile_arch_html.in' has become obsolete.
         This tag has been removed.
warning: Tag 'PERL_PATH' at line 1593 of file 'include/Make/Doxyfile_arch_html.in' has become obsolete.
         This tag has been removed.
warning: Tag 'MSCGEN_PATH' at line 1614 of file 'include/Make/Doxyfile_arch_html.in' has become obsolete.
         This tag has been removed.

Configuration file 'include/Make/Doxyfile_arch_html.in' updated.
```

* man: Upgrade latex Doxyfile to doxygen 1.9.1 defaults

Using `doxygen -u include/Make/Doxyfile_arch_latex.in`

```
warning: Tag 'TCL_SUBST' at line 203 of file 'include/Make/Doxyfile_arch_latex.in' has become obsolete.
         This tag has been removed.
warning: Tag 'COLS_IN_ALPHA_INDEX' at line 879 of file 'include/Make/Doxyfile_arch_latex.in' has become obsolete.
         This tag has been removed.
warning: Tag 'PERL_PATH' at line 1593 of file 'include/Make/Doxyfile_arch_latex.in' has become obsolete.
         This tag has been removed.
warning: Tag 'MSCGEN_PATH' at line 1614 of file 'include/Make/Doxyfile_arch_latex.in' has become obsolete.
         This tag has been removed.

Configuration file 'include/Make/Doxyfile_arch_latex.in' updated.
```
In the generated example for each tool, use the first allowed value from the list of allowed values in the options field. This can be done for strings only because numbers may have ranges in the options field. Before, simply the type, i.e., string would be printed unless key_desc was defined. For r.series, this is replacing 'string' by 'average' as a value for method in the example.

Apply the same to Python and CLI and sync CLI to Python which adds the fallback number values to CLI example.
Instead of checking input and file presence and absence manually, this uses parser rules for options.

As a result, the generated example at the top of r.series documentation will have input instead of skipping both input and file.
…elization (OSGeo#6087)

This gets rid of static variables from the r.mapcalc functions for mode and median. The static variables were there to not allocate for every row, but it complicates parallelization since that can't generally be done in parallel with static variables, see OSGeo#5742. Since the size of the array is typically very small (the number of arguments of the median() or mode() function, can be raster or number), it will use array on stack and allocate only for larger sizes.

It may be slower due to more stack or heap needed, but it might be faster for cases within the threshold (using heap allocated memory instead of realloc). In any case, it will reliably work with parallelization. General solution would be using a context, but that would require a large change.
@cyliang368 cyliang368 closed this Jul 29, 2025
@cyliang368
cyliang368 deleted the parallel_rmapcalc branch July 29, 2025 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.