The clients should send requests to the server only in the


Using Remote Procedure Calls, write a concurrent server program to sort random numbers in the interval [-10,10] with at least four versions, each using a different well known sorting algorithm. Use Quicksort, Heapsort, Insertion Sort, and Shellsort as your versions of the service which should be called SORT_NUMBERS. The program that you write should be tested with at least 3 clients. The server should be written using Solaris and the clients should use local machines (not Galaxy) in Maes 208 running Linux. Input files in the form of arrays of at least 50 numbers should be created for each client: the files should be named inputfileC1, inputfileC2, and inputfileC3 for the three clients, respectively.

The input should begin with a line containing the number of elements in the input. Each sort should be run with at least 2 examples per client. To check for errors in input, put a few elements outside the interval [-10,10] so that errors can be caught. If the number of items in the array is not an integer, that also is an error that should be caught by your program.
The input array should be sent to the server (a Sun workstation in Maes 214) with the version of sorting routine that you want to use. Make sure you test all four versions on each sample file and measure the running times of each example (make sure you only include the computation time, not the I/O). The server will sort the numbers and print the sorted array with its client and the name of the sort used on the server display device, and then return the sorted array, with the sort name and running time to the client that made the request. The client will print the array when it arrives on its display, and then write the results including the array, sort name, and running time in a output file "OUTPUT.dat" in the order in which they are returned by the server. Write the output so that the reader of an OUTPUT.dat file can clearly understand the output. In other words, label your output fields and leave extra spaces in the output file to make it readable.

The server must be concurrent in order to handle the requests of multiple clients at the same time. To ensure that the clients are making requests concurrently, have all clients sending the requests together at the start of the program. One server child process should be allocated for each sort during execution and then de-allocated when the sort is completed. In other words, separate connections will need to be made for the execution of each sort version for each client. When you test your work, ensure that more than one request is running on the server at a time. Ideally, several should be running to test the concurrency. You may want to use arrays larger than 50 elements to prevent all of the sorts to finish so quickly that multiple child processes are not needed. Remember to kill child processes when a connection is closed. Processes do not die otherwise. They become zombies and eventually they take so much process time that there is no longer enough space to run any process and the system will crash. Students who do this more than once will be penalized. Ask the technicians if you do not know what you are doing.

The clients should send requests to the server only in the form of Remote Procedure Calls. Sockets cannot be used for this assignment.

Since you are sending arrays of unsorted numbers to the server, you will need to send a structure that consists of an array and an array size to the server. Use XDR to ensure that the information that you marshall for transmission can be understood by the receiver. Use TCP forms of RPCs.

Due Date: February 13 by 10 p.m. These should include a Make file, the source code, and any information that you think is needed to run your program in a ReadMe file. You do not need to include your input files as we will use our own to test your program, but you need to construct your program using the correct names for the sorts and input files. For that reason it is important that you name your files according to the directions above.

Note: This program is to be written in C or C++ language using RPC. Run a Solaris server and Linux clients.
Each student is required to do this assignment. Students may discuss the program among themselves, but you are not permitted to copy code nor allow others to copy your code. Doing so will result in a grade of zero on this assignment.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: The clients should send requests to the server only in the
Reference No:- TGS01281832

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)