none
How to get the different job priorities for a specific job template C# API RRS feed

  • Question

  • 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

    Thursday, November 3, 2011 12:48 PM

Answers

  • 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

    • Marked as answer by Ben.Alterzon Wednesday, November 9, 2011 12:57 PM
    Thursday, November 3, 2011 10:05 PM