triqs.utility.mpi_mpi4py.barrier

triqs.utility.mpi_mpi4py.barrier(poll_msec=1)[source]

Synchronisation barrier that yields the CPU while waiting.

Uses a non-blocking mpi4py.MPI.Comm.Ibarrier() followed by a time.sleep() loop on its Test(), so that subprocesses invoked by the user (e.g. solvers running outside Python) can use the otherwise idle CPU. When poll_msec is falsy (0 or None), falls back to the standard blocking mpi4py.MPI.Comm.barrier().

Parameters:
poll_msecfloat, optional

Sleep duration in milliseconds between successive Test() calls. Default 1.