C++ &引用;PMPI_Waitall中的致命错误:无效计数,错误堆栈;用MPI_Alltoall
我正在尝试使用MPI_Alltoall通信(模拟分布式内存)实现一维分区广度优先搜索。但是编译代码会产生以下错误:C++ &引用;PMPI_Waitall中的致命错误:无效计数,错误堆栈;用MPI_Alltoall,c++,mpi,breadth-first-search,C++,Mpi,Breadth First Search,我正在尝试使用MPI_Alltoall通信(模拟分布式内存)实现一维分区广度优先搜索。但是编译代码会产生以下错误: PMPI_Waitall(392): MPI_Waitall(count=-1, req_array=0x7fff6c8c17a0, status_array=0x1) failed PMPI_Waitall(359): Negative count, value is -1 [unset]: write_line error; fd=-1 buf=:cmd=abort exitc
PMPI_Waitall(392): MPI_Waitall(count=-1, req_array=0x7fff6c8c17a0, status_array=0x1) failed
PMPI_Waitall(359): Negative count, value is -1
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=940193794
:
system msg for write_line failure : Bad file descriptor
这是我的代码(它的一部分):
您没有选中
send\u flag
和rcv\u flag
。根据文档,如果调用MPI_Iprobe
后这些标志为false
,则状态为未定义。请参阅示例。如果问题仍然存在,请发布一个。注意:您的代码建议您使用MPI\u Probe()
而不是MPI\u Iprobe()
,或者您甚至没有收到正在探测的缓冲区。
//get status of send and recieve count:
int send_flag;
MPI_Status send_status;
MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &send_flag, &send_status);
int rcv_flag;
MPI_Status rcv_status;
MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &rcv_flag, &rcv_status);
int send_count;
int rcv_count;
MPI_Get_count(&send_status, MPI_INT, &send_count);
MPI_Get_count(&rcv_status, MPI_INT, &rcv_count);
//send N_p to all other processes with MPI_Alltoall
int rcv_buffer;
MPI_Alltoall(&N_p, send_count, MPI_INT, &N_p_rcv, rcv_count, MPI_INT, MPI_COMM_WORLD);