Steps to build the MPICH2 Development Environment on CentOS 6.4

Source: Internet
Author: User

Prerequisites:

A total of five machines are installed with CentOS6.4. The host names are node0, node1, node2, node3, and node4. Node0 acts as the master node. The master node here refers to the server that uses node0 as the NFS.

MPICH2 installation package: mpich2-1.2.1p1.tar.gz, can be downloaded from the MPICH Official Website

-------------------------------------- Split line --------------------------------------

Hydra configuration and use in MPICH2-1.3

Complete MPICH2 configuration manual under Ubuntu 11.10

Install the MPICH2 parallel computing environment on Ubuntu 8.10

RedHat 5.4 MPICH2-1.4.1p1 Installation Process

Install MPICH2 in Linux and implement high-performance computing for multiple hosts

-------------------------------------- Split line --------------------------------------

The following operations use the root user name:

1. Configure the network of five machines. For detailed configuration process, see my other article "network configuration of CentOS static IP Address".

2. Create a unified user name cluster and the same password for five machines:

Useradd cluster
Passwd cluster

Modify the/etc/sudoers file and add the following line to grant the cluster temporary root permission:

Cluster ALL = (ALL) ALL

The following operations use the cluster User Name:

3. configure SSH so that any two machines can directly log on to each other without a password, for detailed configuration process, see my other article "how to configure SSH for mutual logon between two hosts without a password".

4. configure NFS, node0 as the server, and 4 other machines as the client. The shared directories of all machines are/home/cluster/mirror, for detailed configuration process, see my other article "NFS installation process under CentOS".

5. Install the MPICH2 Development Environment on node0

First, check that gcc, g ++, make, and python compilation tools are installed in the system.

Create the installation directory of MPICH2:

Mkdir/home/cluster/mirror/mpich2

Upload mpich2-1.2.1p1.tar.gz to/home/cluster/mirror and decompress:

Tar-zxv-f mpich2-1.2.1p1.tar.gz

Run the following command in the/home/cluster/mirror/mpich2-1.2.1p1 directory:

./Configure -- prefix =/home/cluster/mirror/mpich2
Make
Make install

Create the/home/cluster/mpd. hosts file. The file content is as follows:

Node0
Node1
Node2
Node3
Node4

6. Configure environment variables on five machines

Add the following to the/home/cluster/. bashrc file:

Export PATH = $ PATH:/home/cluster/mirror/mpich2/bin
Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/home/cluster/mirror/mpich2/lib

Make the configuration file take effect:

Source/home/cluster/. bashrc

Test whether MPICH2 is successfully installed:

Which mpd
Which mpiexec

Create the/home/cluster/. mpd. conf file. The file content is as follows ("" contains any string, but all machines must be the same ):

Secretword = "lab311"

Modify the permission of the. mpd. conf file so that only the user cluster has the permission to read and write the file:

Chmod 600/home/cluster/. mpd. conf

Test whether the mpd manager can be started on each machine. Normally, the execution result of mpdtrace is the host name of the Local Machine. After the test is complete, use the mpdallexit command to disable mpd, otherwise, a connection failure error occurs when the cluster is started later:

Mpd &
Mpdtrace
Mpdallexit

7. Test the entire cluster at node0.

Before starting the cluster, You need to disable the firewall of all machines:

Sudo service iptables stop
Sudo chkconfig iptables off

Start the cluster (parameter-n 5 indicates that five machines are started ):

Mpdboot-n 5-f/home/cluster/mpd. hosts

View started machines:

Mpdtrace

Normally, the following results are displayed:

Node0
Node1
Node2
Node3
Node4

Disable cluster:

Mpdallexit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.