我正在尝试将MVAPICH2-GDR用于简单的hello world程序。虽然它可以成功编译代码,但它在运行时有分段错误错误。我的平台有Redhat 6.5和CUDA 7.5。所以我下载了rpm文件mvapich2-gdr-cuda7.5-intel-2.2-0.3.rc1.el6.x86_64.rpm。
MPI代码是简单的hello world程序:
1 #include <mpi.h>
2 #include <stdio.h>
3
4 int main(int argc, char** argv) {
5 // Initialize the MPI environment
6 MPI_Init(NULL, NULL);
7 // Get the number of processes
8 int world_size;
9 MPI_Comm_size(MPI_COMM_WORLD, &world_size);
10
11 // Get the rank of the process
12 int world_rank;
13 MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
14
15 // Print off a hello world message
16 printf("Hello world from %d out of %d\n", world_rank, world_size);
17
18 // Finalize the MPI environment.
19 MPI_Finalize();
20 }
为了编译程序,我使用了以下命令:
mpicc hello.c -o hello
运行程序:
mpirun -np 2 ./hello
错误消息如下:
[localhost.localdomain:mpi_rank_1][error_sighandler] Caught error: Segmentation fault (signal 11)
[localhost.localdomain:mpi_rank_0][error_sighandler] Caught error: Segmentation fault (signal 11)
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 188057 RUNNING AT localhost.localdomain
= EXIT CODE: 139
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11)
因为MVAPICH2-GDR没有打开它的源代码,所以我真的不知道错误的来源。有没有人成功使用过MVAPICH2-GDR?
答案 0 :(得分:1)
提升GPU-GPU通信的性能MVAPICH2-GDR使用新的GDRCOPY模块。您需要将MVAPICH2-GDR明确指向库,或通过设置MV2_USE_GPUDIRECT_GDRCOPY = 0显式禁用此功能的使用。
正如您所看到的,通过禁用此功能,我可以运行您的代码。有关详细信息,请参阅用户指南:http://mvapich.cse.ohio-state.edu/userguide/gdr/2.2rc1/
[hamidouc @ ivy1 mvapich2] $ export MV2_USE_GPUDIRECT_GDRCOPY = 0 [hamidouc @ ivy1 mvapich2] $ ./install/bin/mpirun -np 2 ./a.out 你好世界从0到2 Hello of world来自2个