Answered How to Programmatically find name of Head Node?

  • Wednesday, July 06, 2011 2:46 AM
     
     

    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,

    Bob

All Replies

  • Wednesday, July 06, 2011 10:04 AM
     
     
    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...
  • Thursday, July 07, 2011 2:27 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 07, 2011 2:45 AM
     
     

    Would this work on a Workstation node as well?

    Bob

  • Thursday, July 07, 2011 2:47 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.

    Bob

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