gemseo.formulations.idf_chain module#

Processing strongly coupled disciplines in parallel.

class IDFChain(execution_sequence, n_processes, use_threading)[source]#

Bases: MDOChain

A discipline for processing strongly coupled disciplines in parallel.

Given a collection of disciplines, a sequence of execution of disciplines and process disciplines is deduced from its coupling structure under the constraint of running the strongly coupled disciplines in parallel.

Specifically, the coupling structure provides sequential tasks, where each task is a set of uncoupled groups of strongly coupled disciplines. The tasks are then performed sequentially, by performing their uncoupled groups either in parallel or in serial, and the strongly coupled disciplines of these groups in parallel.

Initialize self. See help(type(self)) for accurate signature.

Parameters:
  • execution_sequence (ExecutionSequence) -- The execution sequence.

  • n_processes (int) -- The maximum simultaneous number of threads if use_threading is True, or processes otherwise, used to parallelize the execution.

  • use_threading (bool) -- Whether to use threads instead of processes to parallelize the execution; multiprocessing will copy (serialize) all the disciplines, while threading will share all the memory. This is important to note if you want to execute the same discipline multiple times, you shall use multiprocessing.