Mid Semester Examination (April 2014)

3y ago
46 Views
5 Downloads
277.32 KB
14 Pages
Last View : 11d ago
Last Download : 3m ago
Upload by : Rosa Marty
Transcription

Mid Semester Examination (April 2014)High Performance Scientific Computing(COMP3320/COMP6464 )Writing period : 90 Minutes durationStudy period : 15 Minutes durationPermitted materials : NONEThe questions are followed by labelled, framed blank panels into which your answers MUSTbe written. Extra boxes are given at the end of the paper. No additional paper will beprovided. Writing outside of the boxes may not be marked.This exam is marked out of 60. You must answer all questions.Your mark for this exam will contribute at most 15% of your total course mark, according tothe marking scheme given on the course web page.Student Number:The following are used by your friendly examiner!Q1 markQ2 markCOMP3320/COMP6464Q3 markQ4 markMid semester exam 2014Total markPage 1 from 14

Question 1: Timing [15 total marks](a) In the standard distributions of Linux/Unix the following two library calls:#include sys/times.h clock t times(struct tms *buf);#include sys/time.h int gettimeofday(struct timeval *tv, struct timezone *tz);are used to obtain the “process time” and the “wall clock time” respectively.(i) What is meant by “process time” and “wall clock time”?(ii) In timing your application code, when would you use process time and whenwould you use wall clock time?(iii) The process time is usually broken down into “user” and “system” components.What is included in each of these components?[7 marks]COMP3320/COMP6464Mid semester exam 2014Page 2 from 14

Student Number: (b) When using a timer to measure the performance of your application code, it isimportant to know the “resolution” and “overhead” associated with that timer.(i) Define timer resolution and timer overhead.(ii) Timers that report process time typically have a lower resolution and a higheroverhead than timers that report wall clock time. Explain why this is and providetypical values for the resolution and overhead associated with each type of timer.[8 marks]COMP3320/COMP6464Mid semester exam 2014Page 3 from 14

Question 2: CPU Architecture [15 total marks](a) Modern processors make extensive use of pipelining. Explain the concept ofpipelining using an example that is unrelated to computing.[2 marks](b) Data dependencies impact on the ability to pipeline.(i) Give a few lines of code containing a for loop where there is a data dependencybetween iterations of the loop. Clearly indicate the dependency.(ii) Explain how a loop can contain a dependency between different iterations of theloop but can still be amenable to pipelining and producing the correct answers.[4 marks]COMP3320/COMP6464Mid semester exam 2014Page 4 from 14

Student Number: (c) Pipeline throughput depends on the number of independent operations and thepipeline depth(i) Define what pipeline depth means(ii) Sketch (and label) in the following graph the pipeline throughput N/Tpipe as afunction of N independent operations for:(A) a small size pipeline depth(B) a medium size pipeline depth(C) a large size pipeline depth[4 marks]COMP3320/COMP6464Mid semester exam 2014Page 5 from 14

(d) Name three concepts other than pipelining that have been developed to improveprocessor performance and briefly describe how they work.[5 marks]COMP3320/COMP6464Mid semester exam 2014Page 6 from 14

Student Number: Question 3: Memory architecture [15 total marks](a) Sketch C code that illustrates i) a cache friendly operation ii) a cache unfriendlyoperation. In both cases provide a brief explanation as to why you consider the codeto be cache friendly/unfriendly.[4 marks](b) Provide two fundamentally different reasons why a data item previouslyreferenced and brought into cache may no longer be present in cache whenreferenced a second time.[2 marks]COMP3320/COMP6464Mid semester exam 2014Page 7 from 14

(c) Explain what the following terms mean:(i) cache line(ii) cache thrashing(iii) cache miss[1.5 marks]COMP3320/COMP6464Mid semester exam 2014Page 8 from 14

Student Number: (d) To test the memory architecture of an unknown processor, you have written aprogram that allocates an array of size w (defined as working set size) and thenaccesses elements in this array with constant stride s. The array is allocated on a 4byte boundary and is accessed at 4 byte words. Shown below are measured readthroughputs.1000500working set size ad throughput (MB/s)1500read throughput (MB/s)read throughput for working set sizew 256kBread throughput for stride s 180060040020001 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16stride s (words)(i) Explain the observed read throughput in terms of the memory architecture in thisprocessor.[7.5 marks]COMP3320/COMP6464Mid semester exam 2014Page 9 from 14

Question 4: Performance tuning [15 total marks](a) Shown side by side below are two versions of functionally identical C code.void f1(int n, double a[], double b[],double c[], double d[],double y[], double z[]){int i;for (i 0; i n; i ) {y[i] a[i] / b[i];z[i] c[i] / d[i];}}void f1(int n, double a[], double b[],double c[], double d[],double y[], double z[]){int i;double tmp;for (i 0; i tmp 1.0 /y[i] a[i]z[i] c[i]}n; i ) {(b[i] * d[i]);* d[i] * tmp;* b[i] * tmp;}(i) Count data load, data store and floating point operations in both versions, anddiscuss expected performance differences.[5 marks]COMP3320/COMP6464Mid semester exam 2014Page 10 from 14

