Skip to content

gegl: Don't exceed arbitrary maximum number of threads

Simon McVittie requested to merge wip/max-threads into master

gegl has an arbitrary maximum value for GeglConfig:threads, currently 64, and exceeding it causes critical warnings. This can make the build-time tests fail on massively parallel hardware. For example, on a dual POWER8 system used to build Debian ppc64el packages (2 CPUs, 10 cores per CPU and 8 threads per core, for a total of 160 threads), we ask gegl to use 80 threads, which is more than 64.

The simple approach to this would be to clamp to the range [1, GEGL_MAX_THREADS], but this would not be robust against possible future changes to the value of GEGL_MAX_THREADS, so this commit introspects the property to find out the true maximum at runtime.

Bug-Debian: https://bugs.debian.org/976932


The Debian developer who reported this has confirmed that this change is enough to fix the test failure.

It would maybe be better if GeglConfig made the property unconstrained, and clamped its value to the required range in the set_property callback instead; please report a gegl issue if you think that's what needs to happen.

Edited by Simon McVittie

Merge request reports