4.4 System Components

4.4.1 Overview

This section covers the building blocks of the system in greater detail. The Job List is a common element so it is addressed first followed by the master, the slave, the Name Service and finally CODA.

4.4.2 Job List

The Job List class is a common element that is used by slave list and overseer from the master and the slave itself. The class is a simple doubly linked list that adds items to the front of the list and removes from the end similar to a queue with exceptions. This structure was necessary because the work to be done was to be issues in a sequential order. Slaves that were free for work or busy could be kept in this same type of structure. The only exception is the removal of a slave from a list. The slave that is free for work needs to be removed from the busy list and moved into the free list. The slave will be found where it exists in the list, removed and placed into the new list.

The Master uses the job list to keep the output of the commands returned from the GNU Make command. The GNU make command is typically used on all UNIX or Linux variant for control the compilation process of a program. By running the make command inside the master as a system call and capturing the results, the list of jobs to be done was created easily from the makefile in the target project directory. This returns a complete list of all the commands and how they will be done plus comments. This information is placed into a Job List for later access.

4.4.3 Master

4.4.3.1 Overview

The master, as shown in Figure 4, is made up of three basic elements: Overseer, Slave Service and Job List. The main structure of the master is:

Initialize CORBA
Initialize master with name service
Read in the target makefile
Start the overseer working
* At this point the master waits in its dormant state for slaves

The functions provided by the Master to the slaves are:
- Register Slave (Adds slave into slave service and awakens the overseer).
- Slave Free (Moves slave from busy list to free list and awakens the overseer).

4.4.3.2 Overseer

The overseer is the object that handles all coordination of slaves and sending work to them. The sole method that handles this is the awaken() method. The name 'awaken' was used because after the master is started it waits in a dormant state until a procedure call is made against it. Should this call be from a slave the master would then awaken the overseer to perform work. This method works as follows:

Get a free slave from the free slave from the Slave Service.
Get the next job from the Job List.
Send job to the slave.

4.4.3.3 Slave Service

The Slave Service is the data abstraction used to keep track of all the slaves working on a project. It is made up of two lists, a free slave list and a busy slave list. These two lists are each made up of a Slave List. All requests for slaves (addition, removal or other) are coordinated through here. The main functionality this class provides is:

Add Slave (adds slave to free list).
Remove Slave (removes slave from stated list).
Return slave (removes the first slave from the stated list).
Return slave (removes the designated slave from the stated list.
Get Free Slave (gets the reference to the next slave on the free list. Moves this slave's reference to the busy list).
Finished Work (moves the slave reference given from the busy list to the free list).
Get size of busy or free list

4.4.3.4 Slave List

The Slave List is similar to the Job List in that it is a doubly linked list. This object is the container in which all slave references are held. The functions it provides are:

Remove slave (Either by slave reference or position in list)
Index Of (Finds the position of a given slave reference in the list)
Add slave (Adds slave reference to the front of the list).
Get slave (Removes first slave from list).
Get size (Return size of the list).

4.4.3.5 Job List

Simply the Job List is there to contain all the work in the order to be done. The Master adds jobs here from the output of "make -nW Makefile&". This data structure is used also by the Slave for keeping jobs sent to it by the Master. The data structure is a double-linked list that acts like a queue. Jobs are push on at one end and popped off at the other.

4.4.4 Slave

4.4.4.1 Overview

The slave, as shown in Figure (Add figure number) is where all the work is done. It is made up of two items, the Job List (already defined previously) and the Job Process thread. The main structure of the slave is:

Initialize CORBA and JTC
Register with Name Service
Find the master location from Name Service
Register with master
Start Job Process Thread

4.4.4.1 Job Process

This is where the bulk of the work that is done by the slave is performed. The job process thread will perform its work by the following until told to quit by the master:

Wait for jobs to be put in its Job List
Get a job once there is something in the Job List
Move to the target directory
Perform the task

4.4.4 Name Service

This is a similar system to the Domain Name Service (DNS) that is available in all networks today. Both the Name Service and DNS both are used to answer query that ask for the locations of hosts within a network. Where the Name Service differs is that it keeps the Interoperable Object Reference (IOR). The structure of these references depends upon the application. In the case of DGCC we have the structure as shown in Figure 2.

4.4.5 Role of Coda in system

Coda is the glue that links the slaves and the masters in a common file system that shared between them. It is through Coda that the slaves work on the target files. At present the work must be in a subdirectory of the coda before the master can be called to start the work. In the future this might change.

4.5 Summary

This section briefly went over the details of how DGCC was designed and implement. No design is perfect. The design was engineered to be simple and elegant. The design is simple enough that anyone starting to help develop it would find it easy to get a picture of the structure and contribute quickly. Elegance was sought by looking for ways to make more get done with less. In Section 5, more discussion will go into the ideas where future development can move.


Previous: Chapter 4 - Design & Implementation Home Next: Chapter 5 - Evaluation & Potential Improvements