Computer Science 335

Parallel Processing and High Performance Computing

Fall 2021, Siena College

**NOTE: There are now two due dates.** Please get up through Question 2
before class on Friday, October 1. The practice programs will be due
on Monday, October 4.

For this lab, you will write your first real message passing programs using MPI. We focus here on point-to-point communication. That is, sends and receives.

You may work alone or with a partner on this lab.

Learning goals:

- To learn about basic MPI point-to-point communication

Getting Set Up

You can find the link to follow to
set up your GitHub repository `p2p-lab-yourgitname` for this
Lab in Canvas. One member of the group should follow the
link to set up the repository on GitHub, then that person should
email the instructor with the other group members' GitHub usernames
so they can be granted access. This will allow all members of the
group to clone the repository and commit and push changes to the
origin on GitHub. At least one group member should make a clone of
the repository to begin work.

Please answer the lab questions in the `README.md` file in the
top-level directory of your repository.

Reading

Read Pacheco Ch. 3, Sections 1, 2 and 3, to learn about MPI's basic point-to-point communication capabilities.

Study and run each program that was included in your starter
repository. Note that can obtain copies of all examples from the
book's web site, and a copy of the examples has been placed on
noreaster in `/home/cs335/pacheco/ipp-source-use`. The
ones we are using today are in the `pacheco-ch3` directory in your
repository.

Gathering Timings

The trapezoidal rule program, if run with a sufficiently large number
of trapezoids (*e.g.*, large enough *n*), can take a significant amount
of processing time.

Some Programs for Practice

Here is my program's output:

0 sending 49152 to 1 0 received 98304 from 1 1 received 49152 from 0 1 sending 98304 to 0

For the next problem, we define the "recursive digit sum" of a number to be the end result of taking the number's digits, adding them up, then taking that sum's digits, adding them up, repeating this process until a single digit number results. So we always get a result in the range from 0 to 9.

For example, the "recursive digit sum" of 182,172 is 3, because the sum of the digits of 182,172 is 21, and the sum of 21's digits is 3.

My program's result for N=1048576 and 8 processes:

Proc 0 will compute from 0 to 131071 Proc 1 will compute from 131072 to 262143 Proc 2 will compute from 262144 to 393215 Proc 3 will compute from 393216 to 524287 Proc 4 will compute from 524288 to 655359 Proc 5 will compute from 655360 to 786431 Proc 6 will compute from 786432 to 917503 Proc 7 will compute from 917504 to 1048575 rank 0 local counts: [ 1 14564 14564 14564 14564 14563 14563 14563 14563 14563 Received from rank 1: [ 0 14563 14563 14563 14563 14564 14564 14564 14564 14564 Received from rank 2: [ 0 14564 14564 14564 14564 14564 14563 14563 14563 14563 Received from rank 3: [ 0 14564 14563 14563 14563 14563 14564 14564 14564 14564 Received from rank 4: [ 0 14563 14564 14564 14564 14564 14564 14563 14563 14563 Received from rank 5: [ 0 14564 14564 14563 14563 14563 14563 14564 14564 14564 Received from rank 6: [ 0 14563 14563 14564 14564 14564 14564 14564 14563 14563 Received from rank 7: [ 0 14564 14564 14564 14563 14563 14563 14563 14564 14564 global counts: [ 1 116509 116509 116509 116508 116508 116508 116508 116508 116508

Your program should produce similar outputs.

Submission

Commit and push!

Grading

This assignment will be graded out of 65 points.

Feature | Value | Score |

Question 1 | 5 | |

timers | 5 | |

Question 2 | 10 | |

mpiexchange.c | 10 | |

mpirds.c | 30 | |

Question 3 | 5 | |

Total | 65 | |