歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> Ubuntu配置和使用MPI的方法

Ubuntu配置和使用MPI的方法

日期:2017/3/2 11:42:10   编辑:Linux技術

  MPI是多點借口,在Ubuntu下使用時需要搭建mpi環境,下面小編將針對MPI在Ubuntu中的搭建和使用做個簡單介紹,感興趣的朋友可以來做個了解。

 Ubuntu配置和使用MPI的方法

  1、環境搭建

  終端:sudo apt-get install mpich2

  安裝的是mpich2的1.4.1版本。

  2、編譯

  終端:mpicc mpi_hello.c -g -Wall -o mpi_hello

  3、運行

  終端:mpiexec -n 《number of processes》 。/mpi_hello

  例:用4個進程運行程序

  mpiexec -n 4 。/mpi_hello

  上面就是Ubuntu配置和使用MPI的方法介紹了,一共分為三個步驟,即配置環境、編譯及MPI的運行,Linux其他系統的使用可做個參考。

Copyright © Linux教程網 All Rights Reserved