Académique Documents
Professionnel Documents
Culture Documents
Process zero first reads in the size of the message and sends the message size to all
other processes in the ring. After that, it creates a message of the specified size and
sends it to the next process in the ring, and then waits for the message to complete
its trip around the ring and receives it from the last process. Process zero measures
how long time it takes before the message has completed a round through the ring
of processes, using MPI_Wtime.
The other processes in the ring receive the message from their predecessor and
send it further to the next process.
After a message has been sent one round through the ring, process zero reads a new
message size from the user, and repeats the operation. The program terminates
when the user enters a message size of zero. Make sure that all processes terminate
correctly.
The program should print out how long time the communication around the ring
took, the message size and the number of processes that participated. Test the
program and make sure that it works correctly both with small messages (a few
bytes) and with large messages (up to a gigabyte) and on process counts from two
up to 48.
Implement this program with C or C++ and MPI on Asterope. Make sure that the
program follows the given specification and implements all described behaviour.
Test the program carefully and verify that it works for varying message sizes and
numbers of processes.
1/1