After you create the cleanup.bat file, create and submit DemoJob by using HPC Job Manager, HPC PowerShell, or a Command Prompt window.
In this topic:
- Create and submit
DemoJob by using HPC Job Manager
- Create and submit DemoJob
by using HPC PowerShell or a Command Prompt window
Create and submit DemoJob by using HPC Job Manager
The following procedure describes how to create and submit DemoJob, where <ID> is the job ID that is associated with DemoJob, and \\headnodeR2\c$\Users\Public\cleanup.bat points to the batch file that you created in Step 1: Create the cleanup.bat File.
![]() |
To create and submit DemoJob by using HPC Job Manager |
-
Create a new job named “DemoJob”.
- In Actions, click New Job.
- In Job name, type DemoJob.
- In Actions, click New Job.
-
Add a Node Preparation task that creates a file named prep.txt on each node, and writes the node name to the file.
- In Edit Tasks, click the arrow on the Add button,
then click Node Preparation Task.
- In Command, type the following:
hostname>>prep.txt
- Click Save.
- In Edit Tasks, click the arrow on the Add button,
then click Node Preparation Task.
-
Add a Parametric Sweep task with 20 steps that writes its task instance ID to the prep.txt file.
- In Edit Tasks, click the arrow on the Add button,
and then click Parametric Sweep Task.
- Set the Start value to 1.
- Set the End value to 20.
- Set the Increment value to 1.
- In Command, type:
echo Task Instance ID %CCP_TASKINSTANCEID% >> prep.txt
- Click Save.
- In Edit Tasks, click the arrow on the Add button,
and then click Parametric Sweep Task.
-
Add a Node Release task that runs cleanup.bat on each node.
- In Edit Tasks, click the arrow on the Add button,
and then click Node Release Task.
- In Command, type:
\\headnodeR2\c$\Users\myLogon\cleanup.bat
- Click Save.
- In Edit Tasks, click the arrow on the Add button,
and then click Node Release Task.
-
Click Submit.
Continue to Verification: Check Job Completion and Output.
Create and submit DemoJob by using HPC PowerShell or a Command Prompt window
The following table describes how to create and submit DemoJob by using HPC PowerShell or a Command Prompt window, where <ID> is the job ID that is associated with DemoJob, and \\headnodeR2\c$\Users\Public\cleanup.bat points to the batch file that you created in Step 1: Create the cleanup.bat File.
Action | HPC PowerShell | Command Prompt window |
---|---|---|
1. Create a new job named “DemoJob”. |
|
|
2. Add a Node Preparation task that creates a file named prep.txt on each node, and writes the node name to the file. |
|
|
3. Add a Parametric Sweep task with 20 steps that writes its task instance ID to the prep.txt file. |
|
|
4. Add a Node Release task that runs cleanup.bat on each node. |
|
|
5. Submit DemoJob. |
|
|
In HPC PowerShell, you can avoid specifying the job ID by piping the cmdlets together. For example, DemoJob can be submitted as follows, where \\headnodeR2\c$\Users\Public\cleanup.bat points to the batch file that you created in Step 1: Create the cleanup.bat File:
New-HpcJob –Name DemoJob|Add-HpcTask –Type NodePrep –Command “hostname>>prep.txt”|Add-HpcTask –Type ParametricSweep –start 1 –end 20 –increment 1 –command “echo Task Instance ID %CCP_TASKINSTANCEID% >> prep.txt”|Add-HpcTask –Type NodeRelease –command “\\headnodeR2\c$\Users\myLogon\cleanup.bat”|Submit-HpcJob
Continue to Verification: Check Job Completion and Output.