Skip to content

Commit 1bcf99a

Browse files
authored
r.grow: Expose r.mapcalc's nprocs (#6585)
One of the two steps in r.grow is using r.mapcalc. This allows user to control the number of cores used by r.mapcalc in that step (#5742). This is more critical with the default being all cores (#5731) even if the impact is possibly limited given that the main step is not parallelized. This depends on #6580 for the nprocs parameter in the gs.mapcalc function.
1 parent 47cb045 commit 1bcf99a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/r.grow/r.grow.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
# % multiple: no
6060
# % description: Value to write for "grown" cells
6161
# %end
62+
# %option G_OPT_M_NPROCS
63+
# %end
6264

6365
import os
6466
import atexit
@@ -83,6 +85,7 @@ def main():
8385
metric = options["metric"]
8486
old = options["old"]
8587
new = options["new"]
88+
nprocs = options["nprocs"]
8689
mapunits = flags["m"]
8790

8891
tmp = str(os.getpid())
@@ -146,6 +149,7 @@ def main():
146149
old=old,
147150
new=new,
148151
dist=temp_dist,
152+
nprocs=nprocs,
149153
)
150154
else:
151155
# shrink
@@ -167,6 +171,7 @@ def main():
167171
radius=radius,
168172
old=old,
169173
dist=temp_dist,
174+
nprocs=nprocs,
170175
)
171176

172177
gs.run_command("r.colors", map=output, raster=input)

0 commit comments

Comments
 (0)