1. Homepage
  2. Programming
  3. DTS202TC Fundamentals of Parallel Computing - Assingment 1: Rotate a grayscale image

DTS202TC Fundamentals of Parallel Computing - Assingment 1: Rotate a grayscale image

Engage in a Conversation
XJTLUDTS202TCFundamentals of Parallel ComputingRotate a grayscale imageC

CourseNana.COM

Overview

The purpose of this assignment is to gain experience in C programming and parallel algorithm design. You are expected to write a C serial program to rotate a grayscale image (without parallelism), and provide a parallel algorithm design that speeds up the serial implementation. Identify the bottlenecks in your serial implementation and provide an outline of how you plan to parallelise the serial implementation. Highlight the performance improvements you expect after parallelisation and potential challenges you may have to overcome. You may include pseudo-code or explain your approach in plain English. CourseNana.COM

Learning Outcomes

 A. Identify serial and parallel algorithm. CourseNana.COM

 B. Appreciate basic principal and techniques in devising parallel algorithm. CourseNana.COM

 I. Apply common parallel algorithm patterns. CourseNana.COM

 K. Identify and solve a computational problem with parallel algorithm design and program. CourseNana.COM

Team policy

You are free to form your group up to 5 team members (with a minimum of two members), you need to submit all team members’ information before 13th Nov, 23:59 via LMO. Students who fail to do so will be randomly assigned to a team. Changes will not be allowed once the teams have been confirmed. CourseNana.COM

Avoid Plagiarism

 Do not submit work from other teams. CourseNana.COM

 Do not share code/work to students other than your own team members. CourseNana.COM

 Do not read code/work from other teams, discussions between teams should be limited to high level only. CourseNana.COM

 Do not use open-source code CourseNana.COM

CourseNana.COM

Algorithm 1
CourseNana.COM

CourseNana.COM

CourseNana.COM

1: new_height j height  cosine./ jCj width  sine./ j CourseNana.COM

2: new_width j width  cosine./ jCj height  sine./ j F Define the height and width of the new image rotated CourseNana.COM

3: CourseNana.COM

4: ori_centrew width=2 CourseNana.COM

5: ori_centre_h height=2 CourseNana.COM

6: new_centre_w new_width=2 CourseNana.COM

7: new_centre_h new_height=2 CourseNana.COM

8: for i D 0;1;2;:::;height                1 do CourseNana.COM

9:             for j D 1;2;:::;width          1 do CourseNana.COM

10: 11: CourseNana.COM

x y CourseNana.COM

width ori_centre height ori_centre CourseNana.COM

_ CourseNana.COM

_ CourseNana.COM

w CourseNana.COM

h CourseNana.COM

j CourseNana.COM

i F coordinates CourseNana.COM

of pixel with respect to the centre of original CourseNana.COM

image CourseNana.COM

12: CourseNana.COM

13:            new_x  x  cosine./ C y  sine./ CourseNana.COM

14:            new_y  y  cosine./               x  sine./ CourseNana.COM

15: 16: CourseNana.COM

new CourseNana.COM

new_x new_y image CourseNana.COM

 new_centre_  new_centre_ CourseNana.COM

w h CourseNana.COM

new_x new_y CourseNana.COM

1 CourseNana.COM

1 CourseNana.COM

F coordinates of pixel with respect to the centre of CourseNana.COM

17:   img_outŒnew_yŒnew_x img_inŒiŒj F make sure new_x and new_y are integers, and don’t forget to check the boundaries CourseNana.COM

18:            end for CourseNana.COM

19: end for CourseNana.COM

CourseNana.COM

1       Serial Version (30 points)

1.1      Image Rotation

Image rotation is one of the most common image processing algorithms. To complete the rotation we need to write the pixel value for each pixel in the new location. Using some High School geometry we can work out the relationship between the source coordinates (x, y) and the destination coordinates CourseNana.COM

(x0, y0) CourseNana.COM

x0 D x cos C y sin CourseNana.COM

(1) y0 Dx sin C y cos CourseNana.COM

A complete pseudocode has been provide in Algorithm 1. CourseNana.COM

You will see some dots after this simple rotation algorithm, don’t worry about that for this coursework. CourseNana.COM

1.2      Reading and Writing Image

You will need to read a PGM image, process the rotation, then write the rotated PGM image back to the file system. Plain PGM format is a simple grayscale graphic image format, each pixel is represented by its grey value number, with 0 being black and Maxval (defined in the PGM file) being white. The below image.pgm is given as an example, more detail pgm specifications can be found at http://davis.lbl.gov/Manuals/NETPBM/doc/pgm.html CourseNana.COM

image.pgm CourseNana.COM

CourseNana.COM

CourseNana.COM

P2 CourseNana.COM

24 7 CourseNana.COM

15 CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

  CourseNana.COM

0 0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 0 0 0 0 CourseNana.COM

0 CourseNana.COM

0 0 0 0 0 CourseNana.COM

0 CourseNana.COM

0 3 CourseNana.COM

3 CourseNana.COM

3 CourseNana.COM

3 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

7 CourseNana.COM

7 CourseNana.COM

7 CourseNana.COM

7 CourseNana.COM

0 CourseNana.COM

0 11 11 11 11 CourseNana.COM

0 CourseNana.COM

0 15 15 15 15 CourseNana.COM

0 CourseNana.COM

0 3 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

7 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 11 0 0 0 CourseNana.COM

0 CourseNana.COM

0 15 0 0 15 CourseNana.COM

0 CourseNana.COM

0 3 CourseNana.COM

3 CourseNana.COM

3 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

7 CourseNana.COM

7 CourseNana.COM

7 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 11 11 11 0 CourseNana.COM

0 CourseNana.COM

0 15 15 15 15 CourseNana.COM

0 CourseNana.COM

0 3 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

7 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 11 0 0 0 CourseNana.COM

0 CourseNana.COM

0 15 0 0 0 CourseNana.COM

0 CourseNana.COM

0 3 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

7 CourseNana.COM

7 CourseNana.COM

7 CourseNana.COM

7 CourseNana.COM

0 CourseNana.COM

0 11 11 11 11 CourseNana.COM

0 CourseNana.COM

0 15 0 0 0 CourseNana.COM

0 CourseNana.COM

0 0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 CourseNana.COM

0 0 0   0   0 CourseNana.COM

0 CourseNana.COM

0   0   0   0   0 CourseNana.COM

0 CourseNana.COM

CourseNana.COM

Your program should be compiled and executed by: CourseNana.COM

make CourseNana.COM

./rotate-image{degreeinint} CourseNana.COM

Your program read the im.pgm file and output an rotated image named im-rotated.pgm CourseNana.COM

2       Parallel Algorithm Design (30 points)

Now that you have a complete understanding of the task, do the following: CourseNana.COM

Identify and analyse the bottlenecks of your serial implementation using necessary profiling tools. (10 points), and CourseNana.COM

 provide a design of a solution to speed up using parallel programming (20 points). CourseNana.COM

You do not need to do the actual coding for the parallel implementation, but only provide the detailed design with maximum 500 words. You may include pseudo-code or explain your approach in plain English. Highlight the performance improvements you expect after parallelisation and potential challenges you may have to overcome. CourseNana.COM

3       Peer Assessment (30 points)

Please review your peers based on the actual contributions. This will be done on LMO anonymously, each of the group members should login their LMO account and submit the marks individually. Marks should be submitted as soon as the group work submission is done. Peer review rubrics are attached in the appendix table. CourseNana.COM

4       Submission (10 points)

One of the group members must submit the following files: CourseNana.COM

 rotate-image.c C code of the serial implementation . CourseNana.COM

 A Makefile that will compile your code, make sure the output executable names are correct. CourseNana.COM

 A report.pdf file contains all the source code and the parallel design. You should also include the Cover Page with the student ID of all group members (template can be found on LMO) in the first page of your pdf. CourseNana.COM

Once you have all the files, please put them in a single directory (named groupid-A1) and compress them into to a single .zip file. You must follow the following structure: CourseNana.COM

CourseNana.COM

The assignment must be submitted via Learning Mall to the correct drop box. Only electronic submission is accepted and no hard copy submission. All students must download their file and check that it is viewable after submission. Documents may become corrupted during the uploading process (e.g. due to slow internet connections). However, students themselves are responsible for submitting a functional and correct file for assessments. CourseNana.COM

Please note that quality of report and correctness of submission will also be marked (10 points in total, 5 points for the quality of report, 5 points for the correctness of submission). CourseNana.COM

Table 1: Peer Review Rubrics CourseNana.COM


CourseNana.COM

Marks  10        7          4          0 CourseNana.COM

Contributions   Routinely provides   Usually provides   Sometimes   Rarely provides useful ideas when   useful ideas when   provides useful   useful ideas when participating in the   participating in the   ideas when   participating in the group discussion.   group discussion.   participating in the   group discussion. CourseNana.COM

A leader who   A strong group   group discussion. A   May refuse to contributes a lot of   member who tries   satisfactory group   participate. CourseNana.COM

effort.           hard!    member who does CourseNana.COM

what is required. CourseNana.COM

Problem           Actively           looks    Refines           solutions          Does not suggest or    Does   not            try       to solving         for      and      suggests           suggested       by         refine solutions, but    solve problems or solutions    to          others.             is willing to try out     help    others  solve problems.              solutions suggested    problems.       Lets by others.             others do the work. CourseNana.COM

Working with    Almost            always  Usually           listens  to,         Often  listens  to,         Rarely listens  to, others  listens to,        shares  shares,            with,    and       shares with,    and       shares with,    and with, and supports    supports the efforts    supports the efforts    supports the efforts the         efforts of          of others. Does not           of        others, but        of others.        Often others.   Tries     cause "waves" in the    sometimes is not a       is not a good team to keep     people  group.              good team member.     player. CourseNana.COM

working       well together. CourseNana.COM


CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
XJTLU代写,DTS202TC代写,Fundamentals of Parallel Computing代写,Rotate a grayscale image代写,C代写,XJTLU代编,DTS202TC代编,Fundamentals of Parallel Computing代编,Rotate a grayscale image代编,C代编,XJTLU代考,DTS202TC代考,Fundamentals of Parallel Computing代考,Rotate a grayscale image代考,C代考,XJTLUhelp,DTS202TChelp,Fundamentals of Parallel Computinghelp,Rotate a grayscale imagehelp,Chelp,XJTLU作业代写,DTS202TC作业代写,Fundamentals of Parallel Computing作业代写,Rotate a grayscale image作业代写,C作业代写,XJTLU编程代写,DTS202TC编程代写,Fundamentals of Parallel Computing编程代写,Rotate a grayscale image编程代写,C编程代写,XJTLUprogramming help,DTS202TCprogramming help,Fundamentals of Parallel Computingprogramming help,Rotate a grayscale imageprogramming help,Cprogramming help,XJTLUassignment help,DTS202TCassignment help,Fundamentals of Parallel Computingassignment help,Rotate a grayscale imageassignment help,Cassignment help,XJTLUsolution,DTS202TCsolution,Fundamentals of Parallel Computingsolution,Rotate a grayscale imagesolution,Csolution,