none
HPC Task Dependency RRS feed

  • Question

  • Our workflow requires that a job be submitted with an initial task then later tasks will be added on dynamically.  I can not get the tasks to be dependant on each other, they always end up as a single group and thus would be run in parallel.

    Steps:
    1. Submit job with first task named 'A'
    2. During creation of second task additionally call: task.DependsOn.Add("A"); to set the dependancy which should create a 'Group 2' in the HPC Job Manager GUI.

    Is there an additional step needed?

    I have been able to get this to work from the HPC Job Manger GUI but not been able to do it programatically.

    I am running the released HPC 2008 and linked against these versions.
    Microsoft.Hpc.Scheduler.dll -- 2.0.1551.0
    Microsoft.Hpc.Scheduler.Properties.dll -- 2.0.1551.0
    Microsoft.Hpc.Scheduler.Session.dll -- 2.0.1551.0
    Microsoft.Hpc.Scheduler.Store.dll -- 2.0.1452.0

    Is thte HPC Job Manger still using the old CCP assemblies (which would make this a bug in the new Hpc named ones?)
    Wednesday, November 19, 2008 12:55 AM

All replies

  • The HPC Server API allows task dependencies to be created that are more complex than the type of dependencies that can be created using the HPC Job Manager GUI. Therefore, the dependencies created using the API (or the CLI or Powershell) are not visible in the HPC Job manager GUI, even if they are very simple dependencies.

    Thursday, November 19, 2009 7:37 PM
  • One assumption I've made in my answer here is that your C# code is correctly creating the task dependency, but that you're incorrectly expecting the GUI to display the dependency. To be clear, if you wish to verify task dependencies created using the API, then you cannot use the GUI to do the verification. Instead, you will need to use the API or Powershell or the command-line tools to do the verification.

    For example, the following C# code submits a single-task job, and then adds a new task which depends on the first task:

    ISchedulerJob job = scheduler.CreateJob();
    
    ISchedulerTask taskA = job.CreateTask();
    taskA.CommandLine = "notepad";
    taskA.Name = "A";
    job.AddTask(taskA);
    scheduler.SubmitJob(
      job, // ISchedulerJob job,
      null, // string username,
      null // string password
      );
    
    ISchedulerTask taskB = job.CreateTask();
    taskB.CommandLine = "hostname";
    taskB.Name = "B";
    taskB.DependsOn.Add("A");
    job.SubmitTask(taskB);

    The above code successfully creates the dependency between the tasks, but this dependency is not visible in the HPC Job manager GUI. You can verify the dependency using the command line tools. The following is an example showing the dependency created by the above code:

    C:\Files>task view 96.2 /detailed | findstr /i depend
    DependsOn:               : A

    Please let me know whether this explains what you're seeing.

    Friday, November 20, 2009 12:30 AM
  • Hi,

    This also threw me for a loop until I happened on this thread, it appears the behavior is the same in R2 SP1. I had a simple dependency chain like Mithlan.

    I would request this behavior should change so that for simple dependency chains created via API that the GUI can display, the GUI should display the chain correctly.

    If the GUI can't display the chain because it is to complex, it would display a message to the user indicating that. This would avoid confusion for both the programmer and end customer consuming jobs/tasks created by 3rd party tools.

     

    Friday, December 31, 2010 4:43 AM
  • I have a batch file that will launch the jobs , something like that :

    job add %%i /name:"JobOne"

    job add %%i /name:"JobTwo"

    job add %%i /name:"JobThree"

    job add %%i /name:"JobFoure" /depend:"JobThree" ...

    job add %%i /name:"JobFive" /depend:"JobThree" ...

    job add %%i /name:"JobSix" /depend:"JobThree" ...

    job add %%i /name:"JobSven" /depend:"JobThree" ...


    in this case job 4 /5 /6/7 may not be executed until job 3 finish  right ?
    in fact this is not what happend ,

    even when job 3 finish , job 4 /5 /6/7  are still waiting for job 1 / 2 to finish !

    how can I do to make the dependency I want ?

    Wednesday, February 26, 2014 11:50 AM