Mpi程序用linux运行

问题描述 投票:0回答:2

我试图运行一个mpi程序,但我有一些安装问题。我从存储库中获取数据包,我可以编译我的程序,但是当我尝试运行程序时,我无法完成。好吧,我的程序比“Hello World”有点大,但我的问题是mpi库(我想是这样),而不是代码。这是我的“Hello World”并行(当然是西班牙语):

#include <stdio.h>
#include <mpi.h>

 int main(int argc, char *argv[])
 {
 int rank, size;

 MPI_Init(&argc, &argv);

 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 MPI_Comm_size(MPI_COMM_WORLD, &size);

printf("Hola Mundo! Soy el %d de %d\n", rank, size);

MPI_Finalize();

return 0;
}

当我使用mpicc时出现hola文件。

mpicc hello.c -o hello

然后我运行我的程序:

mpirun -np 5 ./hello

(对于@Gilles)的输出

ls -1你好

只是

你好

命令行的输出显示如下:

  [proxy:0:0@miMachine-LMint] HYDU_create_process 
   (./utils/launch/launch.c:75): execvp error on file hola (No such file 
  or directory)
   [proxy:0:0@miMachine-LMint] HYDU_create_process 
   (./utils/launch/launch.c:75): execvp error on file hola (No such file 
or directory)
[proxy:0:0@miMachine-LMint] HYDU_create_process 
(./utils/launch/launch.c:75): [proxy:0:0@patricio-LMint] 
HYDU_create_process (./utils/launch/launch.c:75): execvp error on file 
hola (No such file or directory)
execvp error on file hola (No such file or directory)
[proxy:0:0@miMachine-LMint] HYDU_create_process 
(./utils/launch/launch.c:75): execvp error on file hola (No such file 
or directory)




Well the thing is that i dont know what is the problem. 
linux mpi
2个回答
1
投票

报告问题时,应始终包含导致错误消息的命令行。

无论如何,似乎你跑了

mpirun hola

代替

mpirun ./hola

1
投票

好。我可以让它工作。我不是linux和安装包的专家。似乎有一个包到mpi文件编译,还有另一个包来运行mpi文件。我稍后安装了compile包和run packege。然后我“打开”运行包,我可以运行我的程序。首先我得到了编译器包。

apt-get install lam4-dev

其次,我得到了运行包。

apt-get install lam-runtime

第三,我打开了运行时包

lamboot

这是我的命令行输出。首先运行程序

mpirun -np 5 ./something

Hola! Soy el 0 de 5
Hola! Soy el 2 de 5
Hola! Soy el 1 de 5
Hola! Soy el 3 de 5
Hola! Soy el 4 de 5

感谢@Gilles的回答,对不起,如果我是一个菜鸟问题和我的英语。

© www.soinside.com 2019 - 2024. All rights reserved.