error check for overflow
[charm.git] / README
blob0be12f5c37d274b2329935bb031cd61241aa9632
1                            Charm++
3        Copyright (C) 1989-2012 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 git://charm.cs.illinois.edu/charm.git
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 "FEM".
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++ net-linux
65 will build charm++ in the directory: net-linux/.  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            PC Linux       UDP/Myrinet   GNU compiler
91 net-sol              Solaris        UDP           GNU compiler
92 net-win32            Win32          UDP           MS Visual C++
93 net-cygwin           Win32/cygwin   UDP           GNU compiler
94 mpi-sp               IBM A/IX       MPI           A/IX xlC Compiler 
95 mpi-origin           Origin2000     MPI           SGI C++ compiler
96 net-ppc-darwin       MacOS X        UDP           GNU C++ compiler
97 net-linux-ia64       IA64 Linux     UDP/Myrinet   GNU compiler
98 net-linux-amd64      Opteron Linux  UDP           GNU compiler
99 net-irix             IRIX           UDP           GNU compiler
100 net-axp              Alpha          UDP           GNU compiler
101 net-hp               HP-UX          UDP           GNU compiler
102 mpi-linux            PC Linux       MPI           GNU compiler
103 mpi-ppc-darwin       MacOS X        MPI           GNU C++ compiler
104 mpi-linux-ia64       IA64 Linux     MPI           GNU compiler
105 mpi-linux-x86_64     Opteron Linux  MPI           GNU compiler
106 mpi-axp              Alpha          MPI           GNU compiler
107 mpi-linux-axp        Alpha Linux    MPI           GNU compiler
108 origin2000           Origin2000  shared-mem       SGI C++ compiler
109 t3e                  Cray T3E    shared-mem       Cray C++ compiler
112 To choose <version>, your choice is determined by three options:
114 1.)  The way a parallel program written in Charm++ will communicate:
116         "net-" Charm++ communicates using the regular TCP/IP stack
117 (UDP packets), which works everywhere but is fairly slow.  Use this
118 option for networks of workstations, clusters, or single-machine 
119 development and testing.
121         "mpi-" Charm++ communicates using MPI calls.  Use this for
122 machines with a good MPI implementation (such as the Origin 2000).
124         "gemini_gni-", "bluegene[lpq]-", Charm++
125 communicates using direct calls to the machine's communication primitives.
127         "multicore-" Charm++ communicates using shared memory within a
128         single node
130         "sim-" and "uth-" are not actively maintained.  These are
131 single-processor versions: "uth-" simulates processors as user-level
132 threads; "sim-" switches between processors and counts communications.
135 2.)  Your operating system:
137         "linux"       Linux
138         "win{32,64}"  MS Windows with MS Visual C++ compiler (32/64-bit, resp.)
139         "cygwin"      MS Windows with Cygnus' Cygwin Unix layer
140         "darwin"      Apple Mac OS X
141         "sol"         Solaris
142         "aix"         IBM A/IX
143         "sp"          IBM SP A/IX
146 3.)  Some operating systems have other architecture options, such as:
148         "-x86"     For Solaris and Mac OS X, target x86 hardware (instead of
149                    SPARC or PPC).
150         "-ppc"     POWER/PowerPC
151         "-mips64"  MIPS, such as for SiCortex systems
152         "-ia64"    Use Itanium(tm) IA-64 instructions (instead of x86).
153         "-x86_64"  Use AMD64/EM64T 64-bit x86 instructions (instead of 32 bit).
154         "-cell"    Sony/Toshiba/IBM Cell PPE (e.g. Playstation 3,
155                    Mercury blades, Roadrunner)
157 Your Charm++ version is made by concatenating the options, e.g.:
159 "net-linux-x86_64"   Charm++ for a network of 64-bit Linux workstations,
160                      compiled using g++.
162 "mpi-crayxt"         Charm++ for Cray XT4/5 systems using the system's compiler.
165 **** How to choose <options> ****
167 <version> above defines the most important OS, CPU and Communication of 
168 your machine, and most of time, it use the GNU gcc as default compiler. 
169 To use different compiler or demand additional special feature support, you 
170 need to choose <options> from the following list:
172 * gcc3  - GNU GCC/G++ version 3
173 * acc  - HP aC++ compiler
174 * cc  - For Sun WorkShop C++ compilers;
175 * cc64 - For 64 bits Sun WorkShop C++ or IBM xlC compilers;
176 * cxx - DIGITAL C++ compiler;
177 * kcc - KAI C++ compiler;
178 * pgcc - Portland Group's C++ compiler;
179 * icc - Intel C/C++ compiler for Linux IA32
180 * ecc - Intel C/C++ compiler for Linux IA64
181 * mpcc - SUN Solaris C++ compiler for MPI.
183 * scyld - support Beowulf Scyld based on bproc;
184 * clustermatic - for Clustermatic Beowulf cluster based on bproc;
185 * gm - support MyriCom's Myrinet GM library;
186 * vmi - support NCSA's VMI library;
188 * tcp - for net- version, default communication is via UDP. Using option
189         tcp will switch to TCP. TCP version of CHarm++ is usually slower
190         than UDP, but it is more reliable.
191 * smp - Enable direct SMP support.  An "smp" version communicates using
192         shared memory within a machine; but normal message passing across 
193         machines. Because of locking, "smp" may slightly impact non-SMP 
194         performance. Try your application to decide if enabling smp mode 
195         improves performance.
197 * bluegene - compile Charm++ as running on Blue Gene emulator.
198 * help - show supported options for a version. For example, for net-linux, 
199          running:
200          > ./build charm++ net-linux help
201          will give:
202          supported options: gcc3 gm icc kcc pgcc scyld smp bluegene tcp
205 BUILDING THE SOURCE
206 ===================
208 If you have downloaded a binary version of Charm++, you can skip
209 this step-- Charm++ should already be compiled.  For win32/win64 systems,
210 see README.win; for Cygwin version, see README.cygwin; for net- version, 
211 see README.net.
213 Once you have decided on a version, unpack Charm++, cd into charm,
214 and run
216      > ./build <target> <version> <opts>
218 <target> is one of
219         "charm++"  The basic Charm++ language.
220         "AMPI"     An implementation of MPI on top of Charm++
221         "FEM"      A Finite-Element framework on top of Charm++
222         "Tau"      TAU's performance profiling/tracing
224 <version> is described above
226 <opts> are build-time options (such as the compiler or "smp"), 
227 or command line options passed to the charmc compile script.
228 Common compile time options such as -g, -O, -Ipath, -Lpath, -llib are 
229 accepted.
231 For example, on a Linux machine, you would run
232      > ./build charm++ net-linux -O
234 This will construct a net-linux directory, link over all
235 the Charm++ source code into net-linux/tmp, build the entire
236 Charm++ runtime system in net-linux/tmp, and link sample programs 
237 into net-linux/pgms.
239 Several #define's control the compilation of Charm++.  Some of these
240 #define's can be found in src/<version>/conv-mach.h.  #define's can
241 also be specified on the command line, using the -D option.  For
242 example,
243     > ./build charm++ net-linux -O -DCMK_OPTIMIZE=1
245 CMK_OPTIMIZE: Turn on optimizations in Charm++/Converse. This disables most of
246 the run-time checking performed by Converse and Charm++ runtime. This option
247 should be used only after the program has been debugged. Also, this option
248 disables Converse/Charm++ tracing mechanisms such as projections and summary.
250 When Charm++ is built successfully, the diretory structure under the
251 target directory will look like:
253 net-linux/
254    |
255    ---  bin/                    # all executables
256    |
257    ---  doc/                    # documentations
258    |
259    ---  include/                # header files
260    |
261    ---  lib/                    # libraries
262    |
263    ---  lib_so/                 # dynamic libraries
264    |
265    ---  examples/               # all example programs
266    |
267    ---  tests/                  # all test programs
268    |
269    ---  tmp/                    # Charm++ build directory
271 BUILDING A PROGRAM
272 ==================
274 To make a sample program, cd into pgms/charm++/queens/.
275 This program solves the N-queens problem-- find how many ways there 
276 are to arrange N queens on an NxN chess board such that none may 
277 attack another.
279 To build the program, type make.  You should get an
280 executable named "pgm".
283 RUNNING A PROGRAM
284 ==================
286 Following the previous example, to run the program on two processors, type
288      > ./charmrun ./pgm 12 6 +p2
290 This should run for a few seconds, and print out:
291 There are 14200 Solutions to 12 queens. Finish time=4.030000
293 Charmrun is used to provide a uniform interface to run charm programs.
294 On some platforms, charmrun is just a shell script which calls the 
295 platform-specific start program, such as mpirun on mpi versions.
297 For net- version, charmrun is an executable which invokes rsh or ssh to start 
298 node programs on remote machines. You should set up a ~/.nodelist that 
299 enumerates all the machines you want to run jobs on, otherwise it will
300 create a default ~/.nodelist for you that contains only localhost. Here is a 
301 typical .nodelist file:
303 group main ++shell /bin/ssh
304 host <machinename>
306 The default remote shell program is rsh, but you can define different remote 
307 shell you like to start remote processes in the ++shell option. You should 
308 also make sure that you can rsh or ssh to these machines without password 
309 authentication. Just type following command to verify:
310      > rsh <machinename> date
311 If this gives you current date immediately, your running environment with this 
312 node has been setup correctly.
314 Now, for test running purpose, net- version charmrun comes with an easy-to-use 
315 "++local" options. No remote shell invocation is needed in this case. It starts
316 node programs right on your local machine. This could be useful if you just 
317 want to run program on only one machine, for example, your laptop. This
318 can save you all the hassle of setting up rsh/ssh or charmd daemons.
319 To use this option, just type:
320      
321      > ./charmrun ++local ./pgm 12 100 +p2
323 However, for best performance, you should launch one node program per processor.
325 For more detailed information, please check the "INSTALLATION MANUAL" and "RUN MANUAL" 
326 under doc/install.
329 Build Charm++ in Dynamic libraries
330 =============================
332 In order to compile Charm++ into dynamic libraries, one need to specify
333 "-build-shared" option as one of the Charm compiler script "charmc" 
334 at link time. For example, to compile Charm++ under net-linux/tmp, run
336 make charm++ OPTS='-O -build-shared'
338 Charm++'s dynamic libraries are compiled into lib_so/ directory. 
339 Typically, they are with ".so" suffix.
341 Note, "-build-shared" option is automatically turned on when building 
342 Charm++ using "build" script. So you don't need to pass "-build-shared" 
343 option to "build".
345 One can compile a Charm++ applicaiton linking against Charm++ dynamic 
346 libraries, run charmc with "-charm-shared" as one of the link options.
347 For example:
349 charmc -o pgm pgm.o -charm-shared
351 You can then run the program as usual.
352 Note, linking against Charm++ dynamic libraries produces much smaller size
353 binaries and takes much less linking time.
355 FOR MORE INFORMATION
356 ====================
358 The Charm++ web page, with documentation, more programs,
359 and the latest version of Charm++, is at
360         http://charm.cs.illinois.edu/
362 The Charm++ mailing list, for questions, comments, suggestions, 
363 improvements, or bug reports is
364         charm@cs.illinois.edu
367 AUTHORS
368 =======
370 Charm++ was created and is maintained by the Parallel Programming Lab, 
371 in the Computer Science department at the University of Illinois at
372 Urbana-Champaign.  Our managing professor is Dr. L.V. Kale; students
373 have included (in rough time order) Wennie Shu, Kevin Nomura, Wayne
374 Fenton, Balkrishna Ramkumar, Vikram Saletore, Amitabh B. Sinha, Manish
375 Gupta, Attila Gursoy, Balkrishna Ramkumar, Amitabh B. Sinha, Nimish
376 Shah, Sanjeev Krishnan, Jayant DeSouza, Parthasarathy Ramachandran,
377 Jeff Wright, Michael Lang, Jackie Wang, Fang Hu, Michael Denardo,
378 Joshua Yelon, Narain Jagathesan, Zehra Sura, Krishnan Varadarajan, 
379 Sameer Paranjpye, Milind Bhandarkar, Robert Brunner and Jayant Desouza. 
380 Current developers include Terry Wilmarth, Gengbin Zheng, Orion Lawlor, 
381 Karthik Mahesh, and Neelam Saboo.