5.5. MPI#

MPI helper functionality.

mirgecom.mpi.mpi_entry_point(func)[source]#

Return a decorator that designates a function as the “main” function for MPI.

Declares that all MPI code that will be executed on the current process is contained within func. Calls MPI_Init()/MPI_Init_thread() and sets up a hook to call MPI_Finalize() on exit.

Return type:

Callable

mirgecom.mpi.pudb_remote_debug_on_single_rank(func)[source]#

Designate a function func to be debugged with pudb on rank 0.

To use it, add this decorator to the main function that you want to debug, after the mpi_entry_point() decorator:

@mpi_entry_point
@pudb_remote_debug_on_single_rank
def main(...)

Then, you can connect to pudb on rank 0 by running telnet 127.0.0.1 6899 in a separate terminal and continue to use pudb as normal.

Parameters:

func (Callable) –

Return type:

Callable

mirgecom.mpi.enable_rank_labeled_print()[source]#

Enable prepending the rank number to every message printed with print().

Return type:

None