Define Task Dependencies
Updated: January 13, 2014
Applies To: Microsoft HPC Pack 2012, Microsoft HPC Pack 2012 R2
You can establish the order in which tasks are run by defining dependencies between the tasks. You cannot define task dependencies for tasks which are started on a per-resource basis (Node Preparation, Node Release, and Service tasks). For more information, see Understanding Task Types.
By grouping tasks, you can specify the order in which tasks are run. All tasks in a group must finish before any tasks in the next group can start. Grouping tasks allows you to specify whether dependent tasks run if parent task fails. You can specify whether or not dependent tasks should continue if a parent task fails or is canceled. By default, the property is not set, in which case all dependent tasks continue to run even if some of the parent tasks fail or get canceled. If you set this property to true, all dependent tasks fail upon the failure of any parent tasks.
To improve task submission with dependencies, add new tasks to the same task group by using the same name for all new tasks.
If a task fails, it can be modified to correct the error so the job can be requeued and dependent jobs can be run. Once the task is modified, the job can be resubmitted without changing the original Job ID.
To modify task on a failed job
In the Navigation Pane, click All Jobs.
In the job list, click the job that you want to modify.
Right-click your selection and click Modify Job.
Set any job property (for example, set Hold job until to some time in the future). This will change the job state to Configuring.
Click Modify to apply the changes. If necessary, requeue your job.
Right-click the job again and then click Modify Job.
Edit the task.
Click Advanced and remove the hold.
You can use the following procedure to define task dependencies using HPC Job Manager.
To complete this procedure, you must have been added as a user on the cluster, or you must be a member of a domain group that has been added as a user on the cluster. For more information, contact your cluster administrator.
In HPC Job Manager, the option to define task dependencies is available in the New Job, Modify Job, and Copy Job dialog boxes. As an example, the following procedure describes how to add a task in the New Job dialog box.
To create a task flow job
In HPC Job Manager, in the Actions pane, click New Job.
In the left pane of the New Job dialog box, click Edit Tasks.
Add tasks to your job:
To create a new task, point to the Add button, click the down arrow, then select a task type. In the task dialog box, provide information for your task, and then click Save to add the task to your job and return to the New Job dialog box.
To add a saved task to your job, point to the Add button, click the down arrow, and then click From Task File. Navigate to the location of the task XML file and click Open to add the task to your job and return to the New Job dialog box.
In the New Job dialog box, you can see a list of the tasks that you added.
To set the order in which the tasks are run, click the Dependency button.
In the Task Dependency dialog box, you can organize your tasks into groups. All tasks in a group will complete before any tasks in the next group are started. Initially, all of your tasks are part of Group 1.
Under Groups, click the Add button to add a group. Add as many groups as your job requires. Note that the Remove button only removes the selected grouping level, it does not remove the tasks themselves.
Click one or more tasks, then use the Move Up and Move Down buttons to move the selected tasks between groups.
Click OK to accept the task dependency grouping and return to the Create New Job dialog box.
By default, tasks are assigned to Group 1. If you add more tasks to your job, return to the Task Dependency dialog box to ensure that the tasks are ordered as you intended.
Use the New Job dialog box to set additional job properties as needed.
You can create more complex, non-linear task dependencies using the command prompt window, HPC PowerShell, or by using the HPC application programming interfaces (APIs). For more information, see Online Resources.
For information about basic terminology, opening HPC Job Manager, and connecting to a cluster, see Overview of HPC Job Manager.