destroy - Remove job or task object from parent and memory

Syntax

destroy(obj)

Arguments

obj

Job or task object deleted from 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.

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.

Remarks

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.

jm = findResource('scheduler','type','jobmanager', ...
               'name','MyJobManager','LookupURL','JobMgrHost');
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.

See Also

createJob, createTask

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS