This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Create new job from existing job


newjob = recreate(oldjob)
newjob = recreate(oldjob,'TaskID',ids)



New job object.

oldjobOriginal job object to be duplicated.
'TaskID'Option to include only some tasks
idsVector of integers specifying task IDs


newjob = recreate(oldjob) creates a new job object based on an existing job, containing the same tasks and settable properties as oldjob. The old job can be in any state; the new job state is pending.

newjob = recreate(oldjob,'TaskID',ids) creates a job object containing the tasks from oldjob that correspond to the tasks with IDs specified by ids, a vector of integers. Because communicating jobs have only one task, this option supports only independent jobs.


Recreate an Entire Job

This example shows how to recreate the entire job myJob.

newJob = recreate(myJob)               

Recreate a Job with Specified Tasks

This example shows how to recreate an independent job, which has only the tasks with IDs 21 to 32 from the job oldIndependentJob.

newJob = recreate(oldIndependentJob,'TaskID',[21:32]);

Recreate Jobs of a Specific User

This example shows how to find and recreate all failed jobs submitted by user Mary. Assume the default cluster is the one Mary had submitted her jobs to.

c = parcluster();
failedjobs = findJob(c,'Username','Mary','State','failed');
for m = 1:length(failedjobs)
    newJob(m) = recreate(failedjobs(m));
Was this topic helpful?