Share via


Define Task Dependencies

 

Applies To: Microsoft HPC Pack 2008 R2, 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.

Tip

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

  1. In the Navigation Pane, click All Jobs.

  2. In the job list, click the job that you want to modify.

  3. Right-click your selection and click Modify Job.

  4. Click Advanced.

  5. Set any job property (for example, set Hold job until to some time in the future). This will change the job state to Configuring.

  6. Click Modify to apply the changes. If necessary, requeue your job.

  7. Right-click the job again and then click Modify Job.

  8. Edit the task.

  9. Click Advanced and remove the hold.

  10. Submit job.

Define task dependencies

You can use the following procedure to define task dependencies using HPC Job Manager.

Note

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 Cluster 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

  1. In Job Management, in the Actions pane, click New Job.

  2. In the left pane of the New Job dialog box, click Edit Tasks.

  3. 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.

  4. To set the order in which the tasks are run, click the Dependency button.

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

    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.

    2. Click one or more tasks, then use the Move Up and Move Down buttons to move the selected tasks between groups.

    3. Click OK to accept the task dependency grouping and return to the Create New Job dialog box.

    Note

    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.

  6. Use the New Job dialog box to set additional job properties as needed.

  7. Click Submit.

Additional considerations

  • 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 Microsoft HPC Pack.

Additional references