Centre d’aide MATLAB
Find task in job
tasks = findTask(j)
tasks = findTask(j,taskFcn)
[pending,running,completed] = findTask(j)
tasks = findTask(j,propertyName=Value)
tasks = findTask(j) returns a 1-by-N array of task objects in the job j. The tasks in the array are in order of their ID property, indicating the sequence in which they were created.
tasks
j
1
N
ID
example
tasks = findTask(j,taskFcn) returns an array of task objects in the job j, filtered using the taskFcn property. taskFcn is a function handle that accepts the j.Tasks property as an input argument, and returns a logical array that indicates the tasks to return.
taskFcn
j.Tasks
[pending,running,completed] = findTask(j) sorts all the tasks stored in the job j by state. Within the pending,running,completed array, the software returns the tasks in order of creation.
pending
running
completed
tasks = findTask(j,propertyName=Value) specifies properties and values to find, using one or more property name-value arguments. For a list of task properties, see parallel.Task.
propertyName=Value
parallel.Task
The object property value must match the specified value exactly. For example, if the Name property value of a task is MyTask, then findTask does not find that object when it searches for a task with the Name property value of mytask.
Name
MyTask
findTask
mytask
collapse all
Create a job object on the default cluster.
c = parcluster; j = createJob(c);
Create and add a task to the job object.
createTask(j,@rand,1,{10})
Find all task objects now part of job j.
t = findTask(j)
parallel.Job
Job in which the software finds the task, specified as a parallel.Job object.
Function that findTask uses to filter the tasks from the job j, specified as a function handle.
parallel.task
Task object property name and value to find, specified as a parallel.task property name-value argument. If you specify more than one property name-value argument, findJob returns entries that meet all of the search criteria. For a full list of task object properties, see parallel.Task.
findJob
Example: findTask(job,Name="jsmith") finds task objects that have the Name property value of jsmith.
findTask(job,Name="jsmith")
jsmith
Tasks in the job that meet the search criteria, returned as an array of parallel.Task objects.
Tasks in a pending state on the job, returned as an array of parallel.Task objects.
Tasks in a running state on the job, returned as an array of parallel.Task objects.
Tasks in a completed or failed state on the job, returned as an array of parallel.Task objects.
If the job j is contained in a remote service, findTask results 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, the software throws an error.
Introduced before R2006a
createJob | createTask | findJob
createJob
createTask
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
Europe
Asie-Pacifique
Contactez votre bureau local