How to Create Dependent Task in HPC
-
Monday, July 28, 2008 11:50 AMHow to Create Dependent Tasks in HPC
ISchedulerTask
task1 = job.CreateTask();task.CommandLine = cmdparams1;
job.AddTask(task1);
ISchedulerTask task2 = job.CreateTask();
task.CommandLine = cmdparams2;
job.AddTask(task2);
Here task2 is Depedends on task1. How to Create this Dependency?
Thanks in Advance
Murthy PVASn
All Replies
-
Monday, July 28, 2008 9:00 PMModerator
You'll need to specify the list of tasks that task2 depends on (by name). To extend your example:
ISchedulerTask task1 = job.CreateTask(); task1.CommandLine = cmdparams1; task1.Name = "First Task"; job.AddTask(task1); ISchedulerTask task2 = job.CreateTask(); task2.CommandLine = cmdparams2; IStringCollection earlierTasks = new StringCollection(); // Create a string collection with a list of earlier tasks earlierTasks.Add("First Task"); // Add the name of the tasks to depend on task2.DependsOn = earlierTasks; // Set the DependsOn field for task2 job.AddTask(task2);
-Josh- Proposed As Answer by Josh BarnardModerator Monday, July 28, 2008 9:00 PM
- Marked As Answer by PVASNMurthy Tuesday, July 29, 2008 4:38 AM