How to Programmatically find name of Head Node? RRS feed

  • Question

  • Is there any programmatic way to determine the name of the head node?  I'll take answers in C# or F#, or if you could point me to the correct api I could probably work it out on my own.


    Thanks in advance,


    Wednesday, July 6, 2011 2:46 AM


All replies

  • What do you mean by name of headnode? Also, where is your code running? There could be multiple head node in a network, so to know the name of the headnode, you must specifiy a headnode...
    Wednesday, July 6, 2011 10:04 AM
  • In case your code is running on the compute nodes which belong to the cluster, you can get head node by environment variable %ccp_scheduler%

    Thursday, July 7, 2011 2:27 AM
  • Would this work on a Workstation node as well?


    Thursday, July 7, 2011 2:45 AM
  • I'm assuming a cluster with only a single head node, and the code might be running on a workstation node, a compute node, or even the head node itself.  Thank you for asking good questions which allow me to explain my scenario more clearly.


    Thursday, July 7, 2011 2:47 AM
  • The environment variable %ccp_scheduler% is available on all the nodes in the cluster, including headnode, broker node, compute node and workstation node.
    Monday, July 11, 2011 3:04 AM