Is there a way to check if some processes are waiting on MPI_Recv?
I have a root proc, and some slave processes.
Slave psedo-code:
while (1) {
do_some_stuff; // calls MPI_Test and clear unused buffers
MPI_Recv(buf, ...);
do_something_with_buf;
MPI_Isend(buf2, ...); // possibly many sends depending on what was in buf
}
If all slave processes hang on MPI_Recv, then job is done and I need to brake the loop. Now I need some way to notify slave processes that job is done. Is there any way to do this? I thought there might be something like reverse probe to check if anyone waits for message instead of checking if there is a message to recieve. Haven't found anything useful tho.
Edit: some more explanation.
I have one root proc, which reads a huge file and sends read data to workers(rest of processes). Each worker recieves a portion of data, so its well distributed(each worker has roughly same amount of data stored). Then those workers start to communicate with each other sending partial computations. When a worker recieves a partial computation it may produce a lot of new partial results, some of which need to be sent to other workes. The work is done when all workers have nothing to do and there are no more partial results waiting to be recieved.