triqs.utility.dist_on_nodes.DistributionOnNodes
- class triqs.utility.dist_on_nodes.DistributionOnNodes[source]
Bases:
objectAbstract master / worker dispatcher distributing function calls over MPI.
Subclasses are expected to provide:
__next__(self)– return the next input to evaluate, orNoneto skip a step. A return ofNoneis not the same asfinished()returningTrue.finished(self)– returnTruewhen no more inputs remain to be produced.the_function(self, x)– the actual work performed on a worker rank for inputx.treate(self, value, node)– called on the master rank for each result returned by a worker. ANoneresult is silently ignored.
See
DistributionOnNodesOneStackfor a minimal concrete implementation andDistributionOnNodesTestfor 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().