Closed susannasiebert closed 5 years ago
Hi Susanna,
I'm glad you find the library useful! Hmm, this will be hard to reproduce and track down. Child processes dying is a bad thing to happen. I tried to convey error messages as clear and direct as possible to the parent process, but dying processes may be tough. Is there any way you can prevent the child processes from dying in the first place and instead return gracefully?
As for debugging tips, you can use if_
in a parallel section to temporarily disable parallel processing for debugging. I found this very helpful in many occasions because then you get stacktraces for the errors.
I can only guess that the script will be stuck here: https://github.com/classner/pymp/blob/master/pymp/__init__.py#L128 waiting for the subprocess to finish. However, waitpid
should be reliable, even when the process 'dies' instead of properly stopping. If you want to dig deeper, use the logging
module and set the loglevel to DEBUG
for the pymp module.
Thank you for the pointers. We're still not quite sure what was happening but we were able to resolve this issue by switching away from nested to multi-threading to single-level multithreading.
Glad that you could resolve it! Let me know should you have further questions or insights on this.
We've been using pymp to implement nested parallelization for one of our long-running subroutines. The code can be found here (https://github.com/griffithlab/pVACtools/blob/master/lib/pipeline.py#L335). Unfortunately, we've been running into a couple of problems: 1) One of the child processes will encounter an error but the main process will not die. Instead it will hang indefinitely. 2) Child processes will disappear. The main process will hang indefinitely.
Unfortunately, these situations seems to be non-deterministic so I haven't been able to construct a test case that can reliably reproduce this problem. Could you have a look at our implementation and see if I did something incorrectly or if you have any other suggestions on how to debug this problem?