MPI4PY
This page documents how to use the MPI for Python package within a Conda environment.
Using MPI4PY in a Python Script
To use MPI in a python script through mpi4py
, you must first import it using the following code:
Example Script
Here is an example python script mpi4pytest.py
that uses MPI:
Conda Environment
Once you have activated your conda environment, run the following commands to install mpi4py
:
Here is an example batch job script mpi4pytest_conda.sh
that uses mpi4pytest.py
and the conda environment setup:
Python Environment
Once you have activated your conda environment, run the following command to install mpi4py
:
Below is an example batch job script mpi4pytest_env.sh
:
Last updated
Was this helpful?