Branch and Bound Graph Algorithm with MPI Python
- https://stackoverflow.com/a/54907810
- https://duongtrungnghia.wordpress.com/2017/03/28/install-mpi4py-on-windows-10/
- https://mpi4py.readthedocs.io/en/stable/install.html#requirements
- Python 3.x
- PiP
- Both of the Files downloaded from here, namely msmpisdk.msi and msmpisetup.exe
- Install the requirements above
- Add the installation folder for each Program in your path variable
Go to search and type environment and select first thing like "Edit System Variable"
You will find the Environment Variables button in bottom right
Add to the path variable the installation folders (for me they were
C:\Program Files\Microsoft MPI\Bin
C:\Program Files (x86)\Microsoft SDKs\MPI\
- Install the requirements in requirements.txt
pip install -r requirements.txt
as a matter of fact you can add an environment to make things more professional
Navigate to the project folder
cd /where/i/made/this/project
You can make your Python Script to make some Parallel Computing like the one in sample.py
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
print('this process rank is ', rank)
and then start the parallel computing
mpiexec -n 5 py sample.py
Should output something like this
[(your_environment)/your/folder] mpiexec -n 5 py sample.py
My rank is 4
My rank is 1
My rank is 3
My rank is 0
My rank is 2