Job Submission in Windows HPC Server 2008 R2 Quick Reference

Applies To: Windows HPC Server 2008 R2

This topic provides a quick reference for common job submission and job management actions Windows® HPC Server 2008 R2. The tables below provide links to help topics for performing these actions using the three primary job submission interfaces in Windows HPC Server 2008 R2: HPC Job Manager, the Command Prompt window, and HPC PowerShell.

Looking for the Windows HPC 2008 Quick Reference guide? See Job Submission in Windows HPC Server 2008 Quick Reference.

In this topic:

  • Submit jobs

  • Manage your jobs

  • Additional job submission resources

Submit jobs

To submit a job, you must have been added as a user on the cluster, or you must be a member of a doMayn group that has been added as a user on the cluster. For more information, contact your cluster administrator.

Action HPC Job Manager Command-prompt window HPC PowerShell

Create and submit a job

Create a New Job

job new

job add<jobID>

job submit/id:<jobID>

For example:

Job new /priority:3000

Job add 12 /type:nodepreparation copy /Y \\networkShare\bin\myApp.exe c:\apps

Job add 12 myApp.exe

Job submit /id:12

New-HpcJob

Add-HpcTask–jobID <jobID>

Submit-HpcJob–ID <jobID>

For example:

$j=New-hpcJob –priority 3000

Add-HpcTask -jobID $j –type nodeprep -command “copy /Y \\networkShare\bin\myApp.exe c:\apps”

Add-HpcTask -jobID $j –command “myApp.exe”

Submit-HpcJob –id $j

Quickly submit a single-task job

In HPC Job Manager, in the Actions pane, click New Single-Task Job or New Parametric Sweep Job.

job submit<command> [<arguments>]

For example:

Job submit /numcores:24 myApp.exe

or

Job submit /parametric:1-100:1 /workdir:c:\apps mySweep.exe \\datashare\myInput \input*.txt

Not available

Add an MPI task

Define a Basic or MPI Task[HPCv3JobScheduler]

job add<jobID>

Include the launcher mpiexec in the command line of the task.

For example:

Job add 12 /numcores:24 mpiexec myApp.exe

Add-HpcTask–jobID <jobID>

Include the launcher mpiexec in the -Command parameter.

For example:

Add-HpcTask -jobID 12 –numcores 24 –command “mpiexec myApp.exe”

Add a parametric task

Define a Parametric Sweep Task [HPCv3JobScheduler]

job add<jobID>/parametric:<start-end:increment>

For example:

Job add 12 /parametric:1-100:1 /workdir:c:\apps mySweep.exe \\datashare\myInput\input***.txt

Add-HpcTask–jobID <jobID> –Type ParametricSweep -Start <int> -End <int> -Increment <int>

The default increment is 1, so unless your increment is different, you can omit this parameter.

For example:

Add-HpcTask –jobID 12 –Type ParametricSweep –start 1 –end 100 –WorkDir c:\apps –command “myApp.exe \\datashare\myInput\input***.txt”

Define task dependencies

Define Task Dependencies [HPCv3JobScheduler]

job add<jobID> /depend:<task_name>

For example:

Job add 12 /name:task1 /stdout:C:\apps\app1out\data.dat app1.exe

Job add 12 /name:task2 /depends:task1 /stdin:C:\apps\app1out\data.dat app2.exe

Add-HpcTask–jobID <jobID> -Depend <taskName>

For example:

Add-HpcTask –jobID 12 –name task1 –stdout C:\apps\app1out\data.dat –command app1.exe

Add-HpcTask –jobID 12 –name task2 –depend task1 –stdin C:\apps\app1out\data.dat –command app2.exe

Configure nodes before your Mayn tasks run

Define a Node Preparation Task

job add<jobID>/type:nodepreparation

For example:

Job add 12 /type:nodepreparation copy /Y \\networkShare\bin\myApp.exe c:\apps

Add-HpcTask–jobID <jobID> –Type nodePrep

For example:

Add-HpcTask -jobID 12 –type nodeprep -command “copy /Y \\networkShare\bin\myApp.exe c:\apps”

Clean up nodes after your Mayn tasks run

Define a Node Release Task

job add<jobID>/type:noderelease

For example:

Job add 12 /type:noderelease /workdir:c:\apps del /Q myApp.exe ^& del /Q myApp.tmp.^^^*

Add-HpcTask–jobID <jobID> –Type nodeRelease

For example:

Add-HpcTask -jobID 12 –type nodeRelease –workDir c:\apps -command “del /Q myApp.exe & del /Q myApp.tmp.^*”

Manage your jobs

To copy, save, cancel, requeue, or modify a job, or to view job or task details and results, you must be the submitting user (the job owner), or have administrative permissions.

Actions HPC Job Manager Command-prompt window HPC PowerShell

View job properties and results

View a Job or Task

job view<jobID>

For example:

Job view 12

For more details:

Job view 12 -detailed

