[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

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

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
  1. Create a new job named “DemoJob”.

    1. In Actions, click New Job.

    2. In Job name, type 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.

    1. In Edit Tasks, click the arrow on the Add button, then click Node Preparation Task.

    2. In Command, type the following:

      hostname>>prep.txt

    3. Click Save.

  3. Add a Parametric Sweep task with 20 steps that writes its task instance ID to the prep.txt file.

    1. In Edit Tasks, click the arrow on the Add button, and then click Parametric Sweep Task.

    2. Set the Start value to 1.

    3. Set the End value to 20.

    4. Set the Increment value to 1.

    5. In Command, type:

      echo Task Instance ID %CCP_TASKINSTANCEID% >> prep.txt

    6. Click Save.

  4. Add a Node Release task that runs cleanup.bat on each node.

    1. In Edit Tasks, click the arrow on the Add button, and then click Node Release Task.

    2. In Command, type:

      \\headnodeR2\c$\Users\myLogon\cleanup.bat

    3. Click Save.

  5. 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”.

New-HpcJob –Name DemoJob

job new /jobName:”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.

Add-HpcTask –jobID <ID> –Type NodePrep –Command “hostname>>prep.txt”

Job add <ID> -Type:”NodePrep” hostname ”>>prep.txt”

3. Add a Parametric Sweep task with 20 steps that writes its task instance ID to the prep.txt file.

Add-HpcTask –jobID <ID> –Type ParametricSweep –start 1 –end 20 –increment 1 –command “echo Task Instance ID %CCP_TASKINSTANCEID% >> prep.txt”

Job add <ID> -parametric:1-20:1 echo Task Instance ID %CCP_TASKINSTANCEID% “>> prep.txt”

4. Add a Node Release task that runs cleanup.bat on each node.

Add-HpcTask –jobID <ID> –Type NodeRelease –command “\\headnodeR2\c$\Users\Public\cleanup.bat”

Job add <ID> -Type:”NodeRelease” \\headnodeR2\c$\Users\Public\cleanup.bat

5. Submit DemoJob.

Submit-HpcJob –id <ID>

Job submit –id:<ID>

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.