我正在尝试运行一个 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 hola.c -o hola
然后我运行我的程序:
mpirun -np 5 ./hola
(对于@Gilles)的输出
ls -1 hola
只是
hola
命令行的输出显示是这样的:
[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.
最佳答案
报告问题时,应始终包括导致错误消息的命令行。
不管怎样,看来你跑了
mpirun hola
代替
mpirun ./hola
关于linux - Mpi 程序与 linux 一起运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46636238/