Home Schedule Reading Projects People
Mac Logo Windows Logo Minix Logo Sun Solaris Logo Linux Logo

Project 2: Inter Process Communication (IPC): Remote Procedure Calls (40/40 pts)

Assignment Day September 13, 2016 (Tuesday)
Due Date September 22, 2016 (Thursday)

For Question 1-3 : Submit a hardcopy of your code (make sure it is readable) and a softcopy on nike via the submit command. Name the directory you submit project2 an and submit code to csx730.

Note that you may need a .rhost file under you home directory, it includes authority to the machine that the 'server' accepts clients <hostname> and from what login id <loginid>.

The format for a .rhost file is:

<hostname1> <loginid1>
<hostname2> <loginid2>
.
.
.

<hostnameN> <loginidN>

The instructor's .rhost file may look like the below (login id is 'maria'):

atlas.cs.uga.edu  maria
nike.cs.uga.edu   maria
nikon.cs.uga.edu   maria
cf3.cs.uga.edu   maria

Great RPC tutorial - Prof David Marshall @ Cardiff University (optional reading):
http://www.cs.cf.ac.uk/Dave/C/node33.html

On rpcgen: http://www.cs.cf.ac.uk/Dave/C/node34.html#ch:rpcgen (not you may not have permission to print on another server's Console for the printmessage tutorial).

Wikipedia: http://en.wikipedia.org/wiki/Remote_procedure_call (also check the link listed under 'external link" to the SGI Tutorial "Introduction to RPC Programming").

Question 1: Remote Procedure Calls (RPC): Echo RPC server (5 pts)

Write a program using remote procedure calls where the server simply echo's the word back to the client. Test your program on nike (similar to the shared memory tutorial we did on Tuesday Sep 13, but using RPC).

Question 2: Remote Procedure Calls (RPC) Compute the median (7 pts), and mode (8 pts).

Modify the average RPC programs (avg.x, avg_proc.c and ravg.c) discussed last week so that it computes the median and 1 mode of a maximum of 100 numbers instead of the average of a maximum of 200 numbers. Test your program on a cluster node of nike (e.g., cf4).

The average RPC program is available here - a Makefile tested on nike is included). Just type make after installing these program on nike (make sure you have an .rhost file under your home diretory, and that 'white' space works correctly in the makefile (i.e., cut and past the makefile will not work).

For the avg program: Run the RPC server program by starting the server: ./avg_svc

For the avg program: Run the RPC client program by : ./ravg cf4.cs.uga.edu 1 2 3 4

Try to use a different 'port number' than other classmates by 'uniquifying' the 22855 number given in the avg.x file. Suggesion, use the last 4 digits of you student ID number or some other unique number.

A zip file of the directory above is here:

rpc.zip

Question 3: Remote Procedure Calls (RPC): Sort numbers (20 pts)

Modify the average RPC program so that the server sends back a list of 'sorted' numbers to the client either in descending or ascending order given by an input parameter when invoking the client, e.g., the word "ascending:, "descending" (or just -a, -d).