How do I get cluster resources usage ? RRS feed

  • Question

  • Hi all,

    I want to control jobs submission according clusters resources availability / usage ,
    How can I get this information (memory , cores , disk  -  usage or availability) from cluster via .net API ?

    Best Regards

    Monday, January 25, 2010 3:59 PM


All replies

  • HI Shay,

    The following HPC 2008 server APIs can help you:

    1) Use IScheduler class to get the ISchedulerNode object or list.

    ISchedulerCollection IScheduler::GetNodeList(IFilterCollection filter, ISortCollection sort)
    ISchedulerNode IScheduler::OpenNodeByName(string nodename)

    2) Use ISchedulerNode's properties to get CPUSpeed, MemorySize, Number of cores, sockets, etc
    see reference

    Monday, January 25, 2010 6:06 PM
  • thanks liwei,

    I have already used that method to get the cluster initial resources state , 
    But  if I  submit 10 jobs and then get resources state - there is no change from initial resources state ,
    How can I get realtime resources updates   ?  How can I get nodes local disk  space information ?

    Best Regards
    Monday, January 25, 2010 10:16 PM
  • Hi Shay,

    for real-time resource info, the perf counters can help:

    1) IScheduler::GetCounters(). it returns ISchedulerCounters. From ISchedulerCounters, you may get Number of busy cores, number of idle cores and number of total cores. see web

    2) for memory/disk, use standard windows perf countesr. .Net API has standard APIs to access these perf counters. e.g. Memory has perf counter "Available MBytes". disk space example: LogicalDisk\Free Megabytes.

    One way to see these perf counters on a single node is to run "perfmon".

    hope this helps

    Tuesday, January 26, 2010 4:03 AM
  • Hi Shay,

    more details on the perf counters:

    1) HPC 2008 server has detailed perf counters on task/job/node level. e.g. you may get how many cores are busy using ISchedulerNodeCounters

    2) a sample code to get memory perf counter is:
    PerformanceCounter totalMemUsage = new System.Diagnostics.PerformanceCounter("Memory", "% Committed Bytes In Use");


    • Marked as answer by Shay_Segev Thursday, January 28, 2010 9:18 AM
    Tuesday, January 26, 2010 5:28 PM
  • Thanks Liwei
    Thursday, January 28, 2010 9:18 AM