MPI Learning notes--MPI Environment configuration

Source: Internet
Author: User
Tags ssh server
The first step is to install the SSH server and client under Ubuntu
Open new, type OpenSSH in all, select Openssh-client and openssh-server tags to install the application, or directly execute
$ sudo apt-get install openssh-client openssh-server


Second Step installation Mpich
Open the new stand, type MPI in all, select Mpi-bin, Mpi-doc, libmpich1.0-dev tag installation application


$ sudo apt-get install mpi-bin mpi-doc Libmpich1.0-dev


Third Step test Installation
$ Touch hello.c
Type the following to HELLO.C
1 #include <mpi.h>
2 #include <stdio.h>
3 int main (int argc, char *argv[])
4 {
5 int npes, Myrank;
6 Mpi_init (&AMP;ARGC, &AMP;ARGV);
7 mpi_comm_size (Mpi_comm_world, &npes);
8 Mpi_comm_rank (Mpi_comm_world, &myrank);
9 printf ("From process%d of%d, Hello world!\n", Myrank, NPEs);
Ten mpi_finalize ();
11}
$ mpicc-o Hello hello.c
$ MPIRUN-NP 2 Hello #应该会输出两次Hello, the middle may require a password, if you do not want to enter the password, look at the fourth step


Fourth step to remove the SSH password step
$ ssh-keygen-t DSA #中间提示输入密码, direct return, will be generated in the file ~/.ssh/id_dsa.pub
$ cat Id_dsa.pub >> Authorized_keys
$ MPIRUN-NP 2 Hello #应该没有密码输入提示了

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.