Sixth Homework Assignment
Posted 22 Mar 2004 by herman
Use or Implement Networked Linda. Due 24 March (group formation), due 26 March (interface specification for Network Linda), due 31 March (preliminary test versions), due 5 April (final work).
The assignment offers you a choice: either write two Linda parallel programs and adapt them to a multi-host version of Linda or work in a group to implement the multi-host, networked, version of Linda. Students who write the parallel programs are the "customers" of the students who implement the networked version (these students are the "providers").
First, read homework6.pdf to see what are the parallel programs and the techniques for writing a networked Linda.
If you're going to participate in a group homework -- you'll be a provider -- then you need to tell me by class time on 24 March who is in the group, and select at least one group representative to participate in an implementation standards meeting
If you are the representative of a group, then you need to meet with other group representatives before 26 March and decide on the interface and programming style of Network Linda; all groups must come to a consensus on the standard so that every customer can run the same application on the software of each provider with essentially no changes. This standard is due by class time on 26 March.
Preliminary versions of programs should be ready by 31 March; these preliminary versions will be used to test applications and the cooperation between customers and providers. Students will report on which versions work and where bugs or problems are found.
By 5 April, all the applications and versions of Network Linda are finished and emailed (use the usual style of "[22C078] hw6" in the subject line of the email).
Testing Application, posted 26 Mar 2004 by hermanI've written a trivial parallel program that sums values in an array. My simple program can be used to test the "NetworkLinda" system now being developed by several student groups.
The idea is to use different hosts for the parallel program rather than threads. My program design uses four hosts, although this was an arbitrary decision on my part -- it could have been any number of hosts. The first part of the program, part0.py, runs on one of the four hosts: it initializes the tuple space by using "Out" to place all the array elements into the tuple space. Three other parts of the program, part1.py, part2.py, and part3.py do the actual summing of array elements.
The idea for running the program is to put each part on a separate host, then execute them using the python command, doing so concurrently. The student groups will create a python module called NetworkLinda.py, and each part of the program will have as its first statement "import NetworkLinda.py" instead of "import Linda.py".
For testing (since the NetworkLinda wasn't ready when I wrote the program), I managed to use threading to simulate the hosts. The program testFsum.py uses threading to get each part running concurrently, using the standard Linda.py module.
For those of you programming sorting and integration programs for the homework, it could be useful to study my simple sum program and see if it is helpful to you in your own testing and development.
Network Linda, posted 29 Mar 2004 by hermanThe following document describes how to use Network Linda: netlinda.txt. The document gives a good idea of the interface and testing procedures. The main idea is this: you are responsible for finding some hosts (of course you could also just use several windows, so that different processes simulate using different hosts). Copy your program (sorting or integrating) to each host you will use. Then also find a host (or window) to run the NetworkLinda TupleSpace server. It manages the tuplespace for all the hosts running your parallel program. Start up the server first, before starting your parallel program. Then start each of your processes -- probably you will do this initially with a "python myprogram.py" command (or something similar). Note that if you have written your program correctly, it likely won't matter which part you start first, second, third, etc, because In and Rd calls block until the appropriate tuple is available in the tuplespace. Code for NetworkLinda.py will be available on Wednesday the 31st of March.
Network Linda Implementations, posted 1 Apr 2004 by hermanHere are the first two (preliminary) implementations of Network Linda. While I haven't tested them personally, they should be useful for trying some experiments with your applications (sorting and integrating).
- Two students wrote a beautifully simple version of NetworkLinda; it may not have all the bells and whistles, but should be easy to understand.
- Another two students wrote a fairly comprehensive version of NetworkLinda; it does lots of checking for unusual cases, is able to deal with partial send/recv of bytes (which sometimes occurs in TCP).
No guarantees that these initial versions are perfect; if you find problems, the authors of the code may want to hear about any bugs.
Input for Sort, posted 2 Apr 2004 by hermanA student has asked for some input (or some advice on how to generate input) for the sorting problem. The program wordload.py is a program to generate input for the sort from the file words.txt (taken from the first two chapters of Dickens Tale of Two Cities). It generates a list of about a thousand character strings in random order in the tuplespace; you would need to modify this to work with your program. Also, in the NetworkLinda mode, only one of the hosts needs to output the list into the initial tuplespace.