Modify the output master to accept three types of messages from the slaves.
These types are
- Ordered output (just like the previous exercise)
- Unordered output (as if each slave printed directly)
- Exit notification (see below)
The master continues to receive messages until it has received an exit message
from each slave. For simplicity in programming, have each slave send the
messages
Hello from slave 3
Goodbye from slave 3
with the ordered output mode, and
I'm exiting (3)
with the unordered output mode.
You may want to use these MPI routines in your solution:
MPI_Comm_split
MPI_Send
MPI_Recv