10

I have found multiple links that appear to say that this now exists in QGIS 2.2, but it appears that it's only using one core to full capacity.

This is running on Ubuntu 14.04

The current process is creating a large amount of regular points. How can I make that process use more than the one core?

CPU USage

  • 1
    I think this will be in 2.4, the next release. However, if you want to try it out download the nightly build. – Matt May 29 '14 at 14:26
  • It's probably worth commenting that due to the GIL "multithreading" will not run concurrent cores. Check out stackoverflow.com/questions/1294382/… What you want is "multiprocessing". – Mr Purple Nov 16 '14 at 6:40
6

There isn't multithreaded rendering QGIS 2.2, it's a feature that will be available in QGIS 2.4.

You can try out QGIS Master (nightly) for testing, and then QGIS 2.4 is scheduled for release on June 20th, 2014.


Whoops, misread your question and from the comments, it looks like multithreaded Processing is something that happens at either the QGIS developer level or the Python Plugin contributor level.

If there is a specific QGIS tool you're using from the menus that's built into QGIS than to get multithreaded processing it would probably need to be coded by a developer for QGIS or even to the root of the tool (GDAL, SAGA, Orfeo, GRASS, R developers, etc...).

If there is a certain plugin than it's most likely coded around Python and the contributor or maintainer of that plugin could see if it's possible to include the multiprocessing or threading modules to enhance its performance.

Either way, submitting a feature request, or seeing if one already exists is usually the best way to get started. It would let you know if someone is already tackling the enhancement or what resources would be needed to kickstart it.

  • That's a shame... I had issues building from source in the past. If I just add the ppa for the nightlies and install all the same with apt, would that give me the latest nightly? Any idea on the stability? – jpmaniac87 May 29 '14 at 15:29
  • @jpmaniac87 I haven't used Ubuntu in a long time and do my GIS work on Arch Linux so I compile everything from source. So I wouldn't know how the PPA's for Ubuntu are and if you could install QGIS (stable) with QGIS (master) at the same time. – SaultDon May 29 '14 at 15:38
  • @jpmaniac87 It looks like from from this answer in another question that that might not be possible given how the QGIS versions are packaged on Ubuntu. Looks like it's one or the other. – SaultDon May 29 '14 at 15:41
  • The PPAs do work. I just commented out the stable lines and installed the nightly. It's fast! But... it only uses the multiple threads literally for rendering... I was hoping more of the plugin processes. I guess that would mean that the plugin creators would need to allow for multithreaded processing in their code? – jpmaniac87 May 30 '14 at 16:42
  • 1
    @jpmaniac87 Yea, because plugins are built with Python, and there is a multiprocessing or threading (threading is usually used with queue) module for Python that they would have to add to their scripts specifically. – SaultDon May 30 '14 at 20:47
3

Depends what you're after. When processing is ported to the new task manager framework then algorithms will be able to run in parallel (where possible). Eg a buffer for one layer can run while a transform occurs on another layer. If you're after parallelization within a single algorithm (Eg buffering features using multiple threads) then I'm unaware of any plans in place to handle this.

Source: http://osgeo-org.1560.x6.nabble.com/Will-Processing-in-QGIS-3-support-parallelization-td5301809.html


Old answer: During the 2015 Google Summer of Code, multi-threading support has been developed for QGIS Processing. The code is currently under review and is expected to land in the developer version in 2016. (Source: http://boundlessgeo.com/2015/12/latest-developments-in-qgis-processing/)

... This solution unfortunately couldn't be merged.

  • Any update on this matter @underdark ? – Ricardo Barros Lourenço Oct 12 '17 at 21:34
  • Parallelization is still limited in most applications, unfortuanetly. My understanding is that utilizing database infrastructure, such as PostGIS/postgres allows more integrated management of queries and have better multithreading capabilities. – CrystallineEntity Oct 27 '18 at 5:58
2

Some threading is being incorporated in the QGIS core functionality (rendering for example as described in SaultDons answer) but many functions or algorithms may or may not have threading incorporated depending on their developement.

For those pyQGIS plugin authors (perhaps including OP) wishing to include threading in their plugin/script some help is available at snorfalorpagus blog Hopefully more and more devs will make use of threading - particularly for the more taxing algorithms.

As a stopgap you may be able to script your process and use a poor-mans parallel process scheme with calls to asychronous shell scripts as described in alexis answer here

If anyone else has any good resources for parallelising QGIS jobs please feel free to edit and add them to this answer :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.