mpi | openmp – Parallel and Distributed Computing Assignment 1

Parallel and Distributed Computing Assignment 1

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

ass代做 assignment代写 代写assignment

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 (
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 ( 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.
Think about this pseudocode. Remember that it is executed simultaneously by all tasks.
Send m to the right
Receive m from the left
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.
Think carefully about tasks 0 and 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) 2 / 2

  1. After that is done, each task outputs its m -valu e. The outputs must be ordered based on rank. You must use point-to-point communication only to implement this ordering. Make sure to print out a record of each communication. For example, before a Send operation, output something like this: "Task 0 sending number 5 to task 3". And after a Receive operation, something like this: "Task 3 received number 5 from task 0".
Your assignment will be assessed both on your program, and a report. In the report, we ask you
to explain certain aspects of your program, and to provide a summarised version of its output. The
program will constitute 60% of the assessment for this assignment, and the  report 40%.
Include the following in your report:
  1. A clear and concise explanation in words of how you achieve a circular shift one place to the left;
  2. A clear and concise explanation in words of your strategy for achieving ordered output;
  3. An extract from the printed record of communication, showing only the interactions between tasks 0 and 3;
  4. A copy of the ordered output of m -values. Items 3 and 4 must be included separately in the report. The report should be about 1000 to 1200 words in length. Your program will be assessed on the clarity of the code itself and of the comments associated with that code, as well as the actual output. In the comments that you write for your code, make sure to clearly explain how you implement the neighbour relationship between tasks. Here is ( ( an example of a program that is notable for the clarity of both comments and code. The program is written in a different language, and for an unrelated topic, so that you can pay attention primarily to how well the comments explain the meaning of the program to someone reading it. That is what you should attempt to emulate in your own program.