26/6/14

MPICH2 on Windows XP

MPICH2 on Windows XP

A. Prerequisite

  1. Install Microsoft Visual C++ 2005 SP1 runtime libraries.
  2. Install Microsoft .NET Framework 2.0.
  3. User account with administrator privileges.

B. MPICH2 Installation

  1. Install MPICH2 1.0.8, just follow the default.
  2. Register user account, Start - All Programs - MPICH2 - wmpiregister.exe.
    MPIEXEC Register window.

C. Compilation with Dev-Cpp IDE

  1. Install Dev-Cpp 4.9.9.2, just follow the default.
  2. Download MPI project template and extract to:
    C:\Dev-Cpp\Templates
  3. Create new project, File - New - Project and choose MPI Application
  4. Choose C Project and give the project a name, click OK.
    Dev-Cpp new project dialog window.
  5. Compile project, Execute - Compile

D. Execution

  1. Open Start - All Programs - MPICH2 - wmpiexec.exe.
  2. Enter the MPI program executable location and number of processes, then click Execute button.
  3. The program output will be showed in the textarea below.
    MPIEXEC wrapper window.

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:
  1. Install Geany 0.18.
    Extra: download MPI tags file and copy to:
    "C:\Documents and Settings\%USERNAME%\Application Data\Geany\tags"
  2. Create MPI program in C using Geany.
  3. 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"
    Geany 'Set Includes and Arguments' dialog window.
  4. Compile program, click Compile button on the toolbar.
  5. Run program, click Execute button on the toolbar.

Bài đăng phổ biến