Demonstrates how to call a C++ class from Python using pybind11 together with MPI. The task is to solve differential equations using Shooting and Seidel methods.
apt install openmpi
apt install cmake
git clone --recursive https://github.com/Ilyabasharov/cpp-pybind-mpi4py.git
pip install -r requirements.txt
cd cpp-pybind-mpi4py
mkdir -p build && cd build
export CC=gcc
export CXX=g++
cmake ..
make
mpirun -n 8 python3 helloWorld.py
Main files:
mpi_lib.cpp
: C++/MPI library codepybind_calc.py
: python code that call the C++/MPI library (using pybind11 and mpi4py)