8

I am a computer science student and this season we have a course in MPI programming in C language. I don't have enough hard disk space to install visual studio on my computer and I have installed codeblocks, and MinGW as compiler, and I also installed Microsoft MPI to run mpi .exe code. Now I think that I need to install Open mpi to compile my code to exe and run it using MSMPI. Please correct me if I'm wrong until now :)

In OpenMPI download page we just have binary codes, and I don't know how to install binary code in windows...

Thanks all

4
  • I don't know if this will work for your circumstance, but to compile C code on Windows, I enabled the Linux Subsystem for Ubuntu which is available on Windows 10, then I installed gcc with sudo apt-get install gcc which allows for compiling code via the Linux Subsystem. This let me avoid having to deal with things like CodeBlocks and MinGW entirely. Commented Jan 10, 2018 at 18:28
  • If you use the Linux Subsystem for Ubuntu on Windows 10, then this Stack Overflow question shows how to compile C code as .exe files for windows, which may work for what you desire, though I am not completely sure if it will work for all the mpi programming you want to do. Commented Jan 10, 2018 at 18:29
  • @DavyM I already have gcc and I can run regular c programs by it, but I need mpicc to compile a mpi code... Commented Jan 10, 2018 at 18:42
  • Since you are learning the C language, I recommend staying away from C++. They are two distinct languages. For example, C++ has std::string which can dynamically grow. The C language uses fixed length character arrays, which must be compared using strcmp. Please adjust your tags. Commented Jan 10, 2018 at 20:49

1 Answer 1

4

If you plan to build your code with Open MPI and then run it with Microsoft MPI, then just drop that idea ! MPI is standard in a sense that a code can be built with any MPI implementation. There is no guarantee a binary can be ran with any MPI implementation.

Open MPI is not supported under windows, but you can use cygwin and install the openmpi packages. Linux subsystem for Ubuntu is an option i never tried but that might work too.

Sign up to request clarification or add additional context in comments.

4 Comments

Interestingly, there are efforts being made on this front, especially in implementations of the same family! Of course MSMPI isn't part of it, but I wonder where we'll be in 10 years. mpich.org/abi
Open MPI does not break ABI compatibility within the same major version. github.com/cea-hpc/wi4mpi can be used if you want/need to mix Open MPI and MPICH
How do you install Open MPI with Cygwin?
Select it from the list of packages

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.