# mpi | openmp – Parallel and Distributed Computing Assignment 1

### Parallel and Distributed Computing Assignment 1

mpi | openmp – 该题目是一个常规的mpi的练习题目代写, 包括了mpi/report等方面, 这个项目是并行运算代写的代写题目

2023/3/23 20:31 assignment 1 Final: Parallel and Distributed Computing (3305_7305 Combined)

### Assignment 1 Final

``````See the page Assignment 1 Introduction
You should finish the Milestone (https://myuni.adelaide.edu.au/courses/85261/pages/assignment-1-
milestone) before beginning this part.
Your task here is to write an  mpi program for a set of tasks communicating in a ring topology.
On page 37 (https://www.sciencedirect.com/science/article/pii/B9780123742605000026#p37) of
the textbook, you can see a picture of processors connected by a ring interconnect.
In such a network, it is only possible for a given processor to communicate directly with either its
left or its right neighbour. We are going to try to emulate this behaviour with MPI tasks. Hence,
when emulating ring communication, point to point communication events must always have
immediate neighbours as source and destination.
We are going to be mostly concerned with moving numbers in a circular fashion around the ring.
Send m to the right
``````
``````Remembering that m is local to each task, this has the effect of shifting the set of m values one
element to the right.
For example, consider four tasks, such that in task j, variable m has the value j.
In other words, in task 0, m is 0, in task 1, it is 1 and so on.
Then, before we execute the code above, the m values will be: 0, 1, 2, 3.
After the code is executed, we will have: 3, 0, 1, 2.
Draw a diagram showing the four tasks, and the communication events, to make sure that you
understand this.
Also, write down the left and right neighbours of each task.
For example, the left neighbour of task 2 is 1, its right neighbour is 3.
We are asking you to carry out these steps:
``````
1. Initialise the m -values in each task, by having each task generate a random integer between 10 and 20 and using that as its m -value.
2. Do a left circular shift of the m -values three places to the left by shifting values to the left, 3 times, around the ring. In the example above, the result after execution will be: 3,0,1,2.

2023/3/23 20:31 Assignment 1 Final: Parallel and Distributed Computing (3305_7305 Combined)

``````Your assignment will be assessed both on your program, and a report. In the report, we ask you