MPICH2 on Windows XP
A. Prerequisite
- Install
Microsoft Visual C++ 2005 SP1 runtime libraries.
- Install
Microsoft .NET Framework 2.0.
- User account with administrator privileges.
B. MPICH2 Installation
- Install
MPICH2 1.0.8, just follow the default.
- Register user account, Start - All Programs - MPICH2 -
wmpiregister.exe.
C. Compilation with Dev-Cpp IDE
- Install
Dev-Cpp 4.9.9.2, just follow the default.
- Download MPI project
template and extract to:
C:\Dev-Cpp\Templates
- Create new project, File - New - Project
and choose MPI Application
- Choose C Project and give the
project a name, click OK.
- Compile project, Execute - Compile
D. Execution
- Open Start - All Programs - MPICH2 -
wmpiexec.exe.
- Enter the MPI program executable location and number of processes,
then click Execute button.
- The program output will be showed in the textarea below.
E. Alternative IDE: Geany
Geany is a small and fast
IDE with flexible compilation option. We can compile
MPI program directly from the source code without having to make a
project first. For Geany in order to be able to compile C program, we
must install
Dev-Cpp first, it uses the
GCC compiler. After that, follow these steps:
- Install Geany 0.18.
Extra: download MPI tags file and copy to:
"C:\Documents and Settings\%USERNAME%\Application Data\Geany\tags"
- Create MPI program in C using Geany.
- Set compilation for MPI, Build - Set Includes
and Arguments.
- Compile:
C:\Dev-Cpp\bin\gcc.exe "%f" -o "%e.exe" -I "C:\Dev-Cpp\include" -I "C:\Program Files\MPICH2\include" -L "C:\Dev-Cpp\lib" -L "C:\Program Files\MPICH2\lib" "C:\Program Files\MPICH2\lib\mpi.lib"
- Execute: (here number of
processes is 5)
"C:\Program Files\MPICH2\bin\mpiexec.exe" -n 5 "%e"
- Compile program, click Compile button
on the toolbar.
- Run program, click Execute button on
the toolbar.