2

In MPI I can see if there are any messages waiting for a given process with MPI_Probe. That will tell me who sent me the message, its tag, and importantly how big it is. If for some reason a sender tries to send me a message that is too large (I don't have enough memory to process it), I want to ignore that message forever. "nope, that's too big. you weren't supposed to do that"

One way we came up with was to do a zero-byte receive of the message. We would then have to set an MPI error handler for just this one case to ignore "message truncated".

Another way would be to call MPI_Iprobe and skip over the message we do not want. The offending message is still there in the message queue, though, getting in the way (and maybe consuming resources we'd like spent elsewhere).

It feels like there should be a "zap this message" routine in MPI, but given how difficult it is to implement "cancel send" from the sender process, I can only imagine the difficulty when the receiver asks the sender to "cancel send"

Cong Ma
  • 10,692
  • 3
  • 31
  • 47
Rob Latham
  • 5,085
  • 3
  • 27
  • 44
  • 1
    Or: have the sending process check the max size that the receiving process will willingly handle (message a couple of ints to and fro) and simply don't send messages that are too large. That way the postman gets to relax too, not just the receiver. I expect you probably already rejected this approach for some reason or another. – High Performance Mark Sep 08 '15 at 15:33
  • It's definitely easier if the sender behaves, and perhaps that is why MPI has no such feature. Trying to guard against the possibility that a mis-configured sender will give us a headache (receive and ignore is fine on most platforms but on Blue Gene our memory constraints are pretty tight) – Rob Latham Sep 08 '15 at 15:37

0 Answers0