Build An MPI parallel computing environment in Ubuntu

Source: Internet
Author: User
Here, you can select an appropriate openmpi installation package. Here, I select keystore (hs is my user name ). 1. First extract the tarzxvf/home/hs/download/openmpi-1.6.2.tar.gz file. 2. Then execute

Here you can choose a suitable openmpi installation package, here I choose http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.2.tar.gz

The default value is/home/hs/download (hs is my user name ).

1. First extract the file tar zxvf/home/hs/download/openmpi-1.6.2.tar.gz.

2. then execute the cd openmpi-1.6.2

3. Execute./configure. After a while, the g ++ compiler is missing, so run sudo apt-get install g ++.

4. Run the command again after execution./configure to complete the configuration,

5. Run sudo make all install to install all the files to be installed,

6. Add the library sharing path for the/etc/profile file. (by default, the library file of MPI is in the/usr/local/lib directory ). Run sudo geidt/etc/profile and add an export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/local/lib

7. Make the configuration file take effect: source/etc/profile and then you can perform the test.

8. cd openmpi-1.6.2/examples

9. make

10. mpirun-np 4 hello_c

The running result is as follows:

It indicates that MPI is successfully installed!

However, there was an episode later. After I restarted, I ran mpirun-np 4 hello_c again and encountered the following problems:

Run source/etc/profile again and then run mpirun-np 4 hello_c. The program runs successfully!

I finally completed the MPI Environment in Ubuntu and started to write the program!

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.