Closed AlbertoCasasOrtiz closed 2 years ago
@AlbertoCasasOrtiz I've been reading about this because especially in time-dist
and phase-type
, I often want to stop a computation (since these can go on virtually forever if the integration limits / number of generations are large).
Although I understand that killing a QThread is hard in general when making calls to third party libraries, both of these sub-programs are essentially just iteratively making sparse matrix-vector multiplications. Is it feasible to insert a signal handler of some kind in the main loop for phase-type and time-dist that would allow interruption?
Yes, I think that's the proper way of doing it. In phase-type and time-dist it would be easy to insert a boolean for stopping the main loop that makes the calculations, and activating that boolean when the stop button is clicked.
I was thinking in doing that for those executables, and for the generation of matrices, images, files... The problem comes with calls to external libraries like Intel MKL, where you cannot set the boolean
I open this again because it is not working for matrix generation yet. If I stop the computation of the matrix when it has not finished yet, when Intel MKL try to free memory, it is trying to free data that has not been instantiated (the remaining matrix not computed yet). This generates a SegFault error sometimes.
I move this issue to Post-Release project.
Stop button takes too much time to stop an execution. Looks like we can stop the execution of custom code (e.g. Matrix generation, write matrix to file, generate image...) but not when a third party library is being executed (e.g. Solving matrix with either Intel MKL Pardiso or ViennaCL).