Use MPICH and IntelFortran for Parallel Computing in Ubuntu

Source: Internet
Author: User
The following is a summary of settings that Y has recently made when using mpi for Parallel Computing of a program. Because intelfortran (on intelcpu) is efficient, you want to configure intelfortran for parallel computing, record backup here ...... For more information about mpi, see the introduction. The master node is the computer that controls other nodes for computation. we name it node0. The slave node slavenode is the compute node named node1.

The following is a summary of the settings that Y has recently made when using mpi for Parallel Computing of a program. Due to the efficiency of intel fortran (on intel cpu, so to configure intel fortran for parallel implementation, record the backup here ......

For more information about mpi, see the introduction.
The master node of the master node is the computer that controls other nodes for calculation. we name it node0.
The slave node, slave node, is the node for computing. It is named node1 ~ Noden

1. Set Network File System (NFS) (Network File System/Need for Speed), which is the basis for Parallel Computing. All nodes must be able to read and write the same Network path for Synchronous computing. It should be noted that if you only run this program on a computer (for example, you have multiple processors or multiple cores), you can skip this step and proceed directly to the second step ......

First install NFS server
Sudo apt-get install nfs-kernel-server
Configure sharing
Create a shared folder on the master node, or you can specify a shared folder by yourself ......
Sudo mkdir/sharing
Set sharing
Sudo cat/mirror * (rw, sync)>/etc/exports
Then you can run the nfs server.
Sudo/etc/init. d/nfs-kernel-server start

To perform operations, you must set the directory mapped to the master node in each slave node ......
First, add the ip address of the master node
Sudo cat xxx: xxx node0>/etc/hosts # No one will input xxx...
Map from the node ......
Sudo mkdir/sharing
Sudo mount node0:/sharing

2. Next we need to set up ssh (secure shell) to prevent you from losing the password n times each time you run the mpi Program (How many threads are there ......), If your system security requirements are not that high, you can also choose to use rsh (in fact, I am just too lazy to set rsh)

First you need to install it ......
Sudo apt-get install ssh
Generate the DSA key on the master node. Note that the password is left blank during running.
Ssh-keygen-t dsa
Add the key to the trusted key:
Cd ~ /. Ssh
Cat id_dsa.pub> authorized_keys
Then try to connect with ssh username @ machinename. In addition, all nodes must have the same user (such as mpiusr), so that the master node can communicate with other nodes through ssh (Remote logon) and control other nodes for computation.

3. You need to install interl fortran later. SeeHere...... By the way, the current Intel fortran for linux is renamedIntel? Fortran Composer XE 2011 for Linux and Mac OS XStrange name ......

4. Then (finally) install mpi:
First, there are actually many mpi versions that can be used. You can install openmpi, mpich, and mpich2 on Ubuntu. In general, these versions are similar, and ...... In fact, although some versions are called open, some are not, they are all open source software ...... Mpich2 is installed here, and other versions are similar to this setting. In addition, intel has its own mpi and parallel studio, which is highly efficient, but it charges fees ...... Unable to afford

For debian-based release users, it is very simple:
Sudo apt-get install mpich2 # note that mpich2 is installed instead of mpich

Or, if you want to update the version, you can download the source code on its official website for installation:

Http://www.mcs.anl.gov/research/projects/mpich2/

About a configure and a sudo make install ......

A little bit of settings:
First, you must go to the home directory ~ /Create an mpd. host file so that the host can know the number of machines that can be driven by it. For example, the file contains the following content:
Localhost
Node1
Node2
...
Noden

Create a conf file to set the password, for example:
Cat secretword = lalala >> ~ /. Mpd. conf
Then make sure that only you can read:
Chmod 600 ~ /. Mpd. conf

And you will be done! You can try to use mpdboot-n N # (N = the number of your nodes) to start the background program.
You can use mpitrace to check which nodes are used ......

Related Article

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.