colour.utilities.ParallelForMultiprocess#
- class colour.utilities.ParallelForMultiprocess(*args: Any, **kwargs: Any)[source]#
Bases:
ControlFlowNodeDefine a parallel
forloop node that distributes operations across multiple processes.Distribute iteration work by assigning each task one
indexandelementoutput port value. Execute tasks using amultiprocessing.Poolinstance, then collect, sort, and assign results to theresultsoutput port.Upon completion, invoke the
colour.utilities.ExecutionNode.process()method of the object connected to theexecution_outputoutput port.Notes
The
colour.utilities.ParallelForMultiprocessloop node currently invokes only the two aforementionedcolour.utilities.ExecutionNode.process()methods. When a series of nodes connects to theloop_outputorexecution_outputoutput ports, only the left-most node processes. To circumvent this limitation, use acolour.utilities.PortGraphclass instance.
Return a new instance of the
colour.utilities.TreeNodeclass.