next up previous
Next: Extractionmanipulation, and Up: Lesson 4 -- Previous: Compiling and running

fifth.c in detail

After obtaining the value of from the user, the master broadcasts it to other processes. Afterwards we select a random number server. This process, as I have remarked before, should not be the same as the master process:

server = (host_rank == pool_size - 1)? pool_size - 2 : pool_size - 1;
if (my_rank == server) i_am_the_server = B_TRUE;

Once the server process is selected, we have to create a new communicator, which does not contain that process.





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