Tag: openmpi

OpenMPI 1.4.3 mpirun hostfile错误

我试图在4个节点上运行一个简单的MPI程序。 我正在使用在Centos 5.5上运行的OpenMPI 1.4.3。 当我使用hostfile / machinefile提交MPIRUN命令时,我没有输出,收到空白屏幕。 因此, 我必须杀死这份工作。 。 我使用以下运行命令:: mpirun –hostfile hostfile -np 4 new46 OUTPUT ON KILLING JOB: mpirun: killing job… ————————————————————————– mpirun noticed that the job aborted, but has no info as to the process that caused that situation. ————————————————————————– mpirun was unable to cleanly terminate the daemons on the nodes […]

打开MPI – mpirun在简单程序上退出并出错

我最近在我的计算机上安装了OpenMPI,当我尝试运行一个简单的Hello World程序时,它会退出并出现下一个错误: ——————————————————- Primary job terminated normally, but 1 process returned a non-zero exit code.. Per user-direction, the job has been aborted. ——————————————————- 这是该程序的源代码: #include #include int main(int argc, char *argv[]) { int size, rank; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); printf(“Hello\n”); MPI_Finalize(); return 0; } 这是我编译程序的方式: mpicc -o hello hello.c 我用它执行它 mpirun -np 2 […]

MPI_Isend和MPI_Irecv似乎导致死锁

我在MPI中使用非阻塞通信在进程之间发送各种消息。 但是,我似乎陷入了僵局。 我使用PADB( 请参阅此处 )查看消息队列并获得以下输出: 1:msg12: Operation 1 (pending_receive) status 0 (pending) 1:msg12: Rank local 4 global 4 1:msg12: Size desired 4 1:msg12: tag_wild 0 1:msg12: Tag desired 16 1:msg12: system_buffer 0 1:msg12: Buffer 0xcaad32c 1:msg12: ‘Receive: 0xcac3c80’ 1:msg12: ‘Data: 4 * MPI_FLOAT’ — 1:msg32: Operation 0 (pending_send) status 2 (complete) 1:msg32: Rank local 4 […]

使用MPI_Type_create_subarray发送时可以转置数组吗?

我试图在C中使用MPI转置矩阵。每个进程都有一个方形子矩阵,我想将它发送到正确的进程(网格上的“对面”),将其转换为通信的一部分。 我正在使用MPI_Type_create_subarray ,它有一个订单参数,分别是行主要和列主要的MPI_ORDER_C或MPI_ORDER_FORTRAN 。 我认为,如果我作为其中一个发送,并作为另一个接收,那么我的矩阵将被转换为通信的一部分。 然而,这似乎并没有发生 – 它只是保持非转置。 代码的重要部分如下所示,整个代码文件都可以在这个要点中找到 。 有没有人有任何想法为什么这不起作用? 这种方法是否应该进行转置工作? 我已经想过,在阅读了MPI_ORDER_C和MPI_ORDER_FORTRAN的描述MPI_ORDER_FORTRAN ,但也许没有。 /* ———– DO TRANSPOSE ———– */ /* Find the opposite co-ordinates (as we know it’s a square) */ coords2[0] = coords[1]; coords2[1] = coords[0]; /* Get the rank for this process */ MPI_Cart_rank(cart_comm, coords2, &rank2); /* Send to these new coordinates […]

OpenMPI MPI_Barrier问题

我使用MPI_Barrier的OpenMPI实现有一些同步问题: int rank; int nprocs; int rc = MPI_Init(&argc, &argv); if(rc != MPI_SUCCESS) { fprintf(stderr, “Unable to set up MPI”); MPI_Abort(MPI_COMM_WORLD, rc); } MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_rank(MPI_COMM_WORLD, &rank); printf(“P%d\n”, rank); fflush(stdout); MPI_Barrier(MPI_COMM_WORLD); printf(“P%d again\n”, rank); MPI_Finalize(); 对于mpirun -n 2 ./a.out 输出应为:P0 P1 … 有时输出:P0 P0再次P1 P1 这是怎么回事?

如何强制OpenMPI使用GCC而不是ICC? 是否需要重新编译OpenMPI?

我有一个为gcc编写的并行计算的C代码,我想在一个集群上编译它,显然它通过mpicc使用icc 。 将代码更改为icc友好似乎对时间要求太高,所以我想知道我是否可以要求OpenMPI使用gcc代替。 我没有该群集的管理员权限,我实际上更愿意不弄乱原始配置。 如果无法在例如Makefile设置,那么我希望在我的主目录中编译OpenMPI ,但是我需要一些指导,然后必须做什么。 你可以帮帮我吗? UPDATE1 Makefile包含 CC = mpicc CFLAGS += -DMPI 这里有一些OpenMPI文件 $ which mpicc /usr/bin/mpicc lrwxr-xr-x /usr/bin/mpicc -> opal_wrapper -rwxr-xr-x /usr/bin/opal_wrapper 如果我能为您提供更多信息,请告诉我。 UPDATE2 在Jeff的帮助下 ,我能够找到mpicc OpenMPI设置 $ more /usr/local/share/openmpi/mpicc-wrapper-data.txt project=Open MPI project_short=OMPI version=1.1.4 language=C compiler_env=CC compiler_flags_env=CFLAGS compiler=icc extra_includes= openmpi preprocessor_flags= compiler_flags=-pthread linker_flags= libs=-lmpi -lorte -lopal -ldl -Wl,–export-dynamic -lnsl -lutil -ldl […]

致命错误:mpi.h:没有这样的文件或目录#include

当我只编译脚本时 #include 它告诉我没有这样的文件或目录。 但是当我包含mpi.h的路径时 #include “/usr/include/mpi/mpi.h” (路径是正确的)它返回: In file included from /usr/include/mpi/mpi.h:2087:0, from lbm.cc:7: /usr/include/mpi/openmpi/ompi/mpi/cxx/mpicxx.h:35:17: fatal error: mpi.h: No such file or directory #include “mpi.h” ^ compilation terminated. 有人知道怎么修这个东西吗?

如何通过MPI加速这个问题

(1)。 我想知道如何使用MPI在下面的代码循环中加速耗时的计算? int main(int argc, char ** argv) { // some operations f(size); // some operations return 0; } void f(int size) { // some operations int i; double * array = new double [size]; for (i = 0; i < size; i++) // how can I use MPI to speed up this loop to […]

MPI中的动态内存分配

我是MPI的新手。 我写了一个简单的代码来显示使用多个进程的矩阵。 如果我有一个8×8的矩阵并用4个进程启动MPI程序,我的第1个进程将打印第2个2行,第2个线程将由第2个线程打印,然后将其自身分开。 #define S 8 MPI_Status status; int main(int argc, char *argv[]) { int numtasks, taskid; int i, j, k = 0; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &taskid); MPI_Comm_size(MPI_COMM_WORLD, &numtasks); int rows, offset, remainPart, orginalRows, height, width; int **a; // int a[S][S]; if(taskid == 0) { cout<<taskid<<endl; height = width = S; a = (int **)malloc(height*sizeof(int […]

Openmpi mpmd获得通信大小

我有两个openmpi程序,我这样开始 mpirun -n 4 ./prog1 : -n 2 ./prog2 现在我如何使用MPI_Comm_size(MPI_COMM_WORLD, &size)使得我得到大小值 prog1 size=4 prog2 size=2. 到目前为止,我在两个节目中都获得了“6”。