Skip to Main Content Skip to Search
Product Documentation

destroy - Remove job or task object from parent and memory

Syntax

destroy(obj)

Arguments

obj

Job or task object, or array of objects, to be deleted from job storage memory.

Description

destroy(obj) removes the job object reference or task object reference obj from the local session, and removes the object from the job manager memory. When obj is destroyed, it becomes an invalid object. You can remove an invalid object from the workspace with the clear command.

If multiple references to an object exist in the workspace, destroying one reference to that object invalidates all the remaining references to it. You should remove these remaining references from the workspace with the clear command.

If obj is an array of job objects and one of the objects cannot be destroyed, the other objects in the array are destroyed and a warning is returned.

The task objects contained in a job will also be destroyed when a job object is destroyed. This means that any references to those task objects will also be invalid.

Tips

Because its data is lost when you destroy an object, destroy should be used after output data has been retrieved from a job object.

Examples

Destroy a job and its tasks. Assume the default configuration identifies a job manager.

jm = findResource(); % Use default config
j = createJob(jm, 'Name', 'myjob');
t = createTask(j, @rand, 1, {10});
destroy(j);
clear t
clear j

Note that task t is also destroyed as part of job j.

Destroy all finished jobs on the job manager.

[p,q,r,f] = findJob(jm)
destroy(f) 

See Also

createJob | createTask | findJob | findTask

  


Free Parallel Computing Interactive Kit

See how to solve large problems with minimal effort and reduce simulation time.

Get free kit

Trials Available

Try the latest versions of parallel computing products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS