Multiprocessing

Multiprocessing#

OSEkit can be set up to distribute computations over multiple threads. Such computations are:

To enable multiprocessing, simply set the osekit.config module up:

from osekit import config

config.multiprocessing["is_active"] = True

Multiprocessing relies on Python’s multiprocessing process pools. The default number of worker processes that will be used if multiprocessing is active is defaulted to os.process_cpu_count(). This number can be adjusted thanks to the config module:

from osekit import config

config.multiprocessing["is_active"] = True
config.multiprocessing["nb_processes"] = 5 # Will limit the number of worker processes to 5.