$ cd example/ $ sudo make $ sudo ./hello_c //输出内容 Hello, world, I am 0 of 1, (Open MPI v2.0.4, package: Open MPI root@xuan-PC Distribution, ident: 2.0.4, repo rev: v2.0.3-102-gdb3ffbe, Nov 07, 2017, 120)
也可以使用命令行编译的方式
1 2 3 4 5
$ cd example/ $ sudo mpicc hello_c.c -o hello $ sudo ./hello //输出内容 Hello, world, I am 0 of 1, (Open MPI v2.0.4, package: Open MPI root@xuan-PC Distribution, ident: 2.0.4, repo rev: v2.0.3-102-gdb3ffbe, Nov 07, 2017, 120)