demote - Demote job in MATLAB Job Scheduler cluster queue - MATLAB (original) (raw)

Demote job in MATLAB Job Scheduler cluster queue

Syntax

Description

demote([job](#f2-41333%5Fsep%5Fmw%5F6c03a208-3226-4005-87ad-a63bb763c56f)) demotes the job object,job, in a MATLABĀ® Job Scheduler cluster queue.

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.

example

demote([c](#f2-41333%5Fsep%5Fmw%5Fecfb031b-260c-4ecd-8223-728f541bc3e4),[job](#f2-41333%5Fsep%5Fmw%5F6c03a208-3226-4005-87ad-a63bb763c56f)) demotes the job object, job, that is queued in the MATLAB Job Scheduler 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.

Examples

collapse all

Create and submit multiple jobs to the cluster identified by the default cluster profile, assuming that the default cluster profile uses a MATLAB Job Scheduler.

Create a cluster object.

Use pause to prevent submissions from running.

pause(c) % Prevent submissions from running.

Create jobs and tasks and submit to queue.

j1 = createJob(c,'Name',"Job A"); t1 = createTask(j1,@rand,1,{10,10}); j2 = createJob(c,'Name',"Job B"); t2 = createTask(j2,{@rand,@magic,@ones},1,{{3,3} {3} {3,3}}); j3 = createJob(c,'Name',"Job C"); t3 = createTask(j3,@rand,1,{10,10},CaptureDiary=true); submit(j1);submit(j2);submit(j3);

Examine the queue sequence.

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

Demote Job A by one position in its queue.

Examine the new queue sequence.

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

Resume processing of the job queue.

Input Arguments

collapse all

Job to demote in the MATLAB Job Scheduler cluster queue, specified as a parallel.Job object.

Example: job = createJob(c)

Cluster, specified as a parallel.cluster.MJS object that represents MATLAB Job Scheduler cluster compute resources. To create the object, use theparcluster function.

Example: myCluster = parcluster("myMJSProfile")

Tips

Version History

Introduced before R2006a