| Contents | Index |
tasks = findTask(obj)
[pending running completed] = findTask(obj)
tasks = findTask(obj,'p1',v1,'p2',v2,...)
obj | Job object. |
tasks | Returned task objects. |
pending | Array of tasks in job obj whose State is pending. |
running | Array of tasks in job obj whose State is running. |
completed | Array of completed tasks in job obj, i.e., those whose State is finished or failed. |
p1, p2 | Task object properties to match. |
v1, v2 | Values for corresponding object properties. |
tasks = findTask(obj) gets a 1-by-N array of task objects belonging to a job object obj Tasks in the array are ordered by the ID property of the tasks, indicating the sequence in which they were created.
[pending running completed] = findTask(obj) returns arrays of all task objects stored in the job object obj, sorted by state. Within each array (pending, running, and completed), the tasks are returned in sequence of creation.
tasks = findTask(obj,'p1',v1,'p2',v2,...) gets a 1-by-N array of task objects belonging to a job object obj. The returned task objects will be only those having the specified property-value pairs.
Note that the property value pairs can be in any format supported by the set function, i.e., param-value string pairs, structures, and param-value cell array pairs. If a structure is used, the structure field names are object property names and the field values are the appropriate property values to match.
When a property value is specified, it must use the same exact value that the get function returns, including letter case. For example, if get returns the Name property value as MyTask, then findTask will not find that object while searching for a Name property value of mytask.
If obj 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.
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)
createJob | createTask | findJob

See how to solve large problems with minimal effort and reduce simulation time.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |