Share via


Windows PowerShell Cmdlet Equivalents for HPC Command-Line Commands

Applies To: Windows HPC Server 2008, Windows HPC Server 2008 R2

Windows® HPC Server 2008 and Windows HPC Server 2008 R2 provide command-line commands and HPC cmdlets for Windows PowerShell as alternative ways to perform many of the same tasks that you can perform in HPC Cluster Manager. HPC cmdlets are HPC-specific cmdlets for Windows HPC PowerShell that become available when you add the Microsoft.HPC snap-in or open an HPC PowerShell window. You can use the command-line commands or HPC cmdlets in scripts to automate a series of tasks that you perform regularly.

You can use HPC cmdlets to perform most of the same tasks in Windows HPC Server 2008 and Windows HPC Server 2008 R2 that you can perform with command-line commands, in addition to many additional tasks that you cannot perform with command-line commands. Windows PowerShell also provides a powerful and flexible scripting environment, so you may want to consider converting existing command files and batch files that use command-line commands to PowerShell scripts to take advantage of these features.

The following table provides a list of the HPC cmdlets that are similar to the command-line commands in Windows HPC Server 2008 and Windows HPC Server 2008 R2. You can use them to convert command files and batch files that use command-line commands to PowerShell scripts. For command-line commands that have no equivalent HPC cmdlet, you can run the command-line commands within an HPC PowerShell window or in a script just as you would run them at a command prompt.

Note

The HPC cmdlet that the table lists is not always entirely identical to the corresponding command-line command. In some cases, the parameters that are available for the command-line command are not available or they differ from those for the HPC cmdlet, or the output for the HPC cmdlet differs slightly from that of the command-line command. In most cases, though, these differences are minor and you can use the PowerShell cmdlet for the same purposes as the command-line command. For more information about the parameters and the behavior of a specific HPC cmdlet, see the Help topic for that HPC cmdlet.

Command-line command Command-line example HPC cmdlet HPC cmdlet example

cluscfg delcreds

cluscfg delcreds /user:CONTOSO\someone 

Remove-HpcJobCredential

Remove-HpcJobCredential -UserName CONTOSO\someone

cluscfg listenvs

cluscfg listenvs 

Get-HpcClusterProperty with the Environment parameter

Get-HpcClusterProperty -Environment

cluscfg listparams

cluscfg listparams 

Get-HpcClusterProperty with the Parameter parameter

Get-HpcClusterProperty -Parameter

cluscfg mailcred (Windows HPC Server 2008 R2 only)

cluscfg mailcred /user:CONTOSO\someone /password:* 

Set-HpcClusterProperty with the EmailCredential parameter

Set-HpcClusterProperty -EmailCredential CONTOSO\someone

cluscfg setcreds

cluscfg setcreds /user:CONTOSO\someone 

Set-HpcJobCredential

Set-HpcJobCredential -Credential CONTOSO\someone

cluscfg setenvs

cluscfg setenvs MyVariable=10 

Set-HpcClusterProperty with the Environment parameter

Set-HpcClusterProperty -Environment MyVariable=10

cluscfg setparams

cluscfg setparams InactivityCount=5 

Set-HpcClusterProperty with the parameter that has the same name as the cluster-wide parameter that you want to set, that is: Set-HpcClusterProperty -<ParameterName>.

Set-HpcClusterProperty -InactivityCount 5

cluscfg view

cluscfg view 

Get-HpcClusterOverview

Get-HpcClusterOverview

clusrun

clusrun /all dir 

None

 

etl2clog

mpiexec -cores 1 etl2clog mpi_trace.etl 

None

 

etl2otf

mpiexec -cores 1 etl2otf mpi_trace.etl

None

 

hpcfwutil (Windows HPC Server 2008 R2 only)

hpcfwutil reset /v

None

 

job add

job add 184 /name:MyTask ipconfig 

Add-HpcTask

Add-HpcTask -JobId 184 -Name MyTask -CommandLine ipconfig

job cancel

job cancel 215

Stop-HpcJob, with the job identifier for the running or pending job that you want to cancel specified by the Id parameter

Stop-HpcJob -Id 215

job finish (Windows HPC Server 2008 R2 only)

job finish 67

Stop-HpcJob with a value of Finished for the State parameter

Stop-HpcJob -Id 67 -State Finished

job list

job list /state:Configuring 

Get-HpcJob

Get-HpcJob -State Configuring

