MPI. Frequently Asked Questions.

Q: Where can I download an free implementation of MPI?

A: There are a number of free implementations. The recommended one is MPICH2 by Argonne National Laboratory.

Q: Which languages is MPI compatible with?

A: It is recommended to use C/C++.

Q: What operating systems support MPICH2?

A: MPICH2 can be set up on Windows (32 and 64 bits) as well as UNIX.

Q: I have setup MPICH2 on Windows. What else do I need?

A: You need to use some C/C++ programming environment (IDE). It is recommended to use:

Q: How do I write a program in eclipse and how do I compile it?

A:

  1. Create a new C project

  2. Declare the project parameters (name, path, use of MinGW)

  3. When the project appears in the left side, right click on it and select "Properties"

  4. Add the include directory "C:\Program Files\MPICH2\include" in Include paths (-I)

  5. Add the library directory "C:\Program Files\MPICH2\lib" in Library search path (-L)

  6. Create connection with the MPI library C:\Program Files\MPICH2\lib\mpi.lib from the option "Miscellaneous" > "Other objects"

  7. Create a new .c file and for your C source code. Give it any name, eg. myprog.c

  8. After the file myprog.c write your C code in it

  9. After you've written the code, build the application selecting the "hammer" icon (or from the menu "Project" > "Build Project")

  10. We have now the executable file myprog.exe in folder C:\mpi\myprog\Debug\.

Q: I have created the executable myprog.exe. How do I run it?

A: There are a number of options:

Note: if we just run
myprog.exe
then only 1 process will be generated, so there is no parallel execution. This is equivalent to the command
mpiexec -n 1 myprog.exe