Get-HpcJob-id <jobID>

For example:

get-hpcjob –id 12

For more details, pipe into fl (Format-List):

get-hpcjob –id 12|fl

For specific properties, pipe into select:

get-hpcjob –id 12|select id, name, allocatednodes

View task properties and results

View a Job or Task

task view<jobID>.<taskID>.<subTaskID>

For example, to view all tasks for a job:

task view 12

To see a specific task with more details:

task view 12.1 -detailed

Get-HpcTask-jobID <jobID> -taskID <taskID> -subtaskID <subtaskID>

For example, to view all tasks for a job:

get-hpctask –jobid 12

To see a specific task with more details, pipe into fl:

get-hpctask –jobid 12 –taskid 1|fl

To filter tasks by state and see specific properties:

get-hpctask –jobid 12 –state failed|select id, subtaskid, exitcode, errormessage, allocatednodes

Track the state of your jobs

Track Job State

job list

For example, to see your active jobs (queued or running):

Job list

Get-HpcJob

For example, to see your active jobs (queued or running):

Get-hpcjob

Save a job to an XML description file

Save a Job or Task to a File

Not available

Export-HpcJob–id <jobID> -path <path>

For example, to save the job XML to c:\myJobs\myAppJob.xml:

Export-HpcJob –id 12 -Path c:\myJobs\myAppJob.xml

Save a task to an XML description file

Save a Job or Task to a File

Not available

Export-HpcTask–id <jobID> -taskID <taskID> -path <path>

For example to save the task XML to c:\myJobs\myNodePrepTask.xml:

Export-HpcTask –id 12 –taskID 1 -Path c:\myJobs\myNodePrepTask.xml

Requeue a canceled or failed job

Requeue a Job or Task

job requeue<jobID>

For example:

Job requeue 12

Submit-HpcJob–ID <jobID>

For example:

Submit-HpcJob –id 12

Requeue a task

Requeue a Job or Task

task requeue<jobID>.<taskID>.<subTaskID>

For example:

task requeue 12.1

Get-HpcTask

Use the Requeue method of the HPCTask object. For example:

(get-hpctask –jobid 12 –taskid 1).requeue()

Copy a job or resubmit a finished job

Copy a Job or Task

job clone<jobID>

job submit/id:<jobID>

For example:

Job clone 12

To copy, modify priority, and then submit:

Job clone 12

Job submit /id:13 /priority:3500

Get-HpcJob–ID <jobID>

New-HpcJob–ID <jobID>

For example:

get-hpcjob –id 12|new-hpcjob

To copy, modify priority, and then submit:

get-hpcjob –id 12|new-hpcjob –priority 3500|submit-hpcjob

Copy a task

Copy a Job or Task

Not available

Not available

Cancel a job

Cancel a Job or Task

This topic also describes what happens to job and task states on cancellation.

Using HPC PowerShell or a command prompt, you have the additional option to Force Cancel a Job or Task. You cannot force cancel using HPC Job Manager.

job cancel<jobID>

For example:

job cancel 12

To force cancel (skip task cancel grace period and node release tasks):

job cancel 12 /force

Stop-HpcJob–ID <jobID>

For example:

To force cancel (skip task cancel grace period and node release tasks):

Stop-HpcJob –id 12 -force

Cancel a task

Cancel a Job or Task

task cancel<jobID>.<taskID>.<subtaskID>

For example:

task cancel 12.1

To force cancel a subtask (skip task cancel grace period):

task cancel 12.1.1 /force

Stop-HpcTask–jobID <jobID> -taskID <taskID>

For example:

Stop-HpcTask –JobId 12 -TaskID 1

Alternately, you can use the Cancel method of the HPCTask object. For example:

(get-hpctask –jobid 30 –taskid 1).cancel()

To force cancel a subtask (skip task cancel grace period):

Stop-HpcTask –JobId 12 -TaskID 1 –subtaskID 1 -force

End a “run until canceled” job as Finished

Not available

job finish<jobID>

For example:

Job finish 12

Stop-HpcJob–ID <jobID> -state finished

For example:

Stop-HpcJob –id 12 –state finished

Modify a job

Modify a Job

This topic also describes what properties can be modified in each job state.

job modify<jobID>

For example, to specify a required license:

Job modify 12 /license:<licenseName:numberRequired>

Set-HpcJob–id <jobID>

For example, to specify a required license:

Set-HpcJob -id 12 -license <licenseName:numberRequired>

Exclude specific nodes from your job

Not available

For more information, see Define Excluded Nodes for a Job

job modify<jobID> -addexcludednodes:<nodeName1,nodeName2,…>

The node list is comma separated. Do not include spaces.

For example:

Job modify 12 –addExludedNodes:CN003,CN006

Set-HpcJob–id <jobID> -addExcludedNodes <nodeName1, nodeName2,…>

For example:

Set-HpcJob –Id 12 /addExludedNodes CN003, CN006

Additional job submission resources