

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Spring ’09: CS415/515 Advanced Parallel Programming 5/07/ Prof. Jingke Li(FAB 120-06, [email protected]); Classes: TTh noon-1:50pm @ FAB150; Office Hours: TTh 10-11am.
This project is to practice basic message-passing programming with the LAM MPI system. For this project, you’ll need to use the CS Linux machines.
african chatham chinstrap emperor erect-crested fiordland galapagos gentoo king kororaa little macaroni magellanic rockhopper royal snares white-flipper yellow-eyed
You may want to create two host files, one containing just two notes for debugging use, and the other containing all nodes for timing use.
mpirun -v N ring 8442 ring1 running on n0 (o) 4962 ring1 running on n 7165 ring1 running on n 23380 ring1 running on n rank 1 received integer 10 rank 1 sent integer 9 rank 2 received integer 9 rank 2 sent integer 8 rank 3 received integer 8 rank 3 sent integer 7 rank 0 sent integer 10 rank 0 received integer 7
(a) The program reads in two command-line arguments, low and high; and convert them both to integers. Verify that low <= high. (Note: In LAM/MPI, command-line arguments are passed at the end of mpirun command with a preceding double dash --, e.g.: mpirun N
(b) The program allocates an integer array of size high. (Process 0 may initialize its array with any values, though it’s optional.) (c) The program executes a sequence of tests. In each test, a message of certain size gets sent around the ring from process 0. (The message eventually gets back to process 0.) The allocated array serves as both the send and receive buffers. (d) The message sizes for the tests are defined by the number of array elements to be sent/received, ranging from low to high, with each test doubles the previous test’s message size. So the sequence of tests can be expressed by the following loop header for (cnt = low; cnt <= high; cnt *= 2) (e) Use MPI Wtime() routine to collect timing result for each test: for each test process 0 call Wtime (start clock) send message around the ring process 0 call Wtime again (stop clock) process 0 computes the elapsed time Don’t forget to delete all printf statements before conducting timing measurements. (f) The program should repeat the tests 5 times. And it should compute the min, max, and average of the elapsed time for each test. At the end, the program should print out the timing results.
Execution Requirements:
What to Turn In:
Zip your two programs and a short summary about the project; submit it to [email protected]. (Note: From this project on, please submit to my email account.)