mpi_basics

Dedicated to MPI Basics

APACHE-2.0 License

Stars
5
Committers
4

mpi_basics

Dedicated to MPI Basics

Make sure you have installed MPI in your system. We will be using OpenMPI to write our examples.

C++

cd cpp
mkdir build
cd build
cmake ../
make

Python

Create a virtual environment

python3 -m venv mpi_env
source mpi_env/bin/activate
pip install mpi4py

Run Examples

C++

cd cpp\build
mpirun -n 4 ./hello_world
cd cpp\build
mpirun -n 4 ./send_recv <program_num>

Program Numbers:
1. Send Number 
2. Send Array
3. Send Vector

Python

mpirun -n 4 python3 hello_world.py