Changes to Components

Because an external service may not be available on all Hosts, it was necessary to create a mechanism where the Tasks requiring an external service could be routed to the machine where that service exists. This required changing the TaskServer and Host components along with the Task object. In general, the added implementation is added by extending the classes: to HostExternal, TaskServerExternal, and TaskExternal.


Topics

The interaction between the TaskServer, Host, and Task is bidirectional, with no definitive beginning or end. As a result, the following three sections are interwoven with the first referencing the second and third, the second referencing the first and third, and the third referencing the first two.

 

TaskServerExternal

[ TOP ]

In a JICOS system, a Host component only works on one Task at a time. It is the responsibility of the TaskServer to keep all of the Hosts doing work on a Task (please see the list of publications for details).

Except in the starting and final phases of a computation, there are usually many more Tasks than Hosts. The TaskServer keeps two queues of Tasks, those ready to run when a Host becomes available (the "ready queue"), and another queue of Tasks waiting for input from another Task.

When a TaskServer initializes, it configures itself to handle only Tasks for a specific external service or as a general TaskServer. When starting up, the TaskServerExternal contacts the root TaskServer to notify that it is available. This new TaskServer does not join the normal two-dimensional torus, but stays apart, waiting for the special TaskExternals.

 

HostExternal

[ TOP ]

The Host is the component where computation takes place. It endlessly loops asking the TaskServer for a Task to perform, does whatever computation is required, hands back the result (and, possibly, more Tasks), and asks for another Task.

When a HostExternal initializes, it performs whatever special operations are necessary for accessing or initiating the external service. Once the service is available, it creates a ProxyServiceExternal, and adds it to the Environment. Now that it is ready for tasks, it contacts the TaskServerExternal that is handling those types of TaskExternals and asks for work, behaving like any other Host.

 

TaskExternal

[ TOP ]

Any Task that requires an external service, must create a new subclass of TaskExternal. For example, TaskMatlab extends TaskExternal (which extends Task). When a task reaches a TaskServer, the TaskServer then checks if it is a normal Task, or a requires an external service.

If it is a TaskExternal, then the appropriate TaskServerExternal is located and routed. If no such TaskServerExternal is available in the system, it throws a JICOS ComputeException and flushes the computation out of the system.