From c4ac4672c7d6a51fd9060c404d5fe4939f099ffc Mon Sep 17 00:00:00 2001 From: ninsbl Date: Fri, 11 Sep 2026 13:43:37 +0200 Subject: [PATCH 1/3] deliberately set nprocs --- python/grass/temporal/aggregation.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/python/grass/temporal/aggregation.py b/python/grass/temporal/aggregation.py index 6a1bf62cd14..03a2ed13b78 100644 --- a/python/grass/temporal/aggregation.py +++ b/python/grass/temporal/aggregation.py @@ -113,7 +113,17 @@ def collect_map_names(sp, dbif, start, end, sampling): def aggregate_raster_maps( - inputs, base, start, end, count: int, method, register_null, dbif, offset: int = 0 + inputs, + base, + start, + end, + count: int, + method, + register_null, + dbif, + offset: int = 0, + *, + nprocs: int = 0, ): """Aggregate a list of raster input maps with r.series @@ -130,6 +140,7 @@ def aggregate_raster_maps( time raster dataset, if false not :param dbif: The temporal database interface to use :param offset: Offset to be added to the map counter to create the map ids + :param nprocs: Number of cores to use for processing (0 means use all available cores) """ msgr = get_tgis_message_interface() @@ -174,6 +185,7 @@ def aggregate_raster_maps( if len(inputs) > 1000: gs.run_command( "r.series", + nprocs=nprocs, flags="z", file=filename, output=output, @@ -183,6 +195,7 @@ def aggregate_raster_maps( else: gs.run_command( "r.series", + nprocs=nprocs, file=filename, output=output, overwrite=gs.overwrite(), @@ -271,6 +284,7 @@ def aggregate_by_topology( r_series = pymod.Module( "r.series", output="spam", + nprocs=1, method=[method], overwrite=overwrite, quiet=True, From c726d07ef900fdd5d8922fb818d61a610e2941ec Mon Sep 17 00:00:00 2001 From: ninsbl Date: Sat, 12 Sep 2026 00:37:13 +0200 Subject: [PATCH 2/3] limit r.univar to nprocs=1 --- python/grass/temporal/univar_statistics.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/grass/temporal/univar_statistics.py b/python/grass/temporal/univar_statistics.py index 4f70010c000..97d4fdc7005 100755 --- a/python/grass/temporal/univar_statistics.py +++ b/python/grass/temporal/univar_statistics.py @@ -263,6 +263,7 @@ def print_gridded_dataset_univar_statistics( percentile=percentile, stdout_=PIPE, format="json" if format == "json" else "csv", + nprocs=1, quiet=True, run_=False, ) From ca59d35ee5a196c17eccab182c92494cc30813d6 Mon Sep 17 00:00:00 2001 From: ninsbl Date: Sat, 12 Sep 2026 17:58:28 +0200 Subject: [PATCH 3/3] use nprocs only for r.univar, not r3.univar --- python/grass/temporal/univar_statistics.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/grass/temporal/univar_statistics.py b/python/grass/temporal/univar_statistics.py index 97d4fdc7005..2266a902911 100755 --- a/python/grass/temporal/univar_statistics.py +++ b/python/grass/temporal/univar_statistics.py @@ -60,6 +60,9 @@ def compute_univar_stats( if stats_module.name == "r3.univar" or not registered_map_info["semantic_label"] else registered_map_info["semantic_label"] ) + # Only r.univar, not r3.univar has nprocs parameter + if stats_module.name == "r.univar": + stats_module.inputs.nprocs = 1 stats_module.inputs.map = id if rast_region and (stats_module.inputs.zones or stats_module.name == "r3.univar"): @@ -263,7 +266,6 @@ def print_gridded_dataset_univar_statistics( percentile=percentile, stdout_=PIPE, format="json" if format == "json" else "csv", - nprocs=1, quiet=True, run_=False, )