"Go" Linux MPI stand-alone configuration

Source: Internet
Author: User

The full name of MPI is the message passing interface, the standard messaging interface, which can be used for parallel computing. MPI has several implementations, such as Mpich, Chimp, and Openmpi. Here we use the Mpich version.

First, Mpich installation

Download: http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz

TAR-XZVF soft/mpich-3.0.4.tar.gz
CD mpich-3.0.4/
./configure--prefix=/usr/local/mpich
Make && make install

There is insufficient permission to use the

chmod 777/usr/local

Add the environment variable/etc/profile after installation and execute source/etc/profile

Path= $PATH:/usr/local/mpich/bin
Manpath= $MANPATH:/usr/local/mpich/man
Export PATH MANPATH

Two, single-node test

Copy the examples directory under the source code package to the installation directory

cp-r examples//usr/local/mpich

Perform

MPIRUN-NP./examples/cpi

The output results are as follows:

Process 0 of are on server150
Process 9 of are on server150
Process 1 of are on server150
Process 4 of are on server150
Process 5 of are on server150
Process 7 of are on server150
Process 2 of are on server150
Process 3 of are on server150
Process 6 of are on server150
Process 8 of are on server150

Pi is approximately 3.1415926544231256, Error is 0.0000000008333325
Wall clock time = 0.020644

If we want to compile the file now: Execute under/home/houqingdong: Mpicc-o Hello hello.c will be reminded:-BASH:MPICC command not found this is because we have not configured the path

Enter at the command line: Export path=/home/houqingdong/mpiexe/bin: $PATH Note: Here is only a temporary set of paths, after the restart effect will disappear, if you want to configure once and for all, please Google query

Take a look at the success of our configuration you can execute the Echo $PATH see if we have a path in the output.

It is not known here why the program that runs the Compute PI will only execute a process,

Manual compilation example of the following Hellow example, this time is correct

"Go" Linux MPI stand-alone configuration

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.