Editing Hostnames of Machines

A command line option permits you to edit the hostnames of the machines that are prescribed to the server. This facility is primarily for the use with batch systems.

Some clusters are set up so that each cluster node (machine) has two network cards. The first network card can be a default ethernet card while the second one can be a higher-performance network card. In these circumstances, the hostnames that are associated with the second card are not the same as those allocated to the first card. Typically the hostnames are appended by a string, but it depends on how the machine is configured. The batch systems do not see second cards, so when the batch system allocates nodes on which jobs can run, they refer to the default cards.

However, when you run Simcenter STAR-CCM+ you may want to take advantage of the higher-performance card. To do this, you would need to translate the hostname that is provided by the batch system to the hostname you actually want to use.

Suppose that you have a cluster of machines with names:

green-node1
green-node2
green-node3
...
green-nodeN

The batch system can allocate four nodes:

green-nodeN1
green-nodeN2
green-nodeN3
green-nodeN4

However, the application wants to use the higher performance network cards which could be named:

green-nodeN1-eth1
green-nodeN2-eth1
green-nodeN3-eth1
green-nodeN4-eth1

To use the higher performance network cards, enter the following in the command line:

-hostregexpr /<pattern>/<substitution>/

where the “regular expression” pattern is replaced by the regular expression substitution. Regular expressions are a general way of pattern matching strings.

Also, /<pattern>/<substitution>/ is passed directly into the command:

echo $machinename | sed -s ’s/<pattern>/<substitution>/g’

Examples of how you could use this technique are:

  • Appending a string to the end of every hostname:
    -hostregexpr /\$/<string>/

    So to append -eth1 you would enter:

    -hostregexpr /\$/-eth1/

    The dollar sign represents the end of line (or end of hostname) and replaces it with the string. At the same time, it is necessary to escape the dollar sign to prevent the command-line shell from interpreting it. Hence, the syntax is /\$/-eth1/ instead of /$/-eth1/.

  • Adding a string to the start of every hostname:
    -hostregexpr /^/eth1-/

    This option gives entries such as eth1-green-nodeN1. (The ^ is the start of a line or hostname in a regular expression. There is no need to escape this character as it has no special meaning to the shell.)

  • Substituting a common string with another:
    -hostregexpr /green/green-eth1/

    This option results in green-eth1-nodeN1.