
CPSC 390 Project 5
Fall 2009
19 November 2009
Distributed Processing
ASSIGNED: 19 November 2009
DUE: 10 December 2009 (by the end of class.)
VALUE: 60 points
Overview: This Program Set provides exercises in the mechanisms of distributed program-
ming (using message passing, RPC and rendezvous) in the SR language. Also important
here is your ability to design and program to specifications, so solve the correct problems!
Tasks:
1. (10 points) Create a SR program for the task described in Exercise 7.1 of the class
text. For your array of Merge processes, use n= 15. Also:
•Drive the “‘leafs” of the merge tree with messages sent from a Main process. Each
input stream should send 8 numbers each, followed by EOS.
•Receive the output of the merge tree “root” in the Main process, and print it to
the standard output.
2. (10 points) Create a SR program for the task described in Exercise 7.3(a) of the class
text. Use n= 128, and use the SR random(...) function for the generation of values
sent to the first filter process.
3. (20 points) (Adapted from Exercise 7.20(a) of the class text.) Create a SR program
for two of the three programs in §7.4 (of the class text) for exchanging values. (Here
you pick which two of the communication structures in Figure 7.14 that you want to
implement.) Also:
•Seed all programs with the same seed value (so that you can obtain the same
sequence of pseudo-random numbers).
•Have the number of processes, n, sent as a command-line argument. Each process
should call int(random(...)) to obtain a local value.
•Use the SR age() command to print the total time taken by each program to
complete the problem.
1