MPI执行程序:mpirun was unable to launch the specified application as it could not access or execute ……

错误:

在linux上安装完MPI后,想执行一下自带的例子测试一下,执行下面命令:

mpirun -np 4 ./examples/cpi

报出下面错误: 

--------------------------------------------------------------------------
mpirun was unable to launch the specified application as it could not access
or execute an executable:

Executable: ./hello
Node: c311a22b76d4

while attempting to start process rank 0.
--------------------------------------------------------------------------
4 total processes failed to start

解决:

猜测,可能是我安装的时候,没有安装例子,或者有,但是我也不知道路径。也就是说,这里执行例子时,需要添加绝对路径。

我自己在当前目录下写了个测试程序进行测试

#include <mpi.h>
#include <stdio.h>
int main(int argc, char **argv)
{	 
	 int numtasks, rank;
  	 MPI_Init(&argc, &argv);
    	 printf("Hello parallelworld!\n");
      MPI_Finalize();
    return 0;
}

执行命令:

mpicc -o a test.c
mpirun -np 32 a

运行成功:

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值