文档

promote

Promote job in MJS cluster queue

Syntax

promote(c,job)

Arguments

c

The MJS cluster object that contains the job.

job

Job object promoted in the queue.

Description

promote(c,job)promotes the job objectjob, that is queued in the MJS clusterc.

Ifjobis not the first job in the queue,promoteexchanges the position ofjoband the previous job.

Examples

Create and submit multiple jobs to the cluster identified by the default cluster profile, assuming that the default cluster profile uses an MJS:

c = parcluster(); pause(c)% Prevent submissions from running.j - 1 = createJob (c,'Name','Job A'); j2 = createJob(c,'Name','Job B'); j3 = createJob(c,'Name','Job C'); submit(j1);submit(j2);submit(j3);

PromoteJob Cby one position in its queue:

promote(c,j3)

Examine the new queue sequence:

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

Tips

After a call topromoteordemote, there is no change in the order of job objects contained in theJobsproperty of the MJS cluster object. To see the scheduled order of execution for jobs in the queue, use thefindJobfunction in the form[pending queued running finished] = findJob(c).

Introduced before R2006a

Was this topic helpful?