I'm trying to use mpi4py.
I have mpi4py installed from the Anaconda package, and
pip install mpi4py
recognizes this.
But when i run
from mpi4py import MPI
says MPI module doen't exist.
I've looked in the mpi4py folder and indeed i can't find it.
i think the problem is that i might not have OpenMPI installed, but i've been looking everywhere and i can't find how to install ir on Windows 10.
Please help.
Edit: The original question was about installing OpenMPI on windows 10 and use it with mpi4py, but since i found a way to run mpi4py with MSMPI i changed the title so people trying to do the same at least have a work-around.
Execute the Python code contained in pyfile, which must be a filesystem path referring to either a Python file, a directory containing a __main__.py file, or a zipfile containing a __main__.py file. Search sys. path for the named module mod and execute its contents. Execute the Python code in the cmd string command.
To use MPI with Windows, you will need to install the free download of Microsoft MPI. Go to the installation page and download MSMpiSetup.exe . Once downloaded, run the executable and follow the instructions. If you want to set the PATH permanently, follow these instructions.
Set the MSMPI path (by default C:\Program Files\Microsoft MPI\Bin) in the %PATH% environment variable (http://www.computerhope.com/issues/ch000549.htm).
After that, you can launch your program by running the command:
mpiexec /np <number of process> python <your MPI4Py python script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With