Project 4 -- IPC

Due Monday, December 3, 6:00 pm

(Note that the due date is later than originally listed in the class schedule. I do not intend to move the due date off any more, as this is getting close to final exams as it is. This means that if you have conflicts with other courses, such as term assignments for those courses, you should get an early start on Project 4 and have it done early, rather than hoping to get an extension.)

NOTE: If you are even a minute late, submitting this project, you lose 20%. If you are worried about potentially being late, turn in your homework ahead of time. Do this by submitting them electronically then giving the hard copy to me or the TA during office hours or by sliding it under my office door within twenty-four hours after the time it is due. Do not send assignments to me through email or leave them in my departmental mail box.

The Prime@home Assignment

For this assignment, you will create two programs. The client will be called primeathome and the server will be called primeathomed.

primeathome

The primeathome program will work just like the primeatschool program with the following exceptions:

A user will invoke primeathome with the command line:

    % primeathome <server IP address> <server port number>
    
where <server IP address> is replaced by the IP address of the server from which the client will get its numbers and <server port number> is the port from which the server will be reading.

(For more on addresses and port numbers, see IPC below.)

When primeathome is shut down by sending it the SIGUSR1 signal, it will not attempt to remove any FIFO entries.



primeathomed

The primeathomed server will just like the primeatschoold program, with the following exceptions:

A user will invoke primeathomed with the command line:

    % primeathomed <server port number>
    
where <server port number> is the port from which the server will be reading.

When started, primeathomed will read and write files called primeathomefile, homelikelyprimes, and homeprimes, rather than primeatschoolfile, schoollikelyprimes, and schoolprimes.

When primeathomed is shut down by sending it the SIGUSR1 signal, it will not attempt to remove any FIFO entries.

IPC

For IPC, both the client and the server in the Prime@home portion of the assignment will use sockets in a connectionless set-up.

The address of the server will be in IP address format, i.e., "<number1>.<number2>.<number3>.<number4>" where each <numberx> is replaced by some number. This will have to be the actual IP address of the machine on which your server is running.

The port number will be a number you choose above 8000. There is a small chance that you will choose a number that another group is using. If so, you may appreciate standards a bit more. Just pick another number if you find that this has happened.

Message type 0 from the client to the server will be formatted as follows:

    0,


What to turn in.

You will turn in both a hard copy and an electronic copy of your assignment. You will be given instructions on how to send electronic copies. Do not send them to me though email.

Both the hard copy and the electronic copy will contain a write-up and all source code for primeatschool, primeatschoold, primeathome, and primeathomed. The electronic copy will also contain the executables of primeatschool, primeatschoold, primeathome, and primeathomed. The electronic copy of your write-up should not be in a proprietary format (such as MS Word); it should be either in plain ASCII text or in a portable format (such as Postscript or PDF). Your source code should either be in a single file for each program, called primeatschool.c, primeatschoold.c, primeathome.c, and primeathomed.c, respectively, or in several files that can be compiled and linked using make. In the latter case, primeatschool.c, primeatschoold.c, primeathome.c, and primeathomed.c (or primeatschool.cxx, primeatschoold.cxx, primeathome.cxx, and primeathomed.cxx) will contain the function main() and you will include your makefile and it will be named makefile. The executables generated by your makefile should be called primeatschool, primeatschoold, primeathome, and primeathomed.

Your source code should be well structured and well commented. It should conform to good coding standards (e.g., no memory leaks).

Your write-up will contain 1/2 to 1 page (roughly 80 characters per line, 50 lines per page) explaining the data structures and algorithms used in your code. This page limitation does not include figures used in your explanation, which are encouraged and may take up any amount of space. (This explanation does not remove the requirement that your code be well commented.)



Other

You may write your program from scratch or may start from programs for which the source code is freely available on the web or through other sources (such as friends or student organizations). If you do not start from scratch, you must give a complete and accurate accounting of where all of your code came from and indicate which parts are original, which are changed, and which you got from which other source. Failure to give credit where credit is due is academic fraud and will be dealt with accordingly.

As noted in the syllabus, you are required to work on this programming assignment in a group of at least two people. It is your responsibility to find other group members and work with them. The group should turn in only one (1) hard copy and one (1) electronic copy of the assignment. Both the electronic and hard copies should contain the names and student ID numbers of all group members. If your group composition changes during the course of working on this assignment (for example, a group of five splits into a group of two and a separate group of three), this must be clearly indicated in your write-up, including the names and student ID numbers of everyone involved.