linux - Mpi 程序与 linux 一起运行

标签 linux mpi

我正在尝试运行一个 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/

相关文章:

linux - 在 Redhat 中如何从文件中提取文本并将其作为正文通过电子邮件发送?

linux - 在 BASH 中使用特殊字符从文件名中批量删除子字符串

python - FigureCanvasWxAgg 在 linux 的面板(或笔记本)中无法正确调整大小

c++ - 如何将 MPI 派生数据类型用于 3D 数组?

c++ - Linux c++错误: undefined reference to 'dlopen'

c - 从 Windows 到 Linux 的语法错误 Fluent UDF

java - 如何计算网络的延迟和带宽

mpi - MPI 中的图像处理

c - MPI 库 - 在数组上保存值时出现问题

c++ - MPI_Cart_Shift.Corner 邻域