triqs.utility.dist_on_nodes.DistributionOnNodes

class triqs.utility.dist_on_nodes.DistributionOnNodes[source]

Bases: object

Abstract master / worker dispatcher distributing function calls over MPI.

Subclasses are expected to provide:

  • __next__(self) – return the next input to evaluate, or None to skip a step. A return of None is not the same as finished() returning True.

  • finished(self) – return True when no more inputs remain to be produced.

  • the_function(self, x) – the actual work performed on a worker rank for input x.

  • treate(self, value, node) – called on the master rank for each result returned by a worker. A None result is silently ignored.

See DistributionOnNodesOneStack for a minimal concrete implementation and DistributionOnNodesTest for a runnable example.

Attributes

SleepTime

(float) Class attribute. Seconds the master sleeps between polls of the local child process when an evaluation is also running on the master. Default 1.

Methods

run()

Run the master / worker dispatch loop until finished().