Establishment of MPI Environment and cluster testing in Windows

Source: Internet
Author: User

Software preparation: Download the corresponding version http://www.mcs.anl.gov/research/projects/mpich2/index.php on the official website. The Win32 version is used here.

Devices: several computers, all of which are Windows operating systems

The environment configuration process is as follows:

1. Install software

2. Add a new Administrator Account

3. register an account

4. Configuration

The following describes in sequence.

1. Install software

Install the MPI installation package on each computer, and select the installation path. It is not necessary that each computer is in the same path.

Select everyone as the user during installation. After installation, the directory is as follows:

Then add the bin directory of mpich2 to the path of the system environment variable.

Note: After the installation is complete, there will be a smpd.exe process in the resource manager's process. To perform MPI computing, you must have this process. If not, try to reinstall it.

2. Add a new user account

In order that the computer group can use MPI, you should add an identical account to each computer with MPI installed, and the account password must be the same. The account must be an administrator. Here, an account named MPI is created for each computer. The password is set at will, assuming 123.

Note: If the Administrator account is used, only the MPI account can be selected at each startup after the MPI account is created. In fact, since the Administrator account exists, it is only hidden. If you can choose to log on with administrator or MPI Account at the beginning, you can modify the registry: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ WindowsNT \ CurrentVersion \ Winlogon \ specialaccounts \ userlist, find the DWORD key named "Administrator" in the window on the right (if not, you can create it yourself), double-click, change the key value from 0 to 1, and then restart the computer.

Another point is that for MPI computing, there is no need to use an MPI account to log on to the computer, that is, as long as there is an MPI account on the computer, MPI parallel computing can be performed, it does not matter if the user chooses to use the MPI account to log on to the computer (this issue is not clearly described in many articles ).

3. register an account

Click Start --mpich2--wmpiregister.exe. Add the MPI account and password 123, register, and confirm.

Iv. Configuration

The hosts file is placed in the MPI folder.

Note that the firewalls of various computers are disabled. Each computer is in the same project group. All the computers I use here are in one vro and all are in the workgroup Working Group.

Select Start --mpich2--wmpiconfig.exe. For example, if the computer with MPI installed is successfully connected, it is highlighted (such as green ). If the connection fails, follow the steps above to check carefully.

 

Test

Perform a test (in examples) by using the π value example of the Installation File ).

Test 1: standalone test

Run cpi.exe directly on the current computer and enter a large value of 800 000, as shown below:

Worker, select two processors, and then execute, as shown in figure

The execution result is as follows:

As you can see, the speed is nearly doubled because two CPU cores are used. When running the program, you can open the resource and manager to view the CPU usage. for dual-core CPUs, the CPU usage is 50% for Single-core CPUs and 100% for dual-core CPUs.

Test 2: Cluster Test

When using a cluster for computing, run the command line in cmd.

Command line format is similar to: mpiexec-hosts n IP1 ip2... d:/MPI/cpi.exe

N is the number of computer nodes to be used, and IP1/ip2 is the IP address of the computer. The following uses two computer nodes (count as the local machine ):

We can see that the effect is similar to that of using dual-core.

When three computer nodes are used, the results are as follows:

It can be seen that the time spent is nearly 1/3 of the CPU core used by a single machine. It can be said that the more computer nodes in the cluster, the faster the processing speed, and the more efficiency is almost linear.

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.