MPI (Message Passing Interface)
- more complex
- each process has its own memory
- can scale across multiple machines
- can adapt to more settings
- Python: mpi4py
- requires OpenMPI to be installed
- done for you on OzSTAR
mpiexec -n <num processes> python3 <path/to/your/file.py>
flowchart LR
main@{ shape: rounded, label: "Main"}
worker1@{ shape: rounded, label: "Worker 1"}
worker2@{ shape: rounded, label: "Worker 2"}
workerN@{ shape: rounded, label: "Worker N"}
out@{ shape: rect, label: "Output"}
main -...->|assign work| worker1
main -...->|assign work| worker2
main -...->|assign work| workerN
worker1 ---->|collect result| main
worker2 ---->|collect result| main
workerN ---->|collect result| main
main ----->|combine results| out