mpirical.mpirun
- class mpirical.mpirun(return_rank='all', **kwargs)[source]
A decorator to execute functions in their own MPI environment
- __init__(return_rank='all', **kwargs)[source]
Run a function in an MPI environment
The
mpirun
decorator will run the function with the installedmpirun
executable that is part of the MPI installation used bympi4py
.- Parameters
- return_rank
int
or[int]
or'all'
Indicates the ranks from which the return values will be gathered across the MPI environment. If
'all'
is specified, then all of the return values from all MPI ranks will be returned in a list. If a list of integers is given, then only those MPI ranks will return values (in the order specified). If only 1 integer is given, then the return value from that rank will be returned (not in a list).- kwargsdict
Dictionary that stores the arguments (without their initiall
-
) to be given to thempirun
command. Any value other thanNone
will be converted to a string and passed as part of thempirun
argument. For example, the keywordnp
with the value4
(i.e.,kwargs = {'np': 4}
) would result inmpirun
being called with the arguments-np 4
.
- return_rank
Methods
__init__
([return_rank])Run a function in an MPI environment