source: inundation/pypar_dist/README @ 3444

Last change on this file since 3444 was 3444, checked in by ole, 19 years ago

Comment about compilation of pypar

File size: 12.2 KB
RevLine 
[85]1------------------------------------------------
2PyPAR - Parallel Python, efficient and scalable
3parallelism using the message passing interface (MPI).
4
5Author:  Ole Nielsen (2001, 2002, 2003)
6Email:   Ole.Nielsen@anu.edu.au
7Version: See pypar.__version__
8Date:    See pypar.__date__
9
10Major contributions by
11    Gian Paolo Ciceri (gp.ciceri@acm.org)
12    Prabhu Ramachandran (prabhu@aero.iitm.ernet.in)
13 
14Minor but important contributions by
15    Doug Orr (doug@arbor.net)   
16    Michal Kaukic (mike@frcatel.fri.utc.sk)         
17   
18------------------------------------------------
19
20The python module pypar.py and the C-extension mpi.c
21implements scalable parallelism on distributed and shared
22memory architectures using the essential subset of
23the Message Passing Interface (MPI) standard.
24
25FEATURES
26
27- Python interpreter is not modified:
28  Parallel python programs need only import the pypar module.
29
30- Easy installation: This is essentially about compiling and linking
31  the C-extension with the local MPI installation. A distutils setup file
32  is included.
33
34- Flexibility: Pypar allows communication of general Python objects
35  of any type. 
36 
37- Intuitive API:
38  The user need only specify what to send and to which processor.
39  Pypar takes care of details about
40  data types and MPI specifics such as tags, communicators and buffers.
41  Receiving is analogous.
42 
43- Efficiency:
44  Full bandwidth of C-MPI programs is achieved for consecutive Numerical
45  arrays. Latency is less than twice that of pure C-MPI programs.
46  Test programs to verify this are included (pytiming, ctiming.c)
47 
48- Lightweight:
49  Pypar consists of just two files: mpiext.c and pypar.py           
50
51See the DOC file for instructions on how to program with pypar.
52
53   
54 
55PRE-REQUISITES (on all nodes)
56
57  Python 2.0 or later
58  Numeric Python (incl RandomArray) matching the Python installation
59  Native MPI C library
60  Native C compiler
61 
62  Pypar has been tested on the following platforms
63    MPI on DEC Alpha
64    LAM/MPI (6.5.6, 7.0) on Linux (Debian Woody/Cid and Red Hat 7.1)
65    MPICH and LAM 7.0 on Solaris (Sun Enterprise)
66    MPICH on Linux
[129]67    MPICH on Windows (NT/2000)
68    MPICH for Darwin (Mac OS)
69    LAM/MPI with Linux on Opteron 64 bit
[85]70   
71 
72INSTALL
73
74  UNIX PLATFORMS       
75    Type
76      python setup.py install
77 
78    This should install pypar and its extension in the default
79    site-packages directory on your system.
80   
81    If you wish to install it in your home directory use
82 
83      python setup.py install --prefix=~         
84     
85  WINDOWS (NT/2000, MPICH)
86    To build, you need:
87      1) MPICH (http://www-unix.mcs.anl.gov/mpi/mpich/)
88      2) MinGW (http://www.mingw.org). Tested with GCC v 2.95-3.6.
89      3) Set MPICH_DIR to the appropriate directory
90      4) Build using 'python setup.py build --compiler=mingw32'
91      5) Install using 'python setup.py install'.
92
93  ---
94  If you encountered any installation problems, read on.
95  Do not worry about messages about unresolved symbols. This is normal
96  for shared libraries on some machines.
97   
98  To compile C-extension mpi.c requires either a mpi-aware c compiler
99  such as mpicc or a standard c compiler with mpi libraries linked in.
100  See local MPI installation for details, possibly edit Makefile and
101  type make.   
102  See installation notes below about compiling under mpi.
103
104 
105TESTING
106  Pypar comes with a number of tests and demos available in the
107  examples directory - please try these to verify the installation.
108 
109
110RUNNING PYTHON MPI JOBS
111 
112  Pypar runs in exactly the same way as MPI programs written in
113  C or Fortran.
114 
115  E.g. to run the enclosed demo script (demo.py) on 4 processors,
116  enter a command similar to
117   
118    mpirun -np 4 python demo.py
119 
120  Consult your MPI distribution for exact syntax of mpirun.
121  Sometimes it is called prun and often parallel jobs will be
122  submitted in batch mode.
123 
124  You can also execute demo.py as a stand-alone executable python script
125 
126    mpirun -np 4 demo.py
127 
128 
129  Enclosed is a script to estimate the communication speed of your system.
130  Execute 
131 
132    mpirun -np 4 pytiming
133 
134  Care has been taken in pypar to achieve the same bandwidth and almost as
135  good communication latency as corresponding C/MPI programs.
136  Please compile and run ctiming.c to see the reference values:
137 
138    make ctiming
139    mpirun -np 4 ctiming       
140   
141  Note that timings might fluctuate from run to run due to variable
142  system load.   
143
144  An example of a master-slave program using pypar is available in demo2.py. 
145 
146 
147INSTALLATION NOTES (If all else fails)
148
149Most MPI implementations provide a script or an executable called
150"mpicc" which compiles C programs using MPI and does
151not require any explicitly mentioned libraries.
152If such a script exists, but with a different name, change
153the name in the beginning of compile.py. If no such script exists, put
154the name of your C compiler in that place and add all required linking
155options yourself.
156
157For example, on an Alpha server it would look something like
158
159 cc -c mpi.c -I/opt/Python-2.1/include/python2.1/
160 cc -shared mpi.o -o mpi.so -lmpi -lelan
161 
162 or using the wrapper
163 
164 mpicc -c mpi.c -I/opt/Python-2.1/include/python2.1/
165 mpicc -shared mpi.o -o mpi.so
166
167On Linux (using LAM-MPI) it is
168
169 mpicc -c mpi.c -I/opt/Python-2.1/include/python2.1/
170 mpicc -shared mpi.o -o mpi.so
171
172 Start processors using
173 lamboot -v lamhosts 
[3444]174 
175The script install.py (which is using compile.py) is a non-distutils
176way of compiling the extension.
[85]177
[129]178
179HOW DOES PYPAR WORK?
180
181Pypar works as follows
182    1  mpirun starts P python processes as specified by mpirun -np P
183    2  each python process imports pypar which in turn imports a shared
184       library (python extension mpiext.so) that has been statically linked
185       to the C MPI libraries using e.g. mpicc (or cc -lmpi)
186    3  The Python extension proceeds to call MPI_init with any commandline
187       parameters passed in by mpirun (As far as I remember MPICH uses this
188       to identify rank and size, whereas LAM doesn't)
189    4  The supported MPI calls are made available to Python through the
190       pypar interface
191
192    If  pypar is invoked sequentially it supports a rudimentary interface
193    with e.g. rank() == 0 and size() == 1
194 
195 
196 
[85]197DOCUMENTATION
198
199  See the file DOC for an introduction to pypar.
200  See also examples demo.py and pytiming
201  as well as documentation in pypar.py.
202
203 
204HISTORY
[123]205version 1.9.1 (15 Dec 2003)
206  Consistent naming (all lower case, no abbreviations)
207version 1.9 (3 Dec 2003)
208  Obsoleted raw forms of communication as they were confusing.
209  The semantics of send, receive, scatter, gather etc is now that
210  one can optionally specify a buffer to use if desired.
211  Bypass forms added.
212 
[85]213version 1.8.2 (16 November 2003)
214  Fixed scatter, gather and reduce calls to automatically
215  figure out buffer lengths. Also tested scatter and gather for
216  complex and multidimensional data.
217version 1.8.1 (13 November 2003)
218  Added direct support (i.e. not using the vanilla protocol)
219  for multidimensional Numeric arrays of type Complex.
220version 1.8 (11 November 2003)
221  Changed status object to be (optionally) returned from receive and
222  raw_receive rather maintaining a global state where one instance of
223  the status object is modified.
224  This was suggested by the audience at presentation at Department of
225  Computer Science, Australian National University, 18 June 2003.
226 
227version 1.7 (7 November 2003)
228  Added support for Numerical arrays of arbitrary dimension
229  in send, receive and bcast.
230  The need for this obvious functionality was pointed by Michal Kaukic.
231 
232version 1.6.5 (30 August 2003)
233  Added NULL commandline argument as required by LAM 7.0 and
234  identified by Doug Orr and Dave Reed.
235version 1.6.4 (10 Jan 2003)
236  Comments and review of installation
237version 1.6.3 (10 Jan 2003)
238  Minor issues and clean-up
239version 1.6.2 (29 Oct 2002)
240  Added Windows platform to installation as contributed by
241  Simon Frost
242version 1.6.0 (18 Oct 2002)
243  Changed installation to distutils as contributed by
244  Prabhu Ramachandran
245 
246version 1.5 (30 April 2002)
247  Got pypar to work with MPICH/Linux and cleaned up initialisation
248version 1.4 (4 March 2002)
249  Fixed-up and ran testpypar on 22 processors on Sun
250version 1.3 (21 February 2002)                                     
251  Added gather and reduce fixed up testpypar.py
252 
253version 1.2.2, 1.2.3 (17 February 2002)                                     
254  Minor fixes in distribution
255version 1.2.1 (16 February 2002)                                     
256  Status block, MPI_ANY_TAG, MPI_ANY_SOURCE exported                 
257Version 1.2 (15 February 2002)                                             
258  Scatter added by Gian Paolo Ciceri                                   
259Version 1.1 (14 February 2002)                                             
260  Bcast added by Gian Paolo Ciceri                                   
261Version 1.0.2 (10 February 2002)                                         
262  Modified by Gian Paulo Ciceri to allow pypar run under Python 2.2 
263Version 1.0.1 (8 February 2002)                                       
264  Modified to install on SUN enterprise systems under Mpich         
265Version 1.0 (7 February 2002)                                         
266  First public release for Python 2.1 (OMN)                         
267 
268TODO 
269  max_tag is set to 32767. This works for Linux/LAM     
270  I couldn't use MPI_TAG_UB as it returned 0.
271  I would like a general solution.
272
273
[123]274  Scatter needs to send buffer specified on all processes
275  even though it is ignored by all non-root processes.
276  How could we overcome that?
277  Similar problem for gather
278 
279  Gather an scatter: One should be able to specify along which axis
280  arrays should be concatenated.
281
282
[85]283KNOWN BUGS
[123]284  Scatter for the moment works only properly when the amount of data is a
285  multiple of the number of processors (as does the underlying MPI_Scatter).
286  I am working on a more general scatter (and gather) which will
287  distribute data as evenly as possible for all amounts of data. 
288
[85]289     
290LICENSE
291    This program is free software; you can redistribute it and/or modify
292    it under the terms of the GNU General Public License as published by
293    the Free Software Foundation; either version 2 of the License, or
294    (at your option) any later version.
295
296    This program is distributed in the hope that it will be useful,
297    but WITHOUT ANY WARRANTY; without even the implied warranty of
298    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
299    GNU General Public License (http://www.gnu.org/copyleft/gpl.html)
300    for more details.
301
302    You should have received a copy of the GNU General Public License
303    along with this program; if not, write to the Free Software
304    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
305
306
307 Contact address: Ole.Nielsen@anu.edu.au
308
309 =============================================================================
310   
311ACKNOWLEDGEMENTS 
312  This work was supported by School of Mathematical Sciences at
313  the Australian National University and funded by Australian
314  Partnership for Advanced Computing (APAC).
315  Many thanks go to
316 
317    Gian Paolo Ciceri (gp.ciceri@acm.org)
318        for fixing pypar to run under Python 2.2 and for adding all the
319        collective communication stuff from version 1.1 and onwards.
320    Prabhu Ramachandran (prabhu@aero.iitm.ernet.in)
321        for making a proper distutils installation procedure
322    Simon D. W. Frost (sdfrost@ucsd.edu)
323        for testing pypar under Windows and adding installation procedure
324    Jakob Schiotz (schiotz@fysik.dtu.dk) and Steven Farcy (steven@artabel.net)
325        for pointing out initial problems with pypar and MPICH.
326    Markus Hegland (Markus.Hegland@anu.edu.au)
327        for supporting the work.
328    Doug Orr (doug@arbor.net)
329        for identifying and fixing problem with LAM 7.0 requiring
330        last commandline argumnet to be NULL.
331    Dave Reed (dreed@capital.edu)
332        for pointing out problem with LAM 7.0 and for testing the fix. 
333    Matthew Wakefield (matthew.wakefield@anu.edu.au)
334        for pointing out and fixing support for Mac OS X (darwin)
335    David Brown (David.L.Brown@kla-tencor.com)
336        for contributing to the Windows/Cygwin installation procedure   
337    Michal Kaukic (mike@frcatel.fri.utc.sk)     
338        for pointing out the need for multi dimensional arrays and
339        for suggesting an implementation in the 2D case.       
340       
341
342
343 
344     
345
346
347
348
349
350
351
352
353
[123]354
355
356
Note: See TracBrowser for help on using the repository browser.