【发布时间】:2016-04-22 20:13:47
【问题描述】:
我遇到了一个类似于in this topic 讨论的问题,我有一个 MPI 代码,它对具有特定行数的向量的行求和。我附上the code here。
当我尝试用一个核心在线编译mpirun -n 1 ./program时,我得到:
500000 sum 125000250000.00000 calculated by root process.
The grand total is: 125000250000.00000
因为我只有一个计算总和的核心,所以看起来没问题。但是当我尝试使用多核 mpirun -n 4 ./program 时,我得到:
please enter the number of numbers to sum:
500000
[federico-C660:9540] *** An error occurred in MPI_Recv
[federico-C660:9540] *** on communicator MPI_COMM_WORLD
[federico-C660:9540] *** MPI_ERR_TRUNCATE: message truncated
[federico-C660:9540] *** MPI_ERRORS_ARE_FATAL (your MPI job will now abort)
sum 7812562500.0000000 calculated by root process.
--------------------------------------------------------------------------
mpirun has exited due to process rank 1 with PID 9539 on
node XXXXX1 exiting without calling "finalize".
我也为 C 程序 here 红色了类似的问题。 2 和 3 处理器也是如此。
有人可以帮我找出问题所在吗?我的猜测是我在与“发送者”相关的 MPI_RECV 调用中犯了一个错误。
【问题讨论】:
-
请在此处内联您的代码。如果它是 MCVE,它应该很容易适应。
标签: fortran mpi fortran90 gfortran openmpi