sybrenjansen / mpire

A Python package for easy multiprocessing, but faster than multiprocessing
MIT License
2.02k stars 37 forks source link

add possibility to disable multiprocessing for debugging purpose w/o changing code #28

Open vlomshakov opened 3 years ago

vlomshakov commented 3 years ago

Hey! Sometimes I have to debug my code in sequential mode. But duplicating code (parallel and sequential execution) looks ugly. It seems to me that introducing DummyWorkerPool is good solution for this purpose, it just call the function sequentially in loop w/o any overhead. What do you think?

sybrenjansen commented 2 years ago

Hi @vlomshakov , I can imagine that for quick testing purposes that might be useful.

I think the minimum working functionality of a dummy pool should be:

All the other stuff will be disabled because they're only useful when actually using workers.

Would that work?

vlomshakov commented 2 years ago

yes, it would be perfect. Thanks!

sybrenjansen commented 2 years ago

Alright, perfect. I will try to put some hours in at the end of this year.