Professional Documents
Culture Documents
SCHOOL OF COMPUTING
SUPPLEMENTARY EXAMINATION FOR
Semester 2: 2002/2003
CS-3211: PARALLEL AND CONCURRENT PROGRAMMING
21 MAY 2003
INSTRUCTIONS TO CANDIDATES
1. This examination paper
ontains
printed pages.
FOUR(5)
ELEVEN (11)
MATRICULATION NO:
Max
Marks
(10) 10
(4,6) 10
(4,6) 10
(6,8,6) 20
(10) 10
60
Remark
a0
1
X
j =1
aj os
2jt
T
+ bj sin
2jt
T
0
0
1
1
0 2 1
2 3 1
B
3 0 1 C
1 0 4 C
A
A and B
1
1 2
Slave Pi (i>0)
b
ast(slot,P0);
for(j=0;j<slot;j++)f
re
v(&k,&a,P0);
b = a - 1024;
send(&k,&b,P0);
for(i=0;i<npro
;i++)f
re
v(&j,&b,Pi)
a[j = b;
for(k=0;k<max;i++)
print a[k;
Suppose max = 10, initially a[i = 2003 for all i = 0,..,max-1, and syn
hronous send/re
eive
routines are used. Questions:
1. What is the result of the exe
ution when 3 pro
esses (master and 2 slave pro
esses) are
used?
2. What is the result of the exe
ution when 4 pro
esses (master and 3 slave pro
esses) are
used?
2. int a[100;
Problem:
Suppose the surfa
e of a planet is des
ribed by the formula h(; ), where h is
the height above or below the sea level, is the angle in the equatorial plane,
and is the angle in the polar plan.
An example may be: h(; ) = 124 sin(2)
Question 4.1:
1. Develop a parallel hill-
limbing message-passing algorithm for the above HighestPoint
problem. (Give an informal presentation of the algorithm here.)
2. Brie
y motivate your
hoi
e,
ompared with other possible parallel programming solutions.
10
optimal
broad-
End-Of-Paper
11