You can install CHARM++ as either source code or a precompiled binary package. Downloading source code is more flexible, since you can choose the options you want; but a precompiled binary is slightly easier to get running.
You begin by downloading CHARM++ from our web site: http://charm.cs.uiuc.edu/download.html
Unpack CHARM++ using a tool capable of extracting gzip'd tar files, such as tar (on Unix) or WinZIP (under Windows). CHARM++ will be extracted to a directory called ``charm''. If you choose the source distribution, read the included ``charm/README'' file for detailed instructions on building CHARM++ from source.
The main directories in a CHARM++ installation are:
On most computers, CHARM++ programs are simple binaries, and they pose no more security issues than any other program would. The only exception is the network version net-*, which has the following issues.
The network versions utilize many unix processes communicating with each other via UDP. Only a simple attempt is currently made to filter out unauthorized packets. Therefore, it is theoretically possible to mount a security attack by sending UDP packets to an executing CONVERSE or CHARM++ program's sockets.
The second security issue associated with networked programs is associated with the fact that we, the CHARM++ developers, need evidence that our tools are being used. (Such evidence is useful in convincing funding agencies to continue to support our work.) To this end, we have inserted code in the network charmrun program (described later) to notify us that our software is being used. This notification is a single UDP packet sent by charmrun to charm.cs.uiuc.edu. This data is put to one use only: it is gathered into tables recording the internet domains in which our software is being used, the number of individuals at each internet domain, and the frequency with which it is used.
We recognize that some users may have objections to our notification code. Therefore, we have provided a second copy of the charmrun program with the notification code removed. If you look within the charm bin directory, you will find these programs:
The program charmrun.silent has the notification code removed. To permanently deactivate notification, you may use the version without the notification code:
The only versions of CHARM++ that ever notify us are the network versions.
This section describes how you may delete parts of the distribution to save disk space.
The charm directory contains a collection of example-programs and test-programs. These may be deleted with no other effects:
You may also strip all the binaries in charm/bin.
The charmc program, located in ``charm/bin'', standardizes compiling and linking procedures among various machines and operating systems. ``charmc'' is a general-purpose tool for compiling and linking, not only restricted to CHARM++ programs.
Charmc can perform the following tasks. The (simplified) syntax for each of these modes is shown. Caution: in reality, one almost always has to add some command-line options in addition to the simplified syntax shown below. The options are described next.
Charmc automatically figures out where the charm lib and include directories are -- at no point do you have to configure this information. However, the code that finds the lib and include directories can be confused if you remove charmc from its normal directory, or rearrange the directory tree. Thus, the files in the charm/bin, charm/include, and charm/lib directories must be left where they are relative to each other.
The following command-line options are available to users of charmc:
Output file name. Note: charmc only ever produces one output file at a time. Because of this, you cannot compile multiple source files at once, unless you then link or archive them into a single output-file. If exactly one source-file is specified, then an output file will be selected by default using the obvious rule (eg, if the input file if pgm.c, the output file is pgm.o). If multiple input files are specified, you must manually specify the name of the output file, which must be a library or executable.
Ignored. There for compatibility with cc.
Defines preprocessor variables from the command line at compile time.
Add a directory to the search path for preprocessor include files.
Causes compiled files to include debugging information.
Add a directory to the search path for libraries selected by the -l command.
Specifies libraries to link in.
Causes files to be compiled with maximum optimization.
If this follows -O on the command line, it turns optimization back off. This is just a convenience for simple-minded makefiles.
Enable architecture-specific production-mode features. For instance, use available hardware features more aggressively. It's probably a bad idea to build some objects with this, and others without.
Strip the executable of debugging symbols. Only meaningful when producing an executable.
All commands executed by charmc are echoed to stdout.
Indicates that we're compiling sequential code. On parallel machines with front ends, this option also means that the code is for the front end. This option is only valid with C and C++ files.
Some environments provide more than one C compiler (cc and gcc, for example). Usually, charmc prefers the less buggy of the two. This option causes charmc to switch to the most aggressive compiler, regardless of whether it's buggy or not.
Some environments provide more than one C compiler (cc and gcc, for example). Usually, charmc prefers the less buggy of the two, but not always. This option causes charmc to switch to the most reliable compiler, regardless of whether it produces slow code or not.
When linking with charmc, one must specify the ``language''. This is just a way to help charmc include the right libraries. Pick the ``language'' according to this table:
When linking any CONVERSE program (including any CHARM++ or sdag program), one must include a seed load-balancing library. There are currently three to choose from: rand, test, and neighbor are supported. Default is -balance rand.
When linking with neighbor seed load balancer, one can also specify a virtual tolpogy for constructing neighbors during run-time using +LBTopo topo, where topo can be one of (a) ring, (b) mesh2d, (c) mesh3d and (d) graph. The default is mesh2d.
Selects the desired degree of tracing for CHARM++ programs. See the CHARM++ manual and the PROJECTIONS manuals for more information. Currently supported modes are none, summary, and projections. Default is -tracemode none.
Forces the specified C++ compiler to be used.
Forces the specified C compiler to be used.
Creates a copy of the output file in copy-file.
Options passed to the C pre-processor.
Use this option only when compiling programs that do not include C++ modules. Forces charmc to use the specified linker.
Use this option only when compiling programs that include C++ modules. Forces charmc to use the specified linker.
Options passed to the linker for -language charm++.
Options passed to the linker for -language converse.
Options passes to the linker when linking .o files.
When compiling CHARM++ programs, the charmc linker produces both an executable file and a program called charmrun, which is used to load the executable onto the parallel machine.
To run a CHARM++ program named ``pgm'' on four processors, type:
Programs built using the network version of CHARM++ can be run alone, without charmrun. This restricts you to using the processors on the local machine, but it is convenient and often useful for debugging. For example, a CHARM++ program can be run on one processor in the debugger using:
If the program needs some environment variables to be set for its execution on compute nodes (such as library paths), they can be set in .charmrunrc under home directory. charmrun will run that shell script before running the executable.
A CHARM++ program accepts the following command line options:
The following ++ command line options are available in the network version:
Use the cluster's mpiexec job launcher instead of the built in rsh/ssh method.
This will pass -n $P to indicate how many processes to launch. An executable named something other than mpiexec can be used with the additional argument ++remote-shell runmpi, with `runmpi' replaced by the necessary name.
Use of this option can potentially provide a few benefits:
At present, this option depends on the environment variables for some common MPI implementations. It supports OpenMPI (OMPI_COMM_WORLD_RANK and OMPI_COMM_WORLD_SIZE) and M(VA)PICH (MPIRUN_RANK and MPIRUN_NPROCS or PMI_RANK and PMI_SIZE).
If using one of the ++debug or ++debug-no-pause options, the user must ensure the following:
On multicore platforms, operating systems (by default) are free to move processes and threads among cores to balance load. This however sometimes can degrade the performance of Charm++ applications due to the extra overhead of moving processes and threads, especailly when Charm++ applications has already implemented its own dynamic load balancing.
Charm++ provides the following runtime options to set the processor affinity automatically so that processes or threads no longer move. When cpu affinity is supported by an operating system (tested at Charm++ configuration time), same runtime options can be used for all flavors of Charm++ versions including network and MPI versions, smp and non-smp versions.
A single number identifies a particular core. Two numbers separated by a dash identify an inclusive range (lower bound and upper bound). If they are followed by a colon and another number (a stride), that range will be stepped through in increments of the additional number. Within each stride, a dot followed by a run will indicate how many cores to use from that starting point.
For example, the sequence 0-8:2,16,20-24 includes cores 0, 2, 4, 6, 8, 16, 20, 21, 22, 23, 24. On a 4-way quad-core system, if one wanted to use 3 cores from each socket, one could write this as 0-15:4.3.
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:
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:
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:
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,
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
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:
This document was generated using the LaTeX2HTML translator Version 2008 (1.71)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -white -antialias -local_icons -long_titles 1 -show_section_numbers -top_navigation -address '
April 10, 2012
Charm Homepage' -split 0 manual.tex
The translation was initiated by Osman Sarood on 2012-04-10
April 10, 2012
Charm Homepage