job listtasks

job listtasks 79 

Get-HpcTask, with the identifier of the job for which you want to list the tasks specified as the value of JobId parameter and then redirect the output to the Format-List (https://go.microsoft.com/fwlink/?LinkId=143534) cmdlet

Get-HpcTask -JobId 79 | Format-List

job modify

job modify 212 /runtime:0:0:30 

Set-HpcJob

Set-HpcJob -Id 212 -Runtime 0:0:30

job new

job new /jobname:MyJob /projectname:MyProject -runtime:0:0:30 

New-HpcJob

New-HpcJob -Name MyJob -Project MyProject -Runtime 0:0:30

job requeue

job requeue 214

Submit-HpcJob, with the job identifier for a job in the Canceled or Failed state that you want to requeue specified as the value for the Id parameter

Submit-HpcJob -Id 214

job submit

job submit /id:213 

Submit-HpcJob

Submit-HpcJob -Id 213

job view

job view 177

Get-HpcJob, with the job identifier for the job for which you want to view information specified as the value for the Id parameter and then redirect the output to the Format-List (https://go.microsoft.com/fwlink/?LinkId=143534s) cmdlet

Get-HpcJob -Id 177 | Format-List

jobtemplate add

jobtemplate add /file:C:\MyTemplates\MyNewJobTemplate.xml 

Import-HpcJobTemplate

Import-HpcJobTemplate -Path C:\MyTemplates\MyNewJobTemplate.xml -Name MyNewJobTemplate

jobtemplate delete

jobtemplate delete MyOutdatedJobTemplate 

Remove-HpcJobTemplate

Remove-HpcJobTemplate -Name MyOutdatedJobTemplate

jobtemplate deny

jobtemplate deny MyJobTemplate CONTOSO\someone /perm:M 

None

 

jobtemplate grant

jobtemplate grant MyJobTemplate CONTOSO\someone /perm:S 

None

 

jobtemplate remove

jobtemplate remove MyJobTemplate CONTOSO\someone 

None

 

jobtemplate list

jobtemplate list 

Get-HpcJobTemplate

Get-HpcJobTemplate

jobtemplate view

jobtemplate view MyCustomJobTemplate 

Get-HpcJobTemplate, with the name of the job template specified as the value for the Name parameter and then redirect the output to the Format-List (https://go.microsoft.com/fwlink/?LinkId=143534) cmdlet

Get-HpcJobTemplate -Name MyCustomJobTemplate | Format-List

mpicsync

mpiexec -cores 1 mpicsync mpi_trace.etl

None

 

mpiexec

mpiexec /np * app1 

None

 

mpipingpong

job submit /numnodes:3 mpiexec /hosts 3 ComputeNode1 ComputeNode2 ComputeNode3 mpipingpong -pl

or

job submit /numnodes:3 mpiexec /hosts 3 ComputeNode1 ComputeNode2 ComputeNode3 mpipingpong -pt 

For Windows HPC Server 2008, Invoke-HpcTest with one of the following values specified for the Name parameter: "MPI Ping-Pong: Quick Check" or "MPI Ping-Pong: Lightweight Throughput"

For Windows HPC Server 2008 R2, Invoke-HpcTest with one of the following values specified for the Alias parameter: mpipplatency or mpippthroughput

For Windows HPC Server 2008:

Invoke-HpcTest -Name "MPI Ping-Pong: Quick Check" -NodeName ComputeNode1,ComputeNode2,ComputeNode3

or

Invoke-HpcTest -Name "MPI Ping-Pong: Lightweight Throughput" -NodeName ComputeNode1,ComputeNode2,ComputeNode3

For Windows HPC Server 2008 R2:

Invoke-HpcTest -Alias mpipplatency -NodeName ComputeNode1,ComputeNode2,ComputeNode3

or

Invoke-HpcTest -Alias mpippthroughput -NodeName ComputeNode1,ComputeNode2,ComputeNode3

node list

node list 

Get-HpcNode

Get-HpcNode

node listcores

node listcores 

None

 

node offline (Windows HPC Server 2008 R2 only)

node offline computenode46

Set-HpcNodeState with a value of Offline specified for the State parameter

Set-HpcNodeState -Name computenode46 -State Offline

node online (Windows HPC Server 2008 R2 only)

node online computenode82

Set-HpcNodeState with a value of Online specified for the State parameter

Set-HpcNodeState -Name computenode82 -State Online

node view

node view MyComputeNode 

Get-HpcNode, with the name of the node for which you want to view information specified as the value of the Name parameter and then redirect the output to the Format-List (https://go.microsoft.com/fwlink/?LinkId=143534) cmdlet

Get-HpcNode -Name MyComputeNode | Format-List

node pause (deprecated)

node pause MyComputeNode 

Set-HpcNodeState with a value of Offline specified for the State parameter

Set-HpcNodeState -Name MyComputeNode -State Offline

node resume (deprecated)

node resume MyComputeNode 

Set-HpcNodeState with a value of Online specified for the State parameter

Set-HpcNodeState -Name MyComputeNode -State Online

task cancel

task cancel 215.2

Get-HpcTask with the job and task identifiers specified by the JobId and TaskId parameters to get the HpcTask object for the task, then call the Cancel method for the HpcTask object

(Get-HpcTask -JobId 215 -TaskID 2).Cancel() 

or

$t = Get-HpcTask -JobId 215 -TaskID 2
$t.Cancel()

task requeue

task requeue 215.3

Get-HpcTask with the job and task identifiers specified by the JobId and TaskId parameters to get the HpcTask object for the task, then call the Requeue method for the HpcTask object

(Get-HpcTask -JobId 215 -TaskID 3).Requeue() 

or

$t = Get-HpcTask -JobId 215 -TaskID 3
$t.Requeue()

task view

task view 177.2 

Get-HpcTask, with the job and task identifiers for the task specified by the JobId and TaskId parameters and the output redirected to the Format-List (https://go.microsoft.com/fwlink/?LinkId=143534) cmdlet

Get-HpcTask -JobId 177 -TaskId 2 | Format-List

test add (Windows HPC Server 2008 R2 only)

test add C:\DiagnosticTest\CustomSuite1.xml

Add-HpcTest

Add-HpcTest –File "C:\DiagnosticTest\CustomSuite1.xml"

test cancel (Windows HPC Server 2008 R2 only)

test cancel 28

Stop-HpcTestResult

Stop-HpcTestResult -RunId 28

test listruns (Windows HPC Server 2008 R2 only)

test listruns

Get-HpcTestResult

Get-HpcTestResult

test listtests (Windows HPC Server 2008 R2 only)

test listtests /server:HeadNode

Get-HpcTest

Get-HpcTest -Scheduler HeadNode

test remove (Windows HPC Server 2008 R2 only)

test remove MyCustomTest

Remove-HpcTest

Remove-HpcTest -Alias MyCustomTest

test run (Windows HPC Server 2008 R2 only)

test run MyDailyTest -nodes:HeadNode,ComputeNode1,ComputeNode2

Invoke-HpcTest

Invoke-HpcTest -Alias MyDailyTest -Nodes HeadNode,ComputeNode1,ComputeNode2

test setcreds (Windows HPC Server 2008 R2 only)

test setcreds /username:CONTOSO\someone

Set-HpcTestCredential

Set-HpcTestCrendential -Credential CONTOSO\someone

test viewresult (Windows HPC Server 2008 R2 only)

test viewresult 31

Run Export-HpcTestResult, then open the exported Report.html file

Run Export-HpcTestResult -RunId 31 -Path C:\TestResults\Run31, then open C:\TestResults\Run31\Report.html.

test viewrun (Windows HPC Server 2008 R2 only)

test viewrun 12

Get-HpcTestResultDetail

Get-HpcTestResultDetail –RunId 12

test viewtest (Windows HPC Server 2008 R2 only)

test viewtest CustomTest3

Get-HpcTestDetail

Get-HpcTestDetail –Alias CustomTest3

For information about using HPC PowerShell, see Appendix 6: Using HPC PowerShell (https://go.microsoft.com/fwlink/?LinkId=151474).

For information about using Windows PowerShell, see Windows PowerShell (https://go.microsoft.com/fwlink/?LinkId=128257) and Windows PowerShell (TechNet) (https://go.microsoft.com/fwlink/?LinkId=128426).

For information about built-in Windows PowerShell cmdlets, see Windows PowerShell Cmdlet Help Topics (https://go.microsoft.com/fwlink/?LinkId=113277).

See Also

Concepts

Windows HPC Server 2008 and Windows HPC Server 2008 R2 Command Reference Windows HPC Server 2008 PowerShell Reference

Other Resources

Windows HPC Server 2008 R2 PowerShell Reference