fmultiprocess (function)

fundamentals.fmultiprocess(log, function, inputArray, poolSize=False, timeout=3600, turnOffMP=False, progressBar=False, mute=False, **kwargs)[source][source]

multiprocess pool

Key Arguments

  • log – logger

  • function – the function to multiprocess

  • inputArray – the array to be iterated over

  • poolSize – limit the number of CPU that are used in multiprocess job

  • timeout – time in sec after which to raise a timeout error if the processes have not completed

  • turnOffMP – turn off multiprocessing. Useful for profiling and debugging. Default False

  • progressBar – add a progress bar

  • mute – mute terminal output from child processes

Return

  • resultArray – the array of results

Usage

```python from fundamentals import multiprocess # DEFINE AN INPUT ARRAY inputArray = range(10000) results = multiprocess(log=log, function=functionName, poolSize=10, timeout=300,

inputArray=inputArray, otherFunctionKeyword=”cheese”)

```