How to get the different job priorities for a specific job template C# API
-
2011年11月3日 12:48
In my application I need to get the different job priorities for a specific job template that the user chooses.(the priorities are not the same for all job template)
how can i get it using C#?
Thanks ,
Ben
全部回复
-
2011年11月3日 22:05
JobTemplate is a filterable property. You can use the example posted to your previous question here (http://social.microsoft.com/Forums/is/windowshpcdevs/thread/80a7d082-c94e-4b60-aaf8-4ef1b7acec1e) to get the list of jobs for a given JobTemplate (instead of all running jobs). Simply change the filter from:
FilterProperty filStateRunning = new FilterProperty(FilterOperator.Equal, JobPropertyIds.State, JobState.Running);
filter.Add(filStateRunning);to
FilterProperty filDesiredJobTemplate = new FilterProperty(FilterOperator.Equal, JobPropertyIds.JobTemplate, "JobTemplateNameHere");
filter.Add(filDesiredJobTemplate);You can then recraft the loops and collection to look at the job priority instead of the nodegroup.
For busy clusters, there is a balance between too few filter clauses and too many: Too few and the resulting collection may require moving a lot of data across the wire (and burden the Scheduler process with large data sets) and too many can result in excessive computation costs. The actual limits depend entirely on the resources upon which your cluster is built: HN cpu, drive speeds, ram, the same for wherever SQL is running and average and peak HN loads.
d
- 已标记为答案 Ben.Alterzon 2011年11月9日 12:57