findTask
Task objects belonging to job object
Syntax
tasks = findTask(j)
tasks = findTask(j, taskFcn)
[pending running completed] = findTask(j)
tasks = findTask(j,'p1
',v1,'p2
',v2,...)
Arguments
| Job object. |
| Returned task objects. |
| Array of tasks in job |
| Array of tasks in job |
| Array of completed tasks in job |
| Task object properties to match. |
| Values for corresponding object properties. |
Description
tasks = findTask(j)
gets a 1-by-N array of task objects belonging to a job object j
. Tasks in the array are ordered by the ID
property of the tasks, indicating the sequence in which they were created.
tasks = findTask(j, taskFcn)
returns an array of task objects that belong to the job j
, using taskFcn
to select them. taskFcn
is a function handle that accepts j.Tasks
as an input argument, and returns a logical array indicating the tasks to return.
[pending running completed] = findTask(j)
returns arrays of all task objects stored in the job object j
, sorted by state
. Within each array (pending
, running
, and completed
), the tasks are returned in sequence of creation.
tasks = findTask(j,'
returns an array of task objects belonging to a job object p1
',v1,'p2
',v2,...) j
. The
returned task objects will be only those matching the specified property-value pairs,
p1
, v1
, p2
,
v2
, etc. The property name must be a character vector, 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
task's Name
property value is MyTask
, then
findTask
will not find that object while searching for a
Name
property value of mytask
.
Examples
Create a job object.
c = parcluster(); j = createJob(c);
Add a task to the job object.
createTask(j,@rand,1,{10})
Find all task objects now part of job j
.
t = findTask(j)
Tips
If job j
is contained in a remote service, findTask
will result in a call to the remote service. This could result in findTask
taking a long time to complete, depending on the number of tasks retrieved and the network speed. Also, if the remote service is no longer available, an error will be thrown.
Version History
Introduced before R2006a