CS 3733 Operating Systems, Spring 1997 Assignment 5
Preliminary Announcement


Part 1 should be done by April 18.
Parts 2 and 3 must be completed by Monday, April 28.


This assignment continues the project from Assignment 4. You are going write a simplified parallel make utility which can be used on a network of workstations.

Part 1:

Get copies of Programs 12.1, 12.3, and 12.4 from PUP. You will also need a copy of uici.h. All of these and a makefile can be found in /usr/local/courses/cs3733/spring97/assign5. Compile these and test to see that the server and client can communicate over the network.

Part 2

Copy server.c to compiler.c and modify it as follows.

When a connection request comes in, the forked child will read a record of size SERVER_IO_SIZE. This record will contain two character strings separated by a blank. Note that here the string terminator is a blank, unlike in C. The first string will be interpreted as a directory and the second will be the name of a program. The child will switch to the directory and compile the named program. It will then send back a single byte to the network, 0 for success, and 1 for failure.

For example, if the string received was
/home/student/cs3733/assign4 first
the program would move to the directory /home/student/cs3733/assign4 and execute
cc -c first.c.

Modify your makefile appropriately. Use a value if 128 for SERVER_IO_SIZE and test your server using the client from Part 1. You may have to slightly modify the client so that you can see the value returned by the server.

Part 3

Copy client.c to linker.c and modify it as follows.

The program will take three command line arguments: a port number and two file names. The first file will contain a list of machine names, one per line. The second file will contain the name of an executable on the first line followed by names of programs to compile, one per line. For example, the first file might contain:
five04
four08
five06
and the second file might contain:
server
server
copy_from_network_to_file
uici

linker will read in these files and for each program to compile, it will send a request for compilation to one of the machines listed in the first file. Start with the first machine and use the machines in the order given. If the number of machines is smaller than the number of compiles to do, treat the list of machines as a circular list so that some machines may be used more than once. You should do this in such a way the the compilations are done in parallel. When all of the compilers have reported their results, print out an error message if at least one was unsuccessful. Otherwise, link the object files into an executable and print a message indicating success.

You may assume that all of the files to be compiled are in the same directory. Test this in the case that the number of machines is smaller, equal to, and greater than the number of compiles to do.


Extra Credit

Do not attempt this unles your Part 3 is working perfectly.

Modify Part 3 so that all error messages come back to the linker and the user can tell from the linker output what errors occurred in what module. Make sure your solution is robust.