The mpi4py(MPI for Python) package provides Python bindings for the Message Passing Interface (MPI) standard, allowing Python applications to exploit multiple processors on workstations, clusters and supercomputers.
You can run mpi4py enabled python script via NCI-data-analysis module (2022.06 and later) in both batch (Gadi) and interactive (ARE JupyterLab) ways.
Gadi
You could submit a PBS job to run your script in a batch way at Gadi.
The example job script is show below (make sure "gdata/dk92" is included in your storage request)
#!/bin/bash |
The helloworld.py is shown below
#!/usr/bin/env python |
you will get the output simply printing each MPI rank ID:
Hello, World! I am process 3 of 4 on gadi-cpu-clx-0489.gadi.nci.org.au. |
You can request multiple nodes to run your mpi4py script in a batch job at Gadi.
You can find more mpi4py examples here.
ARE
You can also run the mpi4py script in your ARE Jupyterlab session. Please note, you can only run them in a single node.