I am not 100% sure I understand your situation. It it this?
Process A has an ongoing stream of inputs. For each input unit, A does some
processing and then passes on work to B via a message. B receives the
message from A and does some additional work before sending a message to C.
C receives th
I would suggest that if C receives some kind of quit command, it
should send that command to both A & B, and then call MPI_Finalize.
When A & B receive the quit command, they can complete whatever they
are currently doing (you'll have to set a flag so they know they
should do this), and the