findJob

Find job objects stored in cluster

Syntax

out = findJob(c)
[pending queued running completed] = findJob(c)
out = findJob(c,'p1',v1,'p2',v2,...)

Arguments

c

Cluster object in which to find the job.

pending

Array of jobs whose State is pending in cluster c.

queued

Array of jobs whose State is queued in cluster c.

running

Array of jobs whose State is running in cluster c.

completed

Array of jobs that have completed running, i.e., whose State is finished or failed in cluster c.

out

Array of jobs found in cluster c.

p1, p2

Job object properties to match.

v1, v2

Values for corresponding object properties.

Description

out = findJob(c) returns an array, out, of all job objects stored in the cluster c. Jobs in the array are ordered by the ID property of the jobs, indicating the sequence in which they were created.

[pending queued running completed] = findJob(c) returns arrays of all job objects stored in the cluster c, by state. Within pending, running, and completed, the jobs are returned in sequence of creation. Jobs in the array queued are in the order in which they are queued, with the job at queued(1) being the next to execute. The completed jobs include those that failed. Jobs that are deleted or whose status is unavailable are not returned by this function.

out = findJob(c,'p1',v1,'p2',v2,...) returns an array, out, of job objects whose property values match those passed as property-value pairs, p1, v1, p2, v2, etc. The property name must be in the form of a string, with the value being the appropriate type for that property. For a match, the object property value must be exactly the same as specified, including letter case. For example, if a job's Name property value is MyJob, then findJob will not find that object while searching for a Name property value of myjob.

Was this topic helpful?