next up previous
Next: fourth.c in detail Up: Running fourth.c under Previous: The discussion

Workers' logs

In order to see workers' logs, type something similar to:

gustav@jupiter:~/mpi/simplempi 209 $ rsh diana cat /tmp/gustav_log
received broadcast from 5
received a message from 5, tag 9
sent row 9 to 5
received a message from 5, tag 20
sent row 20 to 5
received a message from 5, tag 32
sent row 32 to 5
received a message from 5, tag 44
sent row 44 to 5
received a message from 5, tag 56
sent row 56 to 5
received a message from 5, tag 68
sent row 68 to 5
received a message from 5, tag 80
sent row 80 to 5
received a message from 5, tag 92
sent row 92 to 5
received a message from 5, tag 100
exiting on  tag 100
gustav@jupiter:~/mpi/simplempi 210 $

You can see that the worker process is informed about the matrix row number, which it has received in the message, through the message tag value. When the answer is sent back to the master process the same tag value is used, so that the master can put the answer in an appropriate slot.

When the worker process receives a message with tag value 100 (the highest row number of the matrix is 99), it interprets it as a termination signal and exits.



Zdzislaw Meglicki
Tue Feb 28 15:07:51 EST 1995