I'm trying to implement a 1d partitioning breadth first search using MPI_Alltoall communication (to simulate distributed memory). But compiling the code gives the following error:
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
Here's my code (a part of it):
//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);