Subsections

4.2 Nodelist file

For network of workstations, the list of machines to run the program can be specified in a file. Without a nodelist file, CHARM++ runs the program only on the local machine.

The format of this file allows you to define groups of machines, giving each group a name. Each line of the nodes file is a command. The most important command is:

host <hostname> <qualifiers>

which specifies a host. The other commands are qualifiers: they modify the properties of all hosts that follow them. The qualifiers are:


group <groupname>   - subsequent hosts are members of specified group

login <login> - subsequent hosts use the specified login
shell <shell> - subsequent hosts use the specified remote shell
setup <cmd> - subsequent hosts should execute cmd
pathfix <dir1> <dir2> - subsequent hosts should replace dir1 with dir2 in the program path
cpus <n> - subsequent hosts should use N light-weight processes
speed <s> - subsequent hosts have relative speed rating
ext <extn> - subsequent hosts should append extn to the pgm name

Note: By default, charmrun uses a remote shell ``rsh'' to spawn node processes on the remote hosts. The shell qualifier can be used to override it with say, ``ssh''. One can set the CONV_RSH environment variable or use charmrun option ++remote-shell to override the default remote shell for all hosts with unspecified shell qualifier.

All qualifiers accept ``*'' as an argument, this resets the modifier to its default value. Note that currently, the passwd, cpus, and speed factors are ignored. Inline qualifiers are also allowed:

host beauty ++cpus 2 ++shell ssh

Except for ``group'', every other qualifier can be inlined, with the restriction that if the ``setup'' qualifier is inlined, it should be the last qualifier on the ``host'' or ``group'' statement line.

Here is a simple nodes file:

        group kale-sun ++cpus 1
          host charm.cs.uiuc.edu ++shell ssh
          host dp.cs.uiuc.edu
          host grace.cs.uiuc.edu
          host dagger.cs.uiuc.edu
        group kale-sol
          host beauty.cs.uiuc.edu ++cpus 2
        group main
          host localhost

This defines three groups of machines: group kale-sun, group kale-sol, and group main. The ++nodegroup option is used to specify which group of machines to use. Note that there is wraparound: if you specify more nodes than there are hosts in the group, it will reuse hosts. Thus,

        charmrun pgm ++nodegroup kale-sun +p6

uses hosts (charm, dp, grace, dagger, charm, dp) respectively as nodes (0, 1, 2, 3, 4, 5).

If you don't specify a ++nodegroup, the default is ++nodegroup main. Thus, if one specifies

        charmrun pgm +p4

it will use ``localhost'' four times. ``localhost'' is a Unix trick; it always find a name for whatever machine you're on.

The user is required to set up remote login permissions on all nodes using the ``.rhosts'' file in the home directory if ``rsh'' is used for remote login into the hosts. If ``ssh'' is used, the user will have to setup password-less login to remote hosts using RSA authentication based on a key-pair and adding public keys to ``.ssh/authorized_keys'' file. See ``ssh'' documentation for more information.

In a network environment, charmrun must be able to locate the directory of the executable. If all workstations share a common file name space this is trivial. If they don't, charmrun will attempt to find the executable in a directory with the same path from the $HOME directory. Pathname resolution is performed as follows:

  1. The system computes the absolute path of pgm.
  2. If the absolute path starts with the equivalent of $HOME or the current working directory, the beginning part of the path is replaced with the environment variable $HOME or the current working directory. However, if ++pathfix dir1 dir2 is specified in the nodes file (see above), the part of the path matching dir1 is replaced with dir2.
  3. The system tries to locate this program (with modified pathname and appended extension if specified) on all nodes.


4.2.1 IO buffering options

There may be circumstances where a CHARM++ application may want to take or relinquish control of stdout buffer flushing. Most systems default to giving the CHARM++ runtime control over stdout but a few default to giving the application that control. The user can override these system defaults with the following runtime options:

+io_flush_user
User (application) controls stdout flushing
+io_flush_system
The CHARM++ runtime controls flushing

April 10, 2012
Charm Homepage