lair.parallel.parallelize#
- lair.parallel.parallelize(func, num_processes=1)[source]#
Parallelize a function across an iterable.
- Parameters:
func (function) – The function to parallelize.
num_processes (int or 'max', optional) – The number of processes to use. Uses the minimum of the number of items in the iterable and the number of CPUs requested. If ‘max’, uses all available CPUs. Default is 1.
- Returns:
parallelized (function) – A function that will execute the input function in parallel across an iterable.
- Return type: