Feature #886: Toggle comm thread tracing with trace{Begin,End}Comm()
[charm.git] / README
blob4149fe90132a2e741d66f403d87173a25c13238d
1                            Charm++
3        Copyright (C) 1989-2015 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-win32                  Win32            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-", "bluegene[lp]-", "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         "win{32,64}"         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 * gcc3  - GNU GCC/G++ version 3
155 * acc  - HP aC++ compiler
156 * cc  - For Sun WorkShop C++ compilers;
157 * cc64 - For 64 bits Sun WorkShop C++ or IBM xlC compilers;
158 * cxx - DIGITAL C++ compiler;
159 * kcc - KAI C++ compiler;
160 * pgcc - Portland Group's C++ compiler;
161 * mpcc - SUN Solaris C++ compiler for MPI.
163 * smp - Enable direct SMP support.  An "smp" version communicates using
164         shared memory within a machine; but normal message passing across
165         machines. Because of locking, "smp" may slightly impact non-SMP
166         performance. Try your application to decide if enabling smp mode
167         improves performance.
169 * scyld - support Beowulf Scyld based on bproc;
170 * clustermatic - for Clustermatic Beowulf cluster based on bproc;
171 * gm - support MyriCom's Myrinet GM library;
172 * vmi - support NCSA's VMI library;
174 * tcp - for netlrts- version, default communication is via UDP. Using option
175         tcp will switch to TCP. TCP version of Charm++ is usually slower
176         than UDP, but it is more reliable.
177 * async - For Blue Gene/Q, this option enables use of hardware communication 
178           threads. For applications with significant communication on large
179           scale, this option typically improves performance.
180 * regularpages - on Cray systems, Charm++'s default is to use hugepages. This
181                  option disables hugepages, and uses regular malloc for messages.
182 * persistent - on Cray systems, this option enables use of persitent mode for
183                communication.
185 * bigsim - compile Charm++ as running on the BigSim emulator.
186 * help - show supported options for a version. For example, for net-linux,
187          running:
188          > ./build charm++ net-linux help
189          will give:
190          supported options: gcc3 gm icc kcc pgcc scyld smp bluegene tcp
193 BUILDING THE SOURCE
194 ===================
196 If you have downloaded a binary version of Charm++, you can skip
197 this step-- Charm++ should already be compiled.  For win32/win64 systems,
198 see README.win; for Cygwin version, see README.cygwin; for net- version,
199 see README.net.
201 Once you have decided on a version, unpack Charm++, cd into charm,
202 and run
204      > ./build <target> <version> <opts>
206 <target> is one of
207         "charm++"  The basic Charm++ language.
208         "AMPI"     An implementation of MPI on top of Charm++
209         "FEM"      A Finite-Element framework on top of Charm++
210         "Tau"      TAU's performance profiling/tracing
212 <version> is described above
214 <opts> are build-time options (such as the compiler or "smp"),
215 or command line options passed to the charmc compile script.
216 Common compile time options such as -g, -O, -Ipath, -Lpath, -llib are
217 accepted.
219 For example, on a Linux machine, you would run
220      > ./build charm++ netlrts-linux-x86_64 -O
222 This will construct a netlrts-linux-x86_64 directory, link over all
223 the Charm++ source code into netlrts-linux-x86_64/tmp, build the entire
224 Charm++ runtime system in netlrts-linux-x86_64/tmp, and link example
225 programs into netlrts-linux-x86_64/examples.
227 Charm++ can be compiled with several optional features enabled or
228 disabled. These include runtime error checking, tracing, interactive
229 debugging, deterministic record-replay, and more. They can be
230 controlled by passing flags of the form --enable-featurename or
231 --disable-featurename to the build command:
232     > ./build charm++ netlrts-linux-x86_64 --disable-tracing
234 The list of optional features available is shown in the output of
235     > ./build --help
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 Performance analysis: Pass the configuration option "--with-production 
245 --enable-tracing" to enable tracing and generation of logs for analysis with 
246 Projections. This is the recommended way to analyze performance of applications.
248 When Charm++ is built successfully, the directory structure under the
249 target directory will look like:
251 net-linux-x86_64/
252    |
253    ---  bin/                    # all executables
254    |
255    ---  doc/                    # documentations
256    |
257    ---  include/                # header files
258    |
259    ---  lib/                    # libraries
260    |
261    ---  lib_so/                 # dynamic libraries
262    |
263    ---  examples/               # all example programs
264    |
265    ---  tests/                  # all test programs
266    |
267    ---  tmp/                    # Charm++ build directory
269 BUILDING A PROGRAM
270 ==================
272 To make a sample program, cd into examples/charm++/queens/.
273 This program solves the N-queens problem-- find how many ways there
274 are to arrange N queens on an NxN chess board such that none may
275 attack another.
277 To build the program, type make.  You should get an
278 executable named "pgm".
281 RUNNING A PROGRAM
282 ==================
284 Following the previous example, to run the program on two processors, type
286      > ./charmrun ./pgm 12 6 +p2
288 This should run for a few seconds, and print out:
289 There are 14200 Solutions to 12 queens. Finish time=4.030000
291 Charmrun is used to provide a uniform interface to run charm programs.
292 On some platforms, charmrun is just a shell script which calls the
293 platform-specific start program, such as mpirun on mpi versions.
295 For netlrts- version, charmrun is an executable which invokes ssh to start
296 node programs on remote machines. You should set up a ~/.nodelist that
297 enumerates all the machines you want to run jobs on, otherwise it will
298 create a default ~/.nodelist for you that contains only localhost. Here is a
299 typical .nodelist file:
301 group main ++shell /bin/ssh
302 host <machinename>
304 The default remote shell program is ssh, but you can define a different remote
305 shell to start remote processes using the ++shell option. You should
306 also make sure that ssh or your alternative can connect to these machines without
307 password authentication. Just type following command to verify:
308      > ssh <machinename> date
309 If this gives you current date immediately, your running environment with this
310 node has been setup correctly.
312 Now, for test running purpose, net- version charmrun comes with an easy-to-use
313 "++local" options. No remote shell invocation is needed in this case. It starts
314 node programs right on your local machine. This could be useful if you just
315 want to run program on only one machine, for example, your laptop. This
316 can save you all the hassle of setting up ssh or charmd daemons.
317 To use this option, just type:
319      > ./charmrun ++local ./pgm 12 100 +p2
321 However, for best performance, you should launch one node program per processor.
325 Build Charm++ in Dynamic libraries
326 =============================
328 In order to compile Charm++ into dynamic libraries, one need to specify
329 "-build-shared" option as one of the Charm compiler script "charmc"
330 at link time. For example, to compile Charm++ under net-linux/tmp, run
332 make charm++ OPTS='-O -build-shared'
334 Charm++'s dynamic libraries are compiled into lib_so/ directory.
335 Typically, they are with ".so" suffix.
337 Note, "-build-shared" option is automatically turned on when building
338 Charm++ using "build" script. So you don't need to pass "-build-shared"
339 option to "build".
341 One can compile a Charm++ application linking against Charm++ dynamic
342 libraries, run charmc with "-charm-shared" as one of the link options.
343 For example:
345 charmc -o pgm pgm.o -charm-shared
347 You can then run the program as usual.
348 Note, linking against Charm++ dynamic libraries produces much smaller size
349 binaries and takes much less linking time.
351 FOR MORE INFORMATION
352 ====================
354 The Charm++ web page, with documentation, more programs,
355 and the latest version of Charm++, is at
356         http://charm.cs.illinois.edu/
358 The Charm++ mailing list, for questions, comments, suggestions,
359 improvements, or bug reports is
360         charm@cs.illinois.edu
363 AUTHORS
364 =======
366 Charm++ was created and is maintained by the Parallel Programming Lab,
367 in the Computer Science department at the University of Illinois at
368 Urbana-Champaign.  Our managing professor is Dr. L.V. Kale; students
369 and staff have included (in rough time order) Wennie Shu, Kevin Nomura, Wayne
370 Fenton, Balkrishna Ramkumar, Vikram Saletore, Amitabh B. Sinha, Manish
371 Gupta, Attila Gursoy, Nimish Shah, Sanjeev Krishnan, Jayant DeSouza,
372 Parthasarathy Ramachandran, Jeff Wright, Michael Lang, Jackie Wang,
373 Fang Hu, Michael Denardo, Joshua Yelon, Narain Jagathesan, Zehra Sura,
374 Krishnan Varadarajan, Sameer Paranjpye, Milind Bhandarkar, Robert Brunner,
375 Terry Wilmarth, Gengbin Zheng, Orion Lawlor, Celso Mendes, Karthik Mahesh,
376 Neelam Saboo, Greg Koenig, Sameer Kumar, Sayantan Chakravorty, Chao Huang,
377 Chee Lee, Fillipo Gioachin, Isaac Dooley, Abhinav Bhatele, Aaron Becker,
378 Ryan Mokos, Ramprasad Venkataraman, Gagan Gupta, Pritish Jetley, Lukasz
379 Wesolowski, Esteban Meneses, Chao Mei, David Kunzman, Osman Sarood,
380 Abhishek Gupta, Yanhua Sun, Ehsan Totoni, and Akhil Langer. Current developers
381 include Eric Bohm, Phil Miller, Jonathan Lifflander, Xiang Ni, Harshitha Menon,
382 Nikhil Jain, Bilge Acun, Ronak Buch, Michael Robson, Eric Mikida, and Harshit
383 Dokania.