-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Many methods in glimpse benefit from placing large arrays into shared memory to share across parallel processes. We currently accomplish this task using sharedmem, which has worked brilliantly but has some downsides:
- Ease of use over
multiprocessing.Poolcomes at the cost of not supporting Windows. However, this comment bysharedmem's author suggests that this can be addressed by installing Windows Subsystem for Linux (WSL, https://docs.microsoft.com/en-us/windows/wsl/install-win10). - Not actively maintained, which could lead to trouble down the road. For example,
MapReduceno longer seems to work on Python 3.8 (see MapReduce no longer working on Python 3.8 rainwoodman/sharedmem#24), requiring the slowerMapReduceByThreadto be used (glimpse.config.backend = sharedmem.MapReduceByThread).
Possible alternatives to consider:
multiprocessing, which as of Python 3.8 implementsSharedMemory(https://docs.python.org/3/library/multiprocessing.shared_memory.html).joblib, especially once/ifSharedMemoryis supported (Feature: Multiprocessing-based Backend using SharedMemory + Pickle 5 for 2-3x Faster IPC joblib/joblib#1094, Python 3.8 SharedMemory as alternative to memmapping during multiprocessing joblib/joblib#915).ray, based on the tutorial here: https://towardsdatascience.com/10x-faster-parallel-python-without-python-multiprocessing-e5017c93cce1.