Mid 1 Spring 2024
Mid 1 Spring 2024
____________________________ _____________________
Vetted by Vetter Signature
Instruction/Notes ● Attempt all questions on the provided space in the question paper.
● Even if you do use rough sheets, they should NOT be attached with final paper.
● If you find any ambiguity in a question, you can make your own assumption and
answer the question accordingly by stating your assumption.
Question # 1 2 3 4 5
Total Marks 8 5 6 8 8 35
Obtained
Marks
CLO # 1 1 1 3 1/3
Page 1 of 9
National University of Computer and Emerging Sciences
Correct answer: (A), (B), and (C) because if we just use a single code it will be SISD, if we use all cores
concurrently, it will be MIMD. And all modern computers have vector instructions, hence SIMD.
ii. Karp-Flatt metric can give us information for which of the following?
A) Serial code in terms of number of lines-of-code
B) Time proportion spent executing serial parts of the code
C) Any parallelization overheads
D) Number of processors used for parallelization
v. Different computers possess the same version of operating system when connected in the form of:
A) Cluster
B) Cloud
C) Network of workstations
D) None of the given option
Page 2 of 9
National University of Computer and Emerging Sciences
s is speed-up achieved.
Page 3 of 9
National University of Computer and Emerging Sciences
p Time (seconds) s f
1 2.17 −−− −−−
2 1.11 1.95 0.024
3 0.754 2.88 0.021
4 0.577 3.76 0.021
8 0.312 6.96 0.021
What can we infer about the quality of parallelism by looking at the data provided? Please point to
specific data to support your answer.
Solution:
Page 4 of 9
National University of Computer and Emerging Sciences
(a) What is the Maximum degree of concurrency, Critical Path Length, and Average Degree of
Concurrency of the task graph?
(b) Map the task dependency graph on five processes namely, Pa, Pb, Pc, Pd and Pe, to reduce the
idling time for the task processing. Please answer using the graph provided below and add a
short explanation.
Page 5 of 9
National University of Computer and Emerging Sciences
The mapping will be able to reduce the idling time in the task processing using the maximum degree
of concurrency of the task graph.
Page 6 of 9
National University of Computer and Emerging Sciences
Solution:
Divide the data based on the input and equally divide reasonable (but almost equal sized) data to
each task. In this example, data is small we can just use two tasks. One will do [38,27,43,3], and the
other will do [9,82,10]. They will independently run merge sort and will finally combine the result.
(c) In terms of potential for better concurrency (and better speedup) which one of the above two
are a better decomposition approach? (Just name it.)
Page 7 of 9
National University of Computer and Emerging Sciences
(d) Provide rationale for your above answer logically and succinctly.
For our small example, there seems to be a lot of interactions among tasks in the case of recursive
decomposition as the merging starts (for example to bring data from another processor and to merge
it, which is a serial work). On the contrary, the data based decomposition initially divides data for
processors and then they don’t have to interact until they have sorted their part. Since data size is
almost same, they will finish about the same time. We could use parallel tasks for merging (for
example if we had 4 sorted pieces, we could use 2 processes to merge, and finally one processor to
merge).
(a) Derive the total communication cost for a message of size w words to traverse d
communication links using cut-through routing. (Describe each parameter involved.)
[4 marks]
Graph 1
Page 8 of 9
National University of Computer and Emerging Sciences
Graph 2
Compute and compare the diameter and arc connectivity of the given graphs. What does it tell
about their performance? [2+2 marks]
Page 9 of 9