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

[ in progress, links need to be checked ]

Assignment Day Febrary 01, 2018 (Thursday)
Due Date February 09, 2018 (Friday)

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 P2 and submit code to csx730.

Note that you may need a .rhosts 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 .rhosts file is:

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

<hostnameN> <loginidN>

The instructor's .rhosts 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).

https://docs.oracle.com/cd/E19683-01/816-1435/rpcgenpguide-21470/index.html

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 earlier, 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 this 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 on nike (e.g., vcf4).

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 vcf4.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).