Documente Academic
Documente Profesional
Documente Cultură
SCHOOL OF COMPUTING
EXAMINATION FOR
Semester 2: 2001/2002
CS-3211: PARALLEL AND CONCURRENT PROGRAMMING
April/May 2002
INSTRUCTIONS TO CANDIDATES
1. This examination paper
ontains
printed pages.
FOUR(4)
THIRTEEN(13)
MATRICULATION NO:
Max
Marks
(5,4,6) 15
(7,8) 15
(7,8) 15
(7,8) 15
60
Remark
Question 1.
(6 marks)
A parallel version of Moore algorithm (denoted by PMoore here) for single-sour
e shortest
path problem using de
entralized work pool method was presented in the le
tures. Apply
PMoore to nd the shortest path from 1 to 7 in the following weighted graph G:
|G has seven verti
es denoted by numbers from 1 to 7.
|The weights of the edges are: w12 = 1; w23 = 2; w34 = 3; w14 = 7; w45 = 3; w56 =
2; w67 = 1; w47 = 7 and the other edges have weight 0.
n :::
::: k
integer,
integer,
integer,
k do
[l0,. . . , m0, . . . are the labels of the statements; await(b) blo
ks the pro
ess until
ondition b is satised; || denotes parallel exe
ution.
1. Des
ribe two possible runnings for (53 ) on a single pro
essor (use sequen
es of labels
l0,. . . , m0, . . . to spe
ify them | the assignment and test statements are
onsidered
to be atomi
here).
(5)
2. Is await statement m1 ne
essary? What happens if it is deleted from the program?
(3)
10
S
S
S
S
S
S
(2) =
S
S
S
S
S
11
S
(4)
(3)
12
End-Of-Paper
13