Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4486 + 2220 = 6706
Home Page
[an error occurred while processing this directive]

4005-730 Distributed Systems
Grid Computing System Version 4

Prof. Alan Kaminsky
Rochester Institute of Technology -- Department of Computer Science
Adapted by Prof. Warren R. Carithers, 2011/01/31

Overview
The Grid Computing System
Software Requirements
Example Command Lines


Overview

Write a Java program for a simulated grid computing system. The program will include distributed processes for the various entities in the grid computing system, as well as a user client. The distributed processes will communicate with each other using tuple space. This version will assume there is only one client running at a time and that processes never fail.

Like Version 3, Version 4 assumes there is only one client running at a time and that processes never fail.

Version 4 adds the following features to Version 3:


The Grid Computing System

The Grid Computing System (GCS) is the same as Version 3, except as noted below.

When a particular compute server is reserved for a calculation session, the following tuple exists in tuple space:


Software Requirements

    Function Interface
     
  1. The requirements for the Function interface in Version 4 are the same as Version 3.
     
    Compute Server
     
  2. The requirements for the compute server object in Version 4 are the same as Version 3.
     
    Client Program
     
  3. The requirements for the compute client main program in Version 4 are the same as Version 3.
     
    System Monitor Program
     
  4. The Grid Computing System must have a system monitor program to display the reservation states of all the compute servers in one place.
     
    Note: The system monitor's state display is in addition to the individual compute servers' state displays.
     
  5. The system monitor program must be run by typing this command line:
     
    java Monitor <host> <port> <ts>
     
    where <host> is the name of the host computer where the Registry Server is running, <port> is the port number to which the Registry Server is listening, and <ts> is the name of the tuple space object bound into the Registry Server; none of the arguments may be omitted.
     
    Note: This means that the system monitor program's class must be named Monitor, and this class must not be in a package.
     
  6. The system monitor program must print an error message and terminate if there are any of the following problems with the command line arguments. The error message must include a meaningful explanation of the problem. The error message may include an exception stack trace.
  7. The system monitor program must display the reservation states of all the compute servers at all times; specifically: Whenever one of the compute servers prints a line on the compute server's console saying that the compute server is available or reserved, the system monitor program must print the following lines on the system monitor program's console:
     
    ******** <datetime> ********
    Compute Server <name> -- reserved -- session: <sessname>
    Compute Server <name> -- available
    . . .
     
    where <datetime> is replaced with the date and time; each <name> is replaced with the name of the corresponding compute server; if the compute server is reserved, the words reserved -- session: <sessname> are printed, replacing <sessname> with the session name; if the compute server is available, the word available is printed.
     
    Note: Each time the system monitor program does the above printout, all the compute servers must be included in the printout, even compute servers whose state has not changed.
     
  8. In the above printout, the compute servers must be listed in alphabetical order of their names.
     
  9. The system monitor program must automatically detect all the compute servers, including compute servers that started before the system monitor program started and compute servers that started after the system monitor program started.
     
  10. If an exception occurs and the above requirements do not state how to handle the exception, the system monitor program must print an exception stack trace and must exit.


Server Source Code


Client Source Code


Example Command Lines

To perform an example calculation session, run the following commands, each in a separate process on the same machine.

  1. Run the Registry Server and tuple space (script: runregistry).

    $ runregistry

    #!/bin/bash
    java \
    -classpath /home/fac/ark/public_html/cscl.jar \
    Start edu.rit.ds.registry.RegistryServer + \
    edu.rit.ds.space.SimpleSpace TS

  2. Run the Grid Computing System monitor program (script: runmonitor). This can be done before or after starting the compute server objects.

    $ runmonitor

    #!/bin/bash
    java \
    -classpath /home/fac/wrc/www/courses/common/ds/gcs/gcs04:/home/fac/ark/public_html/cscl.jar \
    Monitor localhost 9901 TS

  3. Set up a security policy for the Compute Server (policy file: policy).

    grant codebase "file:/home/fac/wrc/www/courses/common/ds/gcs/gcs04/"
        {
        permission java.security.AllPermission;
        };
    grant codebase "file:/home/fac/ark/public_html/cscl.jar"
        {
        permission java.security.AllPermission;
        };

  4. Run several instances of the Compute Server, specifying the security policy (script: runcomputeserver).

    $ runcomputeserver A
    $ runcomputeserver B
    $ runcomputeserver C

    #!/bin/bash
    java \
    -classpath /home/fac/wrc/www/courses/common/ds/gcs/gcs04:/home/fac/ark/public_html/cscl.jar \
    -Djava.security.policy=policy \
    ComputeServer localhost 9901 TS $1

  5. Set up a security policy for the Compute Client (policy file: client/policy).

    grant codebase "file:/home/fac/wrc/www/courses/common/ds/gcs/gcs04/client/"
        {
        permission java.security.AllPermission;
        };
    grant codebase "file:/home/fac/ark/public_html/cscl.jar"
        {
        permission java.security.AllPermission;
        };

  6. Set up a web server so that class files in the client's class path can be downloaded from a URL. This is called the codebase URL.
     
  7. Run the Compute Client, specifying the security policy and the client's codebase URL (script: client/runclient). Specify computation session name, function class names, and compute server names on the command line. Type arguments upon which to calculate the function. Hit CTRL-D (end-of-file) when done.

    $ runclient Alan SqrFunction A LogFunction B SineFunction C
    0.5
    1.0
    CTRL-D

    #!/bin/bash
    java \
    -classpath /home/fac/wrc/www/courses/common/ds/gcs/gcs04/client:/home/fac/wrc/www/courses/common/ds/gcs/gcs04:/home/fac/ark/public_html/cscl/lib \
    -Djava.security.policy=policy \
    -Djava.rmi.server.codebase=http://www.cs.rit.edu/~wrc/courses/common/ds/gcs/gcs04/client/ \
    ComputeClient localhost 9901 TS $*
    

Compute Server A prints the following on the console (the floating point numbers may print with additional digits of precision):

Compute Server A -- available
Compute Server A -- reserved -- session: Alan
Compute Server A -- function: sqr
Compute Server A -- successor: B
Compute Server A -- f(0.5)
Compute Server A -- sqr(-0.735) = 0.540
Compute Server A -- f(1.0)
Compute Server A -- sqr(-0.173) = 0.030
Compute Server A -- available

Compute Server B prints the following on the console (the floating point numbers may print with additional digits of precision):

Compute Server B -- available
Compute Server B -- reserved -- session: Alan
Compute Server B -- function: log
Compute Server B -- successor: C
Compute Server B -- f(0.5)
Compute Server B -- log(0.479) = -0.735
Compute Server B -- f(1.0)
Compute Server B -- log(0.841) = -0.173
Compute Server B -- available

Compute Server C prints the following on the console (the floating point numbers may print with additional digits of precision):

Compute Server C -- available
Compute Server C -- reserved -- session: Alan
Compute Server C -- function: sin
Compute Server C -- f(0.5)
Compute Server C -- sin (0.5) = 0.479
Compute Server C -- f(1.0)
Compute Server C -- sin (1.0) = 0.841
Compute Server C -- available

The compute client program prints the following on the console (the floating point numbers may print with additional digits of precision):

f(0.5) = 0.540
f(1.0) = 0.030

[an error occurred while processing this directive]
Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4486 + 2220 = 6706
Home Page
Copyright © 2007 Alan Kaminsky. All rights reserved. Last updated 13-Jan-2007. Please send comments to ark­@­cs.rit.edu. Adaptations last updated 2011/01/31 by Warren R. Carithers.