stable_learning_control.utils.mpi_utils.mpi_tools
Module used for managing MPI processes.
Functions
|
Re-launches the current script with workers linked by MPI. |
|
Send message from one MPI process to the other. |
|
Print for MPI parallel programs: Only rank |
|
Get rank of calling process. |
|
Reduced results of a operation across all processes. |
Count active MPI processes. |
|
|
Broadcast variable to other MPI processes. |
|
Perform a MPI operation. |
|
Take the sum of a scalar or vector over MPI processes. |
|
Average a scalar or vector over MPI processes. |
|
Get mean/std and optional min/max of scalar x across MPI processes. |
Module Contents
- stable_learning_control.utils.mpi_utils.mpi_tools.mpi_fork(n, bind_to_core=False)[source]
Re-launches the current script with workers linked by MPI.
Also, terminates the original process that launched it.
Taken almost without modification from the Baselines function of the same name.
- stable_learning_control.utils.mpi_utils.mpi_tools.msg(m, string='')[source]
Send message from one MPI process to the other.
- stable_learning_control.utils.mpi_utils.mpi_tools.pprint(input_str='', end='\n', comm=MPI.COMM_WORLD)[source]
Print for MPI parallel programs: Only rank
0
printsstr
.
- stable_learning_control.utils.mpi_utils.mpi_tools.allreduce(*args, **kwargs)[source]
Reduced results of a operation across all processes.
- Parameters:
*args – All args to pass to thunk.
**kwargs – All kwargs to pass to thunk.
- Returns:
Result object.
- Return type:
- stable_learning_control.utils.mpi_utils.mpi_tools.num_procs()[source]
Count active MPI processes.
- Returns:
The number of mpi processes.
- Return type:
- stable_learning_control.utils.mpi_utils.mpi_tools.broadcast(x, root=0)[source]
Broadcast variable to other MPI processes.
- stable_learning_control.utils.mpi_utils.mpi_tools.mpi_sum(x)[source]
Take the sum of a scalar or vector over MPI processes.
- stable_learning_control.utils.mpi_utils.mpi_tools.mpi_avg(x)[source]
Average a scalar or vector over MPI processes.