3 Copyright (C) 1989-2012 Regents of the University of Illinois
8 Charm++ is a message-passing parallel language and runtime system.
9 It is implemented as a set of libraries for C++, is efficient,
10 and is portable to a wide variety of parallel machines.
11 Source code is provided, and non-commercial use is free.
14 GETTING THE LATEST CHARM SOURCE
15 ===============================
17 You can use anonymous Git access to obtain the latest Charm++ source
20 git clone git://charm.cs.illinois.edu/charm.git
26 First, you need to decide which version of charm++ to use. The "build"
27 script in charm source directory takes several command line options to
28 compile Charm++. The command line syntax is:
30 build <target> <version> [options ...]
31 [--basedir=dir] [--libdir=dir] [--incdir=dir]
34 For detailed help messages, pass -h or --help to the build script, i.e.
39 <target> specifies the parts of Charm++ to compile. The most often used
40 <target> is "charm++", which will compile the key Charm++ executables and
41 runtime libraries. Other common targets are "AMPI" and "FEM".
42 <versions> defines the CPU, OS and Communication layer of the machines. See
43 "How to choose a <version>" below for details.
47 <options> defines more detailed information of the compilations, including
48 compilers, features to support, etc. See "How to choose <option>"
50 [--libdir=dir] specify additional lib paths for building Charm++.
51 [--incdir=dir] specify additional include paths for building Charm++.
52 [--basedir=dir] a shortcut to specify additional include and lib paths for
53 building Charm++, the include path is dir/include and lib path
57 Running build script, a directory of the name of combination of version and
58 options like "<version>-<option1>-<option2>-..." will be created and
59 the build script will compile Charm++ under this directory.
61 For example, on an ordinary Linux PC:
63 ./build charm++ net-linux-x86_64
65 will build charm++ in the directory: net-linux-x86_64/. The communication
66 defaults to UDP packets and the compiler to gcc.
68 For a more complex example, on a Scyld workstation with the Intel C++
69 compiler, where you want the communication to happen over TCP sockets:
71 ./build charm++ net-linux scyld icc tcp
73 will build charm++ in the directory: net-linux-scyld-tcp-icc/.
75 You can specify multiple options, however you can use at most one compiler
76 option. The sequence of the options are not important given in build script,
77 only one directory name will be generated, following the rules:
78 1. compiler option will be at the end;
79 2. other options are sorted alphabetically.
81 **** How to choose a <version> ****
83 Here is the table for choosing correct version. The default setting of compiler
84 in Charm version is gcc/g++. However, one can use <options> to specify other
85 compilers. See the detailed explanation of the <options> below.
86 (Note: this isn't a complete list. Run ./build for a complete listing)
88 Charm version OS Communication Default Compiler
89 ------------- --------- -------------- --------------------
90 net-linux-x86_64 Opteron Linux UDP GNU compiler
91 net-darwin-x86_64 MacOS X UDP GNU C++ compiler
92 net-linux Linux (32 bit) UDP/Myrinet GNU compiler
93 net-sol Solaris UDP GNU compiler
94 net-win32 Win32 UDP MS Visual C++
95 net-cygwin Win32/cygwin UDP GNU compiler
96 mpi-sp IBM A/IX MPI A/IX xlC Compiler
97 net-linux-ia64 IA64 Linux UDP/Myrinet GNU compiler
98 mpi-linux PC Linux MPI GNU compiler
99 mpi-darwin-x86_64 MacOS X MPI GNU C++ compiler
100 mpi-linux-ia64 IA64 Linux MPI GNU compiler
101 mpi-linux-x86_64 Opteron Linux MPI GNU compiler
104 To choose <version>, your choice is determined by three options:
106 1.) The way a parallel program written in Charm++ will communicate:
108 "net-" Charm++ communicates using the regular TCP/IP stack
109 (UDP packets), which works everywhere but is fairly slow. Use this
110 option for networks of workstations, clusters, or single-machine
111 development and testing.
113 "mpi-" Charm++ communicates using MPI calls. Use this for
114 machines with a good MPI implementation (such as the Origin 2000).
116 "gemini_gni-", "bluegene[lp]-", "pami-bluegeneq-" Charm++
117 communicates using direct calls to the machine's communication primitives.
119 "multicore-" Charm++ communicates using shared memory within a
122 "sim-" and "uth-" are not actively maintained. These are
123 single-processor versions: "uth-" simulates processors as user-level
124 threads; "sim-" switches between processors and counts communications.
127 2.) Your operating system:
130 "win{32,64}" MS Windows with MS Visual C++ compiler (32/64-bit, resp.)
131 "cygwin" MS Windows with Cygnus' Cygwin Unix layer
132 "darwin" Apple Mac OS X
138 3.) Some operating systems have other architecture options, such as:
140 "-x86" For Solaris and Mac OS X, target x86 hardware (instead of
143 "-mips64" MIPS, such as for SiCortex systems
144 "-ia64" Use Itanium(tm) IA-64 instructions (instead of x86).
145 "-x86_64" Use AMD64/EM64T 64-bit x86 instructions (instead of 32 bit).
146 "-cell" Sony/Toshiba/IBM Cell PPE (e.g. Playstation 3,
147 Mercury blades, Roadrunner)
149 Your Charm++ version is made by concatenating the options, e.g.:
151 "net-linux-x86_64" Charm++ for a network of 64-bit Linux workstations,
154 "mpi-crayxt" Charm++ for Cray XT4/5 systems using the system's compiler.
157 **** How to choose <options> ****
159 <version> above defines the most important OS, CPU and Communication of
160 your machine, and most of time, it use the GNU gcc as default compiler.
161 To use different compiler or demand additional special feature support, you
162 need to choose <options> from the following list:
164 * gcc3 - GNU GCC/G++ version 3
165 * acc - HP aC++ compiler
166 * cc - For Sun WorkShop C++ compilers;
167 * cc64 - For 64 bits Sun WorkShop C++ or IBM xlC compilers;
168 * cxx - DIGITAL C++ compiler;
169 * kcc - KAI C++ compiler;
170 * pgcc - Portland Group's C++ compiler;
171 * icc - Intel C/C++ compiler for Linux IA32
172 * ecc - Intel C/C++ compiler for Linux IA64
173 * mpcc - SUN Solaris C++ compiler for MPI.
175 * scyld - support Beowulf Scyld based on bproc;
176 * clustermatic - for Clustermatic Beowulf cluster based on bproc;
177 * gm - support MyriCom's Myrinet GM library;
178 * vmi - support NCSA's VMI library;
180 * tcp - for net- version, default communication is via UDP. Using option
181 tcp will switch to TCP. TCP version of CHarm++ is usually slower
182 than UDP, but it is more reliable.
183 * smp - Enable direct SMP support. An "smp" version communicates using
184 shared memory within a machine; but normal message passing across
185 machines. Because of locking, "smp" may slightly impact non-SMP
186 performance. Try your application to decide if enabling smp mode
187 improves performance.
189 * bigsim - compile Charm++ as running on the BigSim emulator.
190 * help - show supported options for a version. For example, for net-linux,
192 > ./build charm++ net-linux help
194 supported options: gcc3 gm icc kcc pgcc scyld smp bluegene tcp
200 If you have downloaded a binary version of Charm++, you can skip
201 this step-- Charm++ should already be compiled. For win32/win64 systems,
202 see README.win; for Cygwin version, see README.cygwin; for net- version,
205 Once you have decided on a version, unpack Charm++, cd into charm,
208 > ./build <target> <version> <opts>
211 "charm++" The basic Charm++ language.
212 "AMPI" An implementation of MPI on top of Charm++
213 "FEM" A Finite-Element framework on top of Charm++
214 "Tau" TAU's performance profiling/tracing
216 <version> is described above
218 <opts> are build-time options (such as the compiler or "smp"),
219 or command line options passed to the charmc compile script.
220 Common compile time options such as -g, -O, -Ipath, -Lpath, -llib are
223 For example, on a Linux machine, you would run
224 > ./build charm++ net-linux-x86_64 -O
226 This will construct a net-linux-x86_64 directory, link over all
227 the Charm++ source code into net-linux-x86_64/tmp, build the entire
228 Charm++ runtime system in net-linux-x86_64/tmp, and link example programs
229 into net-linux-x86_64/examples.
231 Several #define's control the compilation of Charm++. Some of these
232 #define's can be found in src/<version>/conv-mach.h. #define's can
233 also be specified on the command line, using the -D option. For
235 > ./build charm++ net-linux -O -DCMK_OPTIMIZE=1
237 Production optimizations: Pass the configure option --with-production
238 to ./build to turn on optimizations in Charm++/Converse. This disables
239 most of the run-time checking performed by Converse and Charm++
240 runtime. This option should be used only after the program has been
241 debugged. Also, this option disables Converse/Charm++ tracing
242 mechanisms such as projections and summary.
244 When Charm++ is built successfully, the diretory structure under the
245 target directory will look like:
249 --- bin/ # all executables
251 --- doc/ # documentations
253 --- include/ # header files
257 --- lib_so/ # dynamic libraries
259 --- examples/ # all example programs
261 --- tests/ # all test programs
263 --- tmp/ # Charm++ build directory
268 To make a sample program, cd into pgms/charm++/queens/.
269 This program solves the N-queens problem-- find how many ways there
270 are to arrange N queens on an NxN chess board such that none may
273 To build the program, type make. You should get an
274 executable named "pgm".
280 Following the previous example, to run the program on two processors, type
282 > ./charmrun ./pgm 12 6 +p2
284 This should run for a few seconds, and print out:
285 There are 14200 Solutions to 12 queens. Finish time=4.030000
287 Charmrun is used to provide a uniform interface to run charm programs.
288 On some platforms, charmrun is just a shell script which calls the
289 platform-specific start program, such as mpirun on mpi versions.
291 For net- version, charmrun is an executable which invokes rsh or ssh to start
292 node programs on remote machines. You should set up a ~/.nodelist that
293 enumerates all the machines you want to run jobs on, otherwise it will
294 create a default ~/.nodelist for you that contains only localhost. Here is a
295 typical .nodelist file:
297 group main ++shell /bin/ssh
300 The default remote shell program is rsh, but you can define different remote
301 shell you like to start remote processes in the ++shell option. You should
302 also make sure that you can rsh or ssh to these machines without password
303 authentication. Just type following command to verify:
304 > rsh <machinename> date
305 If this gives you current date immediately, your running environment with this
306 node has been setup correctly.
308 Now, for test running purpose, net- version charmrun comes with an easy-to-use
309 "++local" options. No remote shell invocation is needed in this case. It starts
310 node programs right on your local machine. This could be useful if you just
311 want to run program on only one machine, for example, your laptop. This
312 can save you all the hassle of setting up rsh/ssh or charmd daemons.
313 To use this option, just type:
315 > ./charmrun ++local ./pgm 12 100 +p2
317 However, for best performance, you should launch one node program per processor.
319 For more detailed information, please check the "INSTALLATION MANUAL" and "RUN MANUAL"
323 Build Charm++ in Dynamic libraries
324 =============================
326 In order to compile Charm++ into dynamic libraries, one need to specify
327 "-build-shared" option as one of the Charm compiler script "charmc"
328 at link time. For example, to compile Charm++ under net-linux/tmp, run
330 make charm++ OPTS='-O -build-shared'
332 Charm++'s dynamic libraries are compiled into lib_so/ directory.
333 Typically, they are with ".so" suffix.
335 Note, "-build-shared" option is automatically turned on when building
336 Charm++ using "build" script. So you don't need to pass "-build-shared"
339 One can compile a Charm++ applicaiton linking against Charm++ dynamic
340 libraries, run charmc with "-charm-shared" as one of the link options.
343 charmc -o pgm pgm.o -charm-shared
345 You can then run the program as usual.
346 Note, linking against Charm++ dynamic libraries produces much smaller size
347 binaries and takes much less linking time.
352 The Charm++ web page, with documentation, more programs,
353 and the latest version of Charm++, is at
354 http://charm.cs.illinois.edu/
356 The Charm++ mailing list, for questions, comments, suggestions,
357 improvements, or bug reports is
358 charm@cs.illinois.edu
364 Charm++ was created and is maintained by the Parallel Programming Lab,
365 in the Computer Science department at the University of Illinois at
366 Urbana-Champaign. Our managing professor is Dr. L.V. Kale; students
367 have included (in rough time order) Wennie Shu, Kevin Nomura, Wayne
368 Fenton, Balkrishna Ramkumar, Vikram Saletore, Amitabh B. Sinha, Manish
369 Gupta, Attila Gursoy, Balkrishna Ramkumar, Amitabh B. Sinha, Nimish
370 Shah, Sanjeev Krishnan, Jayant DeSouza, Parthasarathy Ramachandran,
371 Jeff Wright, Michael Lang, Jackie Wang, Fang Hu, Michael Denardo,
372 Joshua Yelon, Narain Jagathesan, Zehra Sura, Krishnan Varadarajan,
373 Sameer Paranjpye, Milind Bhandarkar, Robert Brunner and Jayant Desouza.
374 Current developers include Terry Wilmarth, Gengbin Zheng, Orion Lawlor,
375 Karthik Mahesh, and Neelam Saboo.