Fix memory leaks in trace projections and summary
[charm.git] / README
blob40be7381444a5c71614ade71451ee6d124f734e1
1                            Charm++
3        Copyright (C) 1989-2016 Regents of the University of Illinois
5 INTRODUCTION
6 ============
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
18 code, as follows:
20     git clone http://charm.cs.illinois.edu/gerrit/charm
23 PICKING A VERSION
24 =================
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]
32                          [charmc-options ...]
34 For detailed help messages, pass -h or --help to the build script, i.e.
35 ./build --help
37 REQUIRED:
38 ---------
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 "LIBS".
42 <versions> defines the CPU, OS and Communication layer of the machines.  See
43   "How to choose a <version>" below for details.
45 OPTIONAL:
46 ---------
47 <options> defines more detailed information of the compilations, including
48   compilers, features to support, etc.  See "How to choose <option>"
49   below.
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
54                is dir/lib.
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++ netlrts-linux-x86_64
65 will build charm++ in the directory: netlrts-linux-x86_64/. The communication
66 defaults to UDP packets and the compiler to gcc.
68 For a more complex example, consider building shared-memory build with the
69 Intel C++ compiler, where you want the communication to happen over TCP sockets:
71    ./build charm++ netlrts-linux-x86_64 smp icc tcp
73 will build charm++ in the directory: netlrts-linux-x86_64-smp-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 netlrts-linux-x86_64       Linux            UDP            GNU compiler
91 netlrts-darwin-x86_64      MacOS X          UDP            Clang C++ compiler
92 mpi-linux-x86_64           Linux            MPI            GNU compiler
93 mpi-darwin-x86_64          MacOS X          MPI            Clang C++ compiler
94 pamilrts-bluegeneq         CNK              PAMI           XLC
95 gni-crayxe                 Linux            GNI            GNU compiler
96 verbs-linux-x86_64         Linux            IB Verbs       GNU compiler
97 net-win64                  Windows          UDP            MS Visual C++
98 net-cygwin                 Cygwin           UDP            GNU compiler
101 To choose <version>, your choice is determined by two options:
103 1.)  The way a parallel program written in Charm++ will communicate:
105         "netlrts-" Charm++ communicates using the regular TCP/IP stack
106 (UDP packets), which works everywhere but is fairly slow.  Use this
107 option for networks of workstations, clusters, or single-machine
108 development and testing.
110         "gni-", "bluegeneq-", "pamilrts-", "verbs-" Charm++
111 communicates using direct calls to the machine's communication primitives.
113         "mpi-" Charm++ communicates using MPI calls.  Use this for
114 machines with a good MPI implementation.
116         "multicore-" Charm++ communicates using shared memory within a
117         single node
119         "sim-" and "uth-" are not actively maintained.  These are
120 single-processor versions: "uth-" simulates processors as user-level
121 threads; "sim-" switches between processors and counts communications.
124 2.)  Your operating system:
126         "linux-x86_64"       Linux with AMD64 64-bit x86 instructions
127         "win64"              MS Windows with MS Visual C++ compiler
128         "cygwin"             MS Windows with Cygnus' Cygwin Unix layer
129         "darwin-x86_64"      Apple Mac OS X
130         "bluegeneq"          IBM's Blue Gene/Q
131         "cray{xe/xc}"        Cray's X-Series Supercomputer
132         "linux-ppc"          POWER/PowerPC
135 Your Charm++ version is made by concatenating the options, e.g.:
137 "net-linux-x86_64"   Charm++ for a network of 64-bit Linux workstations,
138                      compiled using g++.
140 "gni-crayxc"         Charm++ for Cray XC30 systems using the system's compiler.
143 **** How to choose <options> ****
145 <version> above defines the most important OS, CPU and Communication of
146 your machine, and most of time, it use the GNU gcc as default compiler.
147 To use different compiler or demand additional special feature support, you
148 need to choose <options> from the following list:
150 * icc - Intel C/C++ compiler.
151 * ifort - Intel Fortran compiler
152 * xlc - IBM XLC compiler.
153 * mpicxx - Use MPI-wrappers for MPI builds.
154 * acc  - HP aC++ compiler
155 * cc  - For Sun WorkShop C++ compilers;
156 * cc64 - For 64 bits Sun WorkShop C++ or IBM xlC compilers;
157 * cxx - DIGITAL C++ compiler;
158 * pgcc - Portland Group's C++ compiler;
159 * mpcc - SUN Solaris C++ compiler for MPI.
161 * smp - Enable direct SMP support.  An "smp" version communicates using
162         shared memory within a machine; but normal message passing across
163         machines. Because of locking, "smp" may slightly impact non-SMP
164         performance. Try your application to decide if enabling smp mode
165         improves performance.
167 * scyld - support Beowulf Scyld based on bproc;
168 * clustermatic - for Clustermatic Beowulf cluster based on bproc;
169 * gm - support MyriCom's Myrinet GM library;
170 * vmi - support NCSA's VMI library;
172 * tcp - for netlrts- version, default communication is via UDP. Using option
173         tcp will switch to TCP. TCP version of Charm++ is usually slower
174         than UDP, but it is more reliable.
175 * async - For Blue Gene/Q, this option enables use of hardware communication 
176           threads. For applications with significant communication on large
177           scale, this option typically improves performance.
178 * regularpages - on Cray systems, Charm++'s default is to use hugepages. This
179                  option disables hugepages, and uses regular malloc for messages.
180 * persistent - on Cray systems, this option enables use of persitent mode for
181                communication.
183 * bigsim - compile Charm++ as running on the BigSim emulator.
184 * help - show supported options for a version. For example, for net-linux,
185          running:
186          > ./build charm++ net-linux help
187          will give:
188          supported options: gm icc pgcc scyld smp bluegene tcp
191 BUILDING THE SOURCE
192 ===================
194 If you have downloaded a binary version of Charm++, you can skip
195 this step-- Charm++ should already be compiled.  For win32/win64 systems,
196 see README.win; for Cygwin version, see README.cygwin; for net- version,
197 see README.net.
199 Once you have decided on a version, unpack Charm++, cd into charm,
200 and run
202      > ./build <target> <version> <opts>
204 <target> is one of
205         "charm++"  The basic Charm++ language.
206         "AMPI"     An implementation of MPI on top of Charm++
207         "FEM"      A Finite-Element framework on top of Charm++
208         "Tau"      TAU's performance profiling/tracing
210 <version> is described above
212 <opts> are build-time options (such as the compiler or "smp"),
213 or command line options passed to the charmc compile script.
214 Common compile time options such as -g, -O, -Ipath, -Lpath, -llib are
215 accepted.
217 For example, on a Linux machine, you would run
218      > ./build charm++ netlrts-linux-x86_64 -O
220 This will construct a netlrts-linux-x86_64 directory, link over all
221 the Charm++ source code into netlrts-linux-x86_64/tmp, build the entire
222 Charm++ runtime system in netlrts-linux-x86_64/tmp, and link example
223 programs into netlrts-linux-x86_64/examples.
225 Charm++ can be compiled with several optional features enabled or
226 disabled. These include runtime error checking, tracing, interactive
227 debugging, deterministic record-replay, and more. They can be
228 controlled by passing flags of the form --enable-featurename or
229 --disable-featurename to the build command:
230     > ./build charm++ netlrts-linux-x86_64 --disable-tracing
232 The list of optional features available is shown in the output of
233     > ./build --help
235 Production optimizations: Pass the configure option --with-production
236 to ./build to turn on optimizations in Charm++/Converse. This disables
237 most of the run-time checking performed by Converse and Charm++
238 runtime. This option should be used only after the program has been
239 debugged. Also, this option disables Converse/Charm++ tracing
240 mechanisms such as projections and summary.
242 Performance analysis: Pass the configuration option "--with-production 
243 --enable-tracing" to enable tracing and generation of logs for analysis with 
244 Projections. This is the recommended way to analyze performance of applications.
246 When Charm++ is built successfully, the directory structure under the
247 target directory will look like:
249 net-linux-x86_64/
250    |
251    ---  bin/                    # all executables
252    |
253    ---  doc/                    # documentations
254    |
255    ---  include/                # header files
256    |
257    ---  lib/                    # libraries
258    |
259    ---  lib_so/                 # dynamic libraries
260    |
261    ---  examples/               # all example programs
262    |
263    ---  tests/                  # all test programs
264    |
265    ---  tmp/                    # Charm++ build directory
267 BUILDING A PROGRAM
268 ==================
270 To make a sample program, cd into examples/charm++/queens/.
271 This program solves the N-queens problem-- find how many ways there
272 are to arrange N queens on an NxN chess board such that none may
273 attack another.
275 To build the program, type make.  You should get an
276 executable named "pgm".
279 RUNNING A PROGRAM
280 ==================
282 Following the previous example, to run the program on two processors, type
284      > ./charmrun ./pgm 12 6 +p2
286 This should run for a few seconds, and print out:
287 There are 14200 Solutions to 12 queens. Finish time=4.030000
289 Charmrun is used to provide a uniform interface to run charm programs.
290 On some platforms, charmrun is just a shell script which calls the
291 platform-specific start program, such as mpirun on mpi versions.
293 For netlrts- version, charmrun is an executable which invokes ssh to start
294 node programs on remote machines. You should set up a ~/.nodelist that
295 enumerates all the machines you want to run jobs on, otherwise it will
296 create a default ~/.nodelist for you that contains only localhost. Here is a
297 typical .nodelist file:
299 group main ++shell /bin/ssh
300 host <machinename>
302 The default remote shell program is ssh, but you can define a different remote
303 shell to start remote processes using the ++shell option. You should
304 also make sure that ssh or your alternative can connect to these machines without
305 password authentication. Just type following command to verify:
306      > ssh <machinename> date
307 If this gives you current date immediately, your running environment with this
308 node has been setup correctly.
310 Now, for test running purpose, net- version charmrun comes with an easy-to-use
311 "++local" options. No remote shell invocation is needed in this case. It starts
312 node programs right on your local machine. This could be useful if you just
313 want to run program on only one machine, for example, your laptop. This
314 can save you all the hassle of setting up ssh or charmd daemons.
315 To use this option, just type:
317      > ./charmrun ++local ./pgm 12 100 +p2
319 However, for best performance, you should launch one node program per processor.
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"
337 option to "build".
339 One can compile a Charm++ application linking against Charm++ dynamic
340 libraries, run charmc with "-charm-shared" as one of the link options.
341 For example:
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.
349 FOR MORE INFORMATION
350 ====================
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
361 AUTHORS
362 =======
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 and staff 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, Nimish Shah, Sanjeev Krishnan, Jayant DeSouza,
370 Parthasarathy Ramachandran, Jeff Wright, Michael Lang, Jackie Wang,
371 Fang Hu, Michael Denardo, Joshua Yelon, Narain Jagathesan, Zehra Sura,
372 Krishnan Varadarajan, Sameer Paranjpye, Milind Bhandarkar, Robert Brunner,
373 Terry Wilmarth, Gengbin Zheng, Orion Lawlor, Celso Mendes, Karthik Mahesh,
374 Neelam Saboo, Greg Koenig, Sameer Kumar, Sayantan Chakravorty, Chao Huang,
375 Chee Lee, Fillipo Gioachin, Isaac Dooley, Abhinav Bhatele, Aaron Becker,
376 Ryan Mokos, Ramprasad Venkataraman, Gagan Gupta, Pritish Jetley, Lukasz
377 Wesolowski, Esteban Meneses, Chao Mei, David Kunzman, Osman Sarood,
378 Abhishek Gupta, Yanhua Sun, Ehsan Totoni, Akhil Langer, Cyril Bordage,
379 Harshit Dokania, Prateek Jindal, Jonathan Lifflander, Xiang Ni,
380 Harshitha Menon, and Nikhil Jain. Current developers include Eric
381 Bohm, Phil Miller, Bilge Acun, Ronak Buch, Michael Robson, Eric
382 Mikida, Sam White, Juan Galvez, Seonmyeong Bak, Nitin Bhat, Vipul
383 Harsh, and Kavitha Chandrasekar.