skip to main | skip to sidebar

# Vivian's Tech Blog

## Monday, February 23, 2009

### Install MPICH2 on Windows XP

[Reference: http://www.mcs.anl.gov/research/projects/mpich2/documentation/index.php?s=docs]

STEP 1: INSTALLING MPICH2

1. Main MPICH homepage:

http://www.mcs.anl.gov/research/projects/mpich2/index.php

2. Download the Win32IA32 version of MPICH2 from:

http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads

3. Download Mic rosoft Visual C++ 2005 SP1 Redistribu table Package (x86) and install the program.

http://www.microsoft.com/downloads/thankyou.aspx?familyId=200b2fd9-ae1a-4a14-984d-389c36f85647&displayLang=en#

4. Run the executable, mpich2-1.0.7-win32-ia32.msi (or a more recent version). Most likely it will result in the following error:

If you follow the link to download the .NET Framework it will download version 2.0.50727. To download version 2.0 use this link:

http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en

5. Install the .NET Framework program

6. Install the MPICH2 executable. Write down the passphrase “behappy” for future reference. The passphrase must be consistent across a network.

7. NOTE: make sure that the MPICH2 versions are the same in all computers/machines. Otherwise, the following error massage may appear:

Aborting: unable to connect to ni, smpd version mismatch Aborting: unable to connect to ni, smpd version mismatch.

STEP 2: CHANGE COMPUTER SETTINGS

1. Copy the executable to the same directory in each machine (node). For example “C:\Program Files\MPICH2\examples\cpi.exe”

2. Set “ Network Connections”: Ensure that each machine can let its files shared by other computers by checking the option “Control PanelàNetwork and Internet ConnectionsàNetwork ConnectionsàLocal Area ConnectionàPropertiesàGeneral-File and Printer Sharing for Microsoft Networks”.

3. Set “Windows Firewall”:

1. Ensure that Windows Firewall can allow files sharing by checking the option “Control Panel à Security Center àWindows FirewallàExceptionsàFile and Printer Sharing”
2. From the Exceptions Tab, select “Add Program” and make sure “C:\Program Files\MPICH2\bin\smpd.exe” and “C:\Program Files\MPICH2\bin\mpiexec.exe” are on the list.
3. Form the Exception Tab, select “Add Program” and add the executable “C:\Program Files\MPICH2\examples\cpi.exe” into the exception list.

4. Add the MPICH2 path to Windows:

A. Right click “My Computer” and pick properties

B. Select the Advanced Tab

C. Select the Environment Variables button

D. Highlight the path variable under User Variables and click edit. Add “C:\Program Files\MPICH2\bin” to the end of the list; make sure to separate this from the prior path with a semicolon.

E. Highlight the path variable under System Variables and click edit. Add “C:\Program Files\MPICH2\bin” to the end of the list; make sure to separate this from the prior path with a semicolon.

STEP 3: RUN MPI

1. Get Domain name, User name and Password for each machine (Node)

1. Log on each machine you want to run on. This is not required, but prevents anyone else logging on and using the machine.
2. Use Start MenuàRunà cmd.exe to opens command prompt window.
3. Type in “ipconfig” to obtain the IP address of the machine. For example, “1.2.3.4”
4. In the machine, type in “ping –a 1.2.3.4” to resolve IP address to the host name, we can see: "Pinging hostname[1.2.3.4] with 32 bytes of data."
5. However, “testmachine” is only a “host name” but not a “domain name”, which is required to find a computer in the network. To get the domain name, we have to ping the machine from another machine, then we will see: "Pinging domainname[1.2.3.4] with 32 bytes of data"
6. Now we obtain the following informations:

Domain Name: domainname

It is required to find a computer in the network

Host Name: hostname

The host name can be used to identify a computer only when all the computers are in the same subnetwork.

IP Address: 1.2.3.4

User Name: username

The user name required to log in the machine

Password: **********

The corresponding password required to log in the machine

2. Register each “user” in the master node so that a domain name, user name and password can be automatically retrieved by mpiexec to launch processes.

mpiexec –register user 1 domainname\username\**********

Mpiexec will ask you to enter the domain name, user name and password.

3. Validate the saved user information:

mpiexec –validate user 1”

Mpiexec should return a message “SUCCESS”.

4. Go to the working directory

C:\> cd C:\workingdirectory

C:\workingdirectory>

5. In the working directory, run the example executable to insure correct installation.

mpiexec –n 2 c:\program files\mpich2\examples\cpi.exe

mpiexe c –hosts 2 domainnameA 1 domainnameB 1 c:\program files\mpich2\examples\cpi.exe

#### 1 comment:

1. Oğuz October 29, 2009 2:33 PM

   i have succesfully operated the cpi example which default comes with the application. now i wrote a program like pi calculation in visual studio 2008 with c, and i copy-pasted the myapp.exe to the c>programfiles>mpich>examples directory, and i tried to operate the program on the command line like the pi example, but it hadn't answered me i had to press ctrl+c to abort the operation. would you mind explaining a new program operating on the command line, i hope i could clarify my problem
   thanks for everything!

   Reply Delete

Add comment
Load more...

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)