Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/155.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ &引用;PMPI_Waitall中的致命错误:无效计数,错误堆栈;用MPI_Alltoall_C++_Mpi_Breadth First Search - Fatal编程技术网

C++ &引用;PMPI_Waitall中的致命错误:无效计数,错误堆栈;用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

我正在尝试使用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 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);