Student Number: (b) Rewrite the following C code snippets to improve serial performance on an Inteli7 processor (similar to what you use on raijin) without changing code functionality,and reason why your change improves performance. Assume that all vectors are ofsize [n], and all matrices are of dimension [n][n].(i) vector operationsm n/2for (i 0;a[i] }for (j 0;z[j] }i n; i ) {b[i]*c[i]j m; j ) {b[j]*y[j](ii) matrix transposefor (i 0; i n; i ) {for (j 0; j n; j ) {a[j][i] b[i][j]}}[4 marks][5 marks]COMP3320/COMP6464Mid semester exam 2014Page 11 from 14

(c) Shown below are two functionally identical C code snippets of the core loops in aJacobi algorithm. Assume a’s dimension to be a[2][n][n] and that the compiler doesnot change any instructions in the code you see below. Discuss the performance ofthe two codes as a function of the data size and hardware.t1 1;t0 0;for (i 1; i n-1; i ) {for (j 1; j n-1; j ) {a[t1][i][j] (a[t0][i][j 1] a[t0][i][j-1] a[t0][i 1][j] a[t0][i-1][j]) * 0.25}}t1 1;t0 0;for (i 1; i n-1; i ) {for (j 1; j n-1; j ) {a[t1][i][j] 0.25*a[t0][i][j 1] 0.25*a[t0][i][j-1] 0.25*a[t0][i 1][j] 0.25*a[t0][i-1][j]}}[7 marks][6 marks]COMP3320/COMP6464Mid semester exam 2014Page 12 from 14

Student Number: Continuation of QuestionPartContinuation of QuestionPartCOMP3320/COMP6464Mid semester exam 2014Page 13 from 14

Continuation of QuestionPartContinuation of QuestionPartCOMP3320/COMP6464Mid semester exam 2014Page 14 from 14

Your mark for this exam will contribute at most 15% of your total course mark, according to the marking scheme given on the course web page. The following are used by your friendly examiner! Q1 mark Q2 mark Q3 mark Q4 mark Total mark Student Number:

Related Documents:

MASTER OF SCIENCE (M.Sc.) ZOOLOGY First Semester – Fourth Semester (2-year programme) I Semester Examination November 2007 II Semester Examination April 2008 III Semester Examination November 2008 IV Semester Examination April 2009 Syllabus applicable for the students seeking a

MITSUBISHI METALWOOD CUSTOM SHAFTS OPTIONS mitsubishirayongolf.com Model Flex Weight Torque Tip Size Butt Size Launch Spin Tip Stiffness Fubuki J 60 X 66 3.9 0.335 0.600 Mid Mid Mid S 64 3.9 0.335 0.600 Mid Mid Mid R 61 3.9 0.335 0.600 Mid Mid Mid Fubuki J 70 X 74 3.6 0.335 0.600 Mid

2-semester project Semester 1 Semester 2 Semester 3 1-semester project Semester 2 Semester 3 BA to MA Student Semester 1 Semester 2 Select a faculty member to se rve as Project A dvisor Co m plete Project F orm #1, with A dviso r‘s signature, and file it with the Program Director Deve lop a wri tten Project Pr oposa l, and

Low Mid High Launch Spin Low Mid High Launch Spin KBS Hi-Rev 2.0 Wedge Flex R S X Tip.355" .355" .355" Weight (g) 115 125 135 Torque N/A N/A N/A Launch Mid Mid Mid Program Stock Stock Stock KBS TOUR 105 Flex R S X Tip.355" .355" .355" Weight (g) 105 110 115 Torque 2.5 2.5 2.5 Launch Mid-High Mid-High Mid-High Spin Mid-High M

Manajemen Akuntansi Keuangan Lanjutan 1 Taufan Adi K Muda Setia Hamid Aplikasi Perpajakan Uum Helmina C SEMESTER 5 A1 SEMESTER 5 A2 SEMESTER 5 A3 SEMESTER 5 A4 SEMESTER 5 A5 SEMESTER 5 A6 SEMESTER 5 A7 SEMESTER 5 A8 07.30-10.00 102 203 103 10.10-12.40 104 13.00-15.30 104 307 306 15.30-18.00 306 308 LTD 305 306

3 B. Arch. Sixth Semester Examination 3 4 B. Arch. Eighth Semester Examination 4 5 B. Arch. Tenth Semester Examination 5 5 Bachelor of Interior Design Second Semester Examination 6 . 24 M. Tech. (CSE-Software Engineering) II Sem-Full Time & IV Sem Part Time 42 25 M. Tech. (EE-Power Systems & Control ) II Sem

FUNAI Academic Calendar Uploaded online by www.myschoolgist.com.ng Directorate of Academic Planning 17/8/2015 Faculty Boards meet to consider 1st Semester results Wednesday 20th April, 2016 Mid-Semester Examination Monday, 25th April, 2016 - Friday, 29th April, 2016 Senate meet to approve 1st semester result Wednesday 27th April, 2016 Deadline for

September: 2013 33,391.18 9/24/2013 October: 2013 33,391.18 10/24/2013 December: 2013 65,031.50 12/20/2013 January: 2014 33,099.37 1/23/2014 February: 2014 33,099.37 2/24/2014 March: 2014 33,099.37 3/24/2014 April: 2014 31,662.23 4/25/2014 May: 2014 31,662.23 5/22/2014 June: 2014 31,662.24 6/26/2014 392,881.03