Main Content

polyspaceJobsManager

Manage Polyspace jobs on a MATLAB Parallel Server cluster

Description

polyspaceJobsManager('listjobs') lists all Polyspace® jobs in your cluster.

example

polyspaceJobsManager('cancel','-job',jobNumber) cancels the specified job. The job appears in your queue as cancelled.

example

polyspaceJobsManager('remove','-job',jobNumber) removes the specified job from your cluster.

example

polyspaceJobsManager('getstatus','-job',jobNumber) returns the current status of the specified job, for example queued, running, or completed.

polyspaceJobsManager('getlog','-job',jobNumber) displays the log for the specified job.

example

polyspaceJobsManager('wait','-job',jobNumber) pauses until the specified job is done.

polyspaceJobsManager('promote','-job',jobNumber) moves the specified job up in the MATLAB® job scheduler queue.

example

polyspaceJobsManager('demote','-job',jobNumber) moves the specified job down in the MATLAB job scheduler queue.

polyspaceJobsManager('download','-job',jobNumber) downloads the results from the specified job. The results are downloaded to the folder you specified when starting analysis, using the -results-dir option.

polyspaceJobsManager('download','-job',jobNumber,'-results-folder',resultsFolder) downloads the results from the specified job to resultsFolder.

example

polyspaceJobsManager(___,'-scheduler',scheduler) performs the specified action on the job scheduler specified. If you do not specify a server with any of the previous syntaxes, Polyspace uses the server stored in your Polyspace preferences.

example

Examples

collapse all

In this example, use a MATLAB Job Scheduler scheduler to run Polyspace remotely and monitor your jobs through the queue.

Before performing this example, set up a MATLAB Job Scheduler. This example uses the myMJS@myCompany.com scheduler. When you perform this example, replace this scheduler with your own cluster name.

Set up your source files.

tempDir = fullfile(tempdir, 'psdemo', 'src');
mkdir(tempDir);
demo = fullfile(polyspaceroot,'polyspace','examples','cxx',...
'Code_Prover_Example','sources');
copyfile(demo,tempDir,'f');

Submit two jobs to your scheduler. Each command returns a status and the ID of the job in the scheduler queue.

allFiles = fullfile(tempDir, '*.c')
oneFile = fullfile(tempDir, 'numerical.c');
resFolder1 = fullfile(tempDir, 'res1');
resFolder2 = fullfile(tempDir, 'res2');
[status1, jobID1] = polyspaceCodeProver('-batch', '-scheduler', 'myMJS@myCompany.com',...
 '-sources', allFiles,'-results-dir' resFolder1);
[status2, jobID2] = polyspaceCodeProver('-batch', '-scheduler', 'myMJS@myCompany.com',...
 '-sources', oneFile,'-results-dir' resFolder2);

If your jobs have not started running, promote the second job to run before the first job.

polyspaceJobsManager('promote','-job',jobID2,'-scheduler','myMJS@myCompany.com')

The second job (jobID2) starts running before the first job (jobID1).

Cancel job jobID1.

polyspaceJobsManager('cancel','-job',jobID1,'-scheduler','myMJS@myCompany.com')
polyspaceJobsManager('listjobs','-scheduler','myMJS@myCompany.com')
ID	AUTHOR	APPLICATION	LOCAL_RESULTS_DIR	WORKER	STATUS	DATE	LANG	CLUSTER_MODE
...
19	user	Polyspace	C:\Temp\psdemo\res1		cancelled	Wed Mar 16 16:48:38 EST 2014	C	Batch
20	user	Polyspace	C:\Temp\psdemo\res2		running	Wed Mar 16 16:48:38 EST 2014	C	Batch

Remove job jobID1.

polyspaceJobsManager('remove','-job',jobID1,'-scheduler','myMJS@myCompany.com')
polyspaceJobsManager('listjobs','-scheduler','myMJS@myCompany.com')
ID	AUTHOR	APPLICATION	LOCAL_RESULTS_DIR	WORKER	STATUS	DATE	LANG	CLUSTER_MODE
...
20	user	Polyspace	C:\psdemo\res2		completed	Wed Mar 16 16:48:38 EST 2014	C	Batch

Get the log for job jobID2.

polyspaceJobsManager('getlog','-job',jobID2,'-scheduler','myMJS@myCompany.com')

Download the information from job jobID2.

resFolder3 = fullfile(tempDir, 'res3');
polyspaceJobsManager('download','-job',jobID2,'-results-folder',resFolder3,'-scheduler','myCluster')

Input Arguments

collapse all

Number of the queued job that you want to manage, specified as a character vector in single quotes.

Example: '-job','10'

Path to results folder specified as a character vector in single quotes. This folder stores the downloaded results files.

Example: '-results-folder','C:\psdemo\myresults'

Job scheduler for remote verifications specified as one of the following:

  • Name of the computer that hosts the head node of your MATLAB Parallel Server™ cluster (NodeHost).

  • Name of the MATLAB Job Scheduler on the head node host (MJSName@NodeHost).

  • Name of a MATLAB cluster profile (ClusterProfile).

Example: '-scheduler','myscheduler@mycompany.com'

Version History

Introduced in R2013b