I have 2 processes, one process is streaming out packets to another until an internal interrupt halt the process (the process which sends). I want to have a mechanism that the other process can receive until there is any message on this channel to be received.
is there any way to do that other than transferring the halt command as a message as well? I prefer not to send finish/interrupt as another message because there could be scenarios that the interrupt can kill the sender process.
if (world.rank() != 0) {
while (!interrupt())
world.send(ROOT, ID, a, bufferSize);
// I prefer not to send finish/interrupt as another message
}
else {
while (/*there is any packet to be received*/)
world.recv(boost::mpi::any_source, ID, a, bufferSize);
}