| Parallel Computing Toolbox™ | ![]() |
destroy(obj)
obj | Job or task object deleted from memory. |
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.
Because its data is lost when you destroy an object, destroy should be used after output data has been retrieved from a job object.
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.
![]() | demote | dfeval | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |