Job Classes

Harrison R. Ulrich
Mon, 1 Apr 1996 20:20:07 -0600

Dear Tunes List (and people):

I wonder if you might indulge me in a little game. The way you play it is to
come up
with examples of real life thingees that fit the following model. If you can
come up
with something which you don't think fits this model, then my job is to
determine if
this is true, and if not, explain why it is not. When we get through with
the game,
then you will understand the model, and just maybe it will improve. If you
don't want
to play, that is fine. After the following graph, I will make a few
statements and then
will start with the first example. Good luck, have fun, and whatever you do,
don't lose
faith and give up!

                   Outside World
|          +-----------+      +------------+
|          |  Resource |      |  Unique    |
|          |  Manager  |      |Job Numbers |
|          +-----------+      +------------+
|           |  ^                    |
|           |  |                    |
|           |  |                    v
|           |  |             +---------------+      +-----------+
|   JQ      |  |  +----------| Job Initiator |----->|  Input(s) |
|  +---+    |  |  |          | (Job Ticket)  |      +-----------+
|  | - |    |  |  |          +---------------+            |
|  | - |    |  |  |                                       |
|  | - |    v  |  v                           Steps       |
|  | - |   +-----------+     +-----------+    +--- 0      |
|  +===+<--|   Event   |     | Job Class |    |           |
|          |  Manager  |--+->|           |----+--- 1      |
|          |           |  |  | Job Ticket|    |           |
|          +-----------+  |  +-----------+    +--- n      |
|                |                                        |
|                |                                        V
|                |
|                |                                   +-----------+
|                |<----------------------------------| Output(s) |
|                |                                   +-----------+
|                |
|                V                          Outside World
|          +------------+
|          | Device     |
|          | Exportation|
|          +------------+
                 v                Outside World

Some comments:

1. Job Initiator Examples
   a. IPC Message of NewJobNotice arrives at the event manager
   b. Command Line Program deposits job ticket where it is expected to be,
      and a sleepy time poller spots it.
   c. A button on a user interface
2. Job Initiator must
   a. get a unique job number from a central dispenser
   b. copy any data needed for the job to an agreed upon place
   c. submit a NewJobNotice to an assigned event manager
3. Event manager records the receipt of the job by inserting it into a job
   with respect to its associated priority.
4. When event manager decides to pay attention to the next job to be
processed, it
   determines what resources (if any) are needed. These resource needs are
sent to
   the resource manager.If a job is waiting resources, then its status will
be WR.
5. The resource manager records the needs for resources in its own resource
   When resources are available, then a ResourcesSatisfied for job n is sent
to the
   event manager.
6. The event manager upon receipt of such a notice, launches the job class.
7. A job class can have 0 or more steps. Steps can run in parallel or in
sequence. They
   can also be dependent on the completion of some prior step. The outputs
from a step
   may be inputs to another step, etc.
8. The steps are data transformation modules. These steps abide by the api
   that they return an exit status of Success, Cancel, or Failure. They are
free to
   send messages to the event manager as well to launch other job classes.
9. The transformers will send a TaskComplete message to the event manager
with an
   event value. The steps language may branch to steps based on the event
value, etc.
10.When all steps of the job class are completed successfully, the event
manager may
   need to arrange for an output device to export the final output(s) of the
job class.
11.On the other hand, if the job fails, then the job is marked as JobError.
12.If the task is cancelled, the status is marked JC.
13.A job may be placed on hold by some important deity.
14.It may be WR (waiting resources)
15.Finally, the job is complete, and a cleanup step is invoked, to undo the
dirty work
   of the job.

Examples of Job Classes:

     a + b




     1 2 3 * 10

     10 * 1 2 3

     v[1] Is expression

Assume in the above assignment, that 'v' has been requested as an Exclusive
Resource and
is busy. Does this mean the assignment fails? Maybe not. This assignment may
be of a
type that can become pendant and when 'v' is available, then the job of
assignment can

     remoteobject * localobject

In this case, the acquisition of the remoteobject may take miniutes to
complete and the
status of the multiply is BP WR (being processed, waiting resources). As
soon as the
object arrives, the resource need is satisfied and the operation can take
place. Now
what about the result of the multiply. Let's presume that we have tagged
value results
be redirected to another remote object. Then you can see that the operation
to display
the result may also take minutes, especially, if the output device is being
used and
cannot handle but one outgoing conversation at a time. So, we begin to see
that those
operations that take microseconds are in fact absolutely like a job class
that takes
3 hours to run, just faster.

Enough, enough I understand.

Is there not a way to parlay this model into the heartbeat of something new and

A. Need a step language.
B. Need a way to register the FIRST, and subsequent job classes.
C. Need the concept of distributed configuration. At one point, data
transformer A is
   configured to use Named Pipes and at another, it is to use ToolTalk.