Ubuntu环境MPI使用

字体大小: 中小 标准 ->行高大小: 标准

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相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/63911.html