Skip to Main Content Skip to Search
Product Documentation

demote - Demote job in cluster queue

Syntax

demote(c, job)

Arguments

c

Cluster object that contains the job.

job

Job object demoted in the job queue.

Description

demote(c, job) demotes the job object job that is queued in the cluster c.

If job is not the last job in the queue, demote exchanges the position of job and the job that follows it in the queue.

Tips

After a call to demote or promote, there is no change in the order of job objects contained in the Jobs property of the cluster object. To see the scheduled order of execution for jobs in the queue, use the findJob function in the form [pending queued running finished] = findJob(c).

Examples

Create and submit multiple jobs to the job manager identified by the default parallel configuration:

c = parcluster();
j1 = createJob(c,'Name','Job A'); createTask(j1,@rand,1,{3});
j2 = createJob(c,'Name','Job B'); createTask(j2,@rand,1,{3});
j3 = createJob(c,'Name','Job C'); createTask(j3,@rand,1,{3});
submit(j1);submit(j2);submit(j3);

Demote one of the jobs by one position in the queue:

demote(c, j2)

Examine the new queue sequence:

[pjobs, qjobs, rjobs, fjobs] = findJob(c);
get(qjobs, 'Name')
    'Job A'
    'Job C'
    'Job B'

See Also

createJob | findJob | promote | submit

  


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