Ninth GSoC Report – Multithreading on Processing

What do I have completed this week?

  • Solved an issue that makes QGIS crash when the main thread doesn’t wait for the worker thread to start.
  • I spent most of the time looking up some tutorials about unit testing on QGIS and trying to configure python paths to run the processing tests.

What am I going to achieve for the next week?

  • This week I’ll change back to the multithreading implementation in order to add the cancel option to stop the algorithm execution. I will be working on a mechanism to stop the execution on QGIS algorithm.

Is there any blocking issue?

  • This week my mentor proposed to start working on a suite test and I changed the plan to start working on a unit test to ensure the correct behaviour of the multithreading implementation. At the end of the week we discussed about asking the community to test the new implementation and report the issues if there is any.
Advertisements

Eighth GSoC Report – Multithreading on Processing

What do I have completed this week?

  • Created a mechanism to hold the result of the algorithm taking into account that there can be several algorithms running at the same time. The results are stored in a global variable called algResults. This variable is accessible via python console (e.g. “processing.algResults”).

algResults

  • The signals are connected in a different way in order to close the dialog and quit the thread when the algorithm is finished.
  • I have updated my fork and merged my work into the master branch.
  • Added the runalgIterating method to the AlgorithmExecutor with some changes to support the signals to set the progress
  • AlgorithmDialog refactored.
  • I have been searching for a solution to stop the algorithm execution and I think that is possible to create a sort of checkpoints inside the algorithm to check if we want to stop the execution and raise an exception to stop the thread event loop.

What am I going to achieve for the next week?

  • Allow the user to cancel the execution when running the runalgIterating.
  • Solve the problem with QGIS dependencies on Ubuntu and test the refactored algorithms.
  • Continue working on the algorithm iterating.

Is there any blocking issue?

  • I had to postpone the tests due to some problems installing QGIS dependencies on Ubuntu.
  • Didn’t had time to implement a solution to stop the execution of the algorithm.

Seventh Report

What do I have completed this week?

  • Processing refactored in order to create a non-blocking implementation of the python console. The algorithm is processed in another thread asynchronously and the result is printed to the python console when the execution is finished.
  • AlgorithmDialog refactored to create a non-blocking dialog interface with a button to cancel the execution.
  • R algorithms refactored to support the progress signal.

What am I going to achieve for the next week?

  • Create a mechanism to hold the result of the algorithm taking into account that there can be several algorithms running at the same time.
  • Figure out a way to stop the execution of the algorithm. In third-party algorithms it can not be possible to just interrupt the thread loop and quit the thread. The only available option is to discard the result because the algorithms don’t have any kind of check-point that allows to verify once in while if we want to stop the execution. Kill the thread during the execution can be dangerous and it is not a good option.
  • Test the refactored algorithms.

Is there any blocking issue?

  • It took more time than I expect to create a non-blocking interface.
  • Quitting the thread execution turned out to be far more complicated due to the fact that the algorithms don’t provide any mechanism to allow quitting the thread loop during the execution.

Sixth Report

What do I have completed this week?

  • Solved the issue with SAGA algorithms that makes the Toolbox crash.
  • Refactored Grass/Grass7 and OTB algorithms to work with signals.
  • Bug fixes.

What am I going to achieve for the next week?

  • Test Grass/Grass7 and OTB algorithms.
  • Add an option to cancel the execution of the algorithm and kill the thread.
  • Code refactoring.
  • Start implementing the runalgIterating.

Is there any blocking issue?

  • I had a very busy week due to my university deadlines.
  • An issue with my SAGA installation made me think that something was wrong with my implementation and made me lose some time.
  • The issue with the SAGA installation also prevented me from testing the algorithms.

Problem generating SAGA outputs

The SAGA outputs are not being correctly generated or not generated at all.

This algorithm is an instance of SagaAlgorithm214. The SagaAlgorithm214 doesn’t have the processAlgorithm method as I previously expected before refactoring the algorithms but no problem there because the processAlgorithm of the super class is called, which seems to be correct.

I had a similar problem previously but from what I’ve check until now the source of the issue is different.

Any idea that can help me to figure out what’s going on?

You can check the code here

SAGA_outputs