GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



next up previous contents
Next: Obtaining the JobID of Up: Job Management Previous: Obtaining and Destroying Job   Contents

Obtaining the State of a Job Instance

A GATJob instance instance can be in various other states beyond simply submitted; what good would a job class be if all it did was stay in a submitted state. The various states a GATJob instance can be in are digramed in figure [*].

Figure: States of a GATJob instance.
[height=8cm]jobstates

After a GATJob instance has been created, it is in what is called the initial state. In this state the physical job corresponding to the GATJob instance has been submitted to an underlying resource management system, but has yet to be submitted to a specific hardware resource. A GATJob instance leaves the initial state when the corresponding physical job is submitted to a specific hardware resource. When the physical job is submitted to a specific hardware resource, the corresponding GATJob instance moves in to the scheduled state. A GATJob instance in the scheduled state can leave this state through one of two routes. First, it may leave this scheduled state by actually commencing to run, thus entering the running state. The other means by which is may leave the scheduled state is through an application unscheduling the GATJob instance, bringing it back in to the initial state. A GATJob instance in the running state can leave this state through one of two channels. First of all, the corresponding physical job may simply finish, leaving the GATJob instance in the stopped state. Second, an application may simply stop the GATJob instance leaving it again in the stopped state.

To actually determine what state a particular GATJob instance is in, one need only call the function

GATResult GATJob_GetState(GATJob_const object, GATJobState *state)

The first argument is the GATJob instance one wants to query for state information. The next argument is a pointer to a GATJobState through which the job's state is returned. The type GATJobState is an enumeration with the values and associated semantics enumerated in table [*].


Table: GATJobState enumeration values
GATJobState Value Value's semantics
GATJobState_Unknown The job's state can not be determined
GATJobState_Initial Job is in the initial state
GATJobState_Scheduled Job is in the scheduled state
GATJobState_Running Job is in the running state
GATJobState_Stopped Job is in the stopped state


Finally, our function of study, GATJob_GetState, returns a GATResult, covered in Appendix [*], which indicates its completion status.


next up previous contents
Next: Obtaining the JobID of Up: Job Management Previous: Obtaining and Destroying Job   Contents
Andre Merzky 2004-05-13