OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
830 stars 302 forks source link

QGIS r.sun.insoltime is CPU locked? #3487

Open Case2903 opened 6 months ago

Case2903 commented 6 months ago

Hello,

I am trying to run r.sun for a large project, the process is very slow and it runs on CPU only. Is there a way to speed up the process? maybe enabling GPU for processing. is this possible or is this kind of algorithm CPU locked?

veroandreo commented 6 months ago

Are you running it within QGIS? AFAIK, not all module options seem to be enabled there.

Note that the native GRASS GIS r.sun command has the nprocs options that allows to set a number of parallel processes and the npartitions option to split the data in chunks.

neteler commented 6 months ago

Yes, CPU parallelization based on openMP has been available for some time in r.sun.

However, in the QGIS wrapper script r.sun.insoltime.txt the parameter "nproc" is yet missing. It would be sufficient to (locally) add this line, so in your local installation you could simply add it:

*QgsProcessingParameterNumber|nprocs|Number of threads which will be used for parallel computing|QgsProcessingParameterNumber.Integer|1|True|1|None

(I have tested this change successfully on my local Fedora box).

The sustainable solution would be to add this parameter in QGIS via a pull request, editing the file:

https://github.com/qgis/QGIS/blob/master/python/plugins/grassprovider/description/r.sun.insoltime.txt