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
mpirundecorator will run the function with the installedmpirunexecutable that is part of the MPI installation used bympi4py.- Parameters
- return_rank
intor[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 thempiruncommand. Any value other thanNonewill be converted to a string and passed as part of thempirunargument. For example, the keywordnpwith the value4(i.e.,kwargs = {'np': 4}) would result inmpirunbeing called with the arguments-np 4.
- return_rank
Methods
__init__([return_rank])Run a function in an MPI environment