compomics / DeepLC

DeepLC: Retention time prediction for (modified) peptides using Deep Learning.
https://iomics.ugent.be/deeplc
Apache License 2.0
52 stars 18 forks source link

Fix running DeepLC from multiprocessing environment #6

Closed paretje closed 4 years ago

paretje commented 4 years ago

multiprocessing uses daemonic processes. POSIX doesn't allow daemonic processes to have children, i.e. you can't nest multiprocessing pools. This tests if the current process is a daemonic process, and if so, uses a dummy pool using threads instead. Due to the GIL, using multiple threads won't make this faster, unless DeepLC would be IO-bound.