paulb@22 | 1 | Introduction
|
paulb@22 | 2 | ------------
|
paulb@22 | 3 |
|
paulb@40 | 4 | The pprocess module provides elementary support for parallel programming in
|
paulb@22 | 5 | Python using a fork-based process creation model in conjunction with a
|
paulb@68 | 6 | channel-based communications model implemented using socketpair and poll. On
|
paulb@68 | 7 | systems with multiple CPUs or multicore CPUs, processes should take advantage
|
paulb@68 | 8 | of as many CPUs or cores as the operating system permits.
|
paulb@22 | 9 |
|
paulb@22 | 10 | Quick Start
|
paulb@22 | 11 | -----------
|
paulb@22 | 12 |
|
paulb@68 | 13 | Try running the simple example:
|
paulb@68 | 14 |
|
paulb@68 | 15 | PYTHONPATH=. python examples/simple.py
|
paulb@68 | 16 |
|
paulb@68 | 17 | (A simple example which shows how a limited number of processes can be used to
|
paulb@68 | 18 | perform a parallel computation.)
|
paulb@68 | 19 |
|
paulb@68 | 20 | Or studying some elementary tests:
|
paulb@22 | 21 |
|
paulb@22 | 22 | PYTHONPATH=. python tests/create_loop.py
|
paulb@22 | 23 | PYTHONPATH=. python tests/start_loop.py
|
paulb@22 | 24 |
|
paulb@22 | 25 | (Simple loop demonstrations which use two different ways of creating and
|
paulb@22 | 26 | starting the parallel processes.)
|
paulb@22 | 27 |
|
paulb@36 | 28 | PYTHONPATH=. python tests/start_indexer.py <directory>
|
paulb@22 | 29 |
|
paulb@36 | 30 | (A text indexing demonstration, where <directory> should be a directory
|
paulb@36 | 31 | containing text files to be indexed, although HTML files will also work well
|
paulb@36 | 32 | enough. After indexing the files, a prompt will appear, words or word
|
paulb@36 | 33 | fragments can be entered, and matching words and their locations will be
|
paulb@36 | 34 | shown. Run the program without arguments to see more information.)
|
paulb@22 | 35 |
|
paulb@48 | 36 | Some examples are also found in the examples directory, notably the PyGmy
|
paulb@48 | 37 | raytracer modified to use pprocess:
|
paulb@48 | 38 |
|
paulb@48 | 39 | cd examples/PyGmy
|
paulb@48 | 40 | PYTHONPATH=../..:. python scene.py
|
paulb@48 | 41 |
|
paulb@68 | 42 | (This should produce a file called test.tif - a TIFF file containing a
|
paulb@68 | 43 | raytraced scene image.)
|
paulb@68 | 44 |
|
paulb@22 | 45 | Contact, Copyright and Licence Information
|
paulb@22 | 46 | ------------------------------------------
|
paulb@22 | 47 |
|
paulb@22 | 48 | No Web page has yet been made available for this work, but the author can be
|
paulb@22 | 49 | contacted at the following e-mail address:
|
paulb@22 | 50 |
|
paulb@22 | 51 | paul@boddie.org.uk
|
paulb@22 | 52 |
|
paulb@22 | 53 | Copyright and licence information can be found in the docs directory - see
|
paulb@78 | 54 | docs/COPYING.txt, docs/lgpl-3.0.txt and docs/gpl-3.0.txt for more information.
|
paulb@22 | 55 |
|
paulb@48 | 56 | For the PyGmy raytracer example, different copyright and licence information
|
paulb@48 | 57 | is provided in the docs directory - see docs/COPYING-PyGmy.txt and
|
paulb@48 | 58 | docs/LICENCE-PyGmy.txt for more information.
|
paulb@48 | 59 |
|
paulb@22 | 60 | Dependencies
|
paulb@22 | 61 | ------------
|
paulb@22 | 62 |
|
paulb@22 | 63 | This software depends on standard library features which are stated as being
|
paulb@22 | 64 | available only on "UNIX"; it has only been tested on a GNU/Linux system.
|
paulb@22 | 65 |
|
paulb@84 | 66 | New in parallel 0.2.6 (Changes since parallel 0.2.5)
|
paulb@84 | 67 | ----------------------------------------------------
|
paulb@84 | 68 |
|
paulb@84 | 69 | * Added managed callables: wrappers around callables which cause them to be
|
paulb@84 | 70 | automatically managed by the exchange from which they were acquired.
|
paulb@84 | 71 | * Added MakeParallel: a wrapper instantiated around a normal function which
|
paulb@84 | 72 | sends the result of that function over the supplied channel when invoked.
|
paulb@84 | 73 | * Added a Map class which attempts to emulate the built-in map function.
|
paulb@84 | 74 | * Extended and updated the examples.
|
paulb@84 | 75 |
|
paulb@78 | 76 | New in parallel 0.2.5 (Changes since parallel 0.2.4)
|
paulb@78 | 77 | ----------------------------------------------------
|
paulb@78 | 78 |
|
paulb@78 | 79 | * Added a start method to the Exchange class for more convenient creation of
|
paulb@78 | 80 | processes.
|
paulb@78 | 81 | * Relicensed under the LGPL (version 3 or later) - this also fixes the
|
paulb@78 | 82 | contradictory situation where the GPL was stated in the pprocess module
|
paulb@78 | 83 | (which was not, in fact, the intention) and the LGPL was stated in the
|
paulb@78 | 84 | documentation.
|
paulb@78 | 85 |
|
paulb@73 | 86 | New in parallel 0.2.4 (Changes since parallel 0.2.3)
|
paulb@73 | 87 | ----------------------------------------------------
|
paulb@73 | 88 |
|
paulb@73 | 89 | * Set buffer sizes to zero for the file object wrappers around sockets: this
|
paulb@73 | 90 | may prevent deadlock issues.
|
paulb@73 | 91 |
|
paulb@68 | 92 | New in parallel 0.2.3 (Changes since parallel 0.2.2)
|
paulb@68 | 93 | ----------------------------------------------------
|
paulb@68 | 94 |
|
paulb@68 | 95 | * Added convenient message exchanges, offering methods handling common
|
paulb@68 | 96 | situations at the cost of having to define a subclass of Exchange.
|
paulb@68 | 97 | * Added a simple example of performing a parallel computation.
|
paulb@68 | 98 | * Improved the PyGmy raytracer example to use the newly added functionality.
|
paulb@68 | 99 |
|
paulb@55 | 100 | New in parallel 0.2.2 (Changes since parallel 0.2.1)
|
paulb@55 | 101 | ----------------------------------------------------
|
paulb@55 | 102 |
|
paulb@55 | 103 | * Changed the status testing in the Exchange class, potentially fixing the
|
paulb@55 | 104 | premature closure of channels before all data was read.
|
paulb@55 | 105 | * Fixed the PyGmy raytracer example's process accounting by relying on the
|
paulb@55 | 106 | possibly more reliable Exchange behaviour, whilst also preventing
|
paulb@55 | 107 | erroneous creation of "out of bounds" processes.
|
paulb@58 | 108 | * Added a removed attribute on the Exchange to record which channels were
|
paulb@58 | 109 | removed in the last call to the ready method.
|
paulb@55 | 110 |
|
paulb@48 | 111 | New in parallel 0.2.1 (Changes since parallel 0.2)
|
paulb@48 | 112 | --------------------------------------------------
|
paulb@48 | 113 |
|
paulb@48 | 114 | * Added a PyGmy raytracer example.
|
paulb@53 | 115 | * Updated copyright and licensing details (FSF address, additional works).
|
paulb@48 | 116 |
|
paulb@40 | 117 | New in parallel 0.2 (Changes since parallel 0.1)
|
paulb@40 | 118 | ------------------------------------------------
|
paulb@40 | 119 |
|
paulb@40 | 120 | * Changed the name of the included module from parallel to pprocess in order
|
paulb@40 | 121 | to avoid naming conflicts with PyParallel.
|
paulb@40 | 122 |
|
paulb@22 | 123 | Release Procedures
|
paulb@22 | 124 | ------------------
|
paulb@22 | 125 |
|
paulb@40 | 126 | Update the pprocess __version__ attribute.
|
paulb@22 | 127 | Change the version number and package filename/directory in the documentation.
|
paulb@22 | 128 | Update the release notes (see above).
|
paulb@22 | 129 | Check the release information in the PKG-INFO file.
|
paulb@22 | 130 | Tag, export.
|
paulb@22 | 131 | Archive, upload.
|
paulb@68 | 132 | Update PyPI.
|
paulb@26 | 133 |
|
paulb@26 | 134 | Making Packages
|
paulb@26 | 135 | ---------------
|
paulb@26 | 136 |
|
paulb@44 | 137 | To make Debian-based packages:
|
paulb@26 | 138 |
|
paulb@44 | 139 | 1. Create new package directories under packages if necessary.
|
paulb@26 | 140 | 2. Make a symbolic link in the distribution's root directory to keep the
|
paulb@26 | 141 | Debian tools happy:
|
paulb@26 | 142 |
|
paulb@44 | 143 | ln -s packages/ubuntu-hoary/python2.4-parallel-pprocess/debian/
|
paulb@26 | 144 |
|
paulb@26 | 145 | 3. Run the package builder:
|
paulb@26 | 146 |
|
paulb@26 | 147 | dpkg-buildpackage -rfakeroot
|
paulb@26 | 148 |
|
paulb@26 | 149 | 4. Locate and tidy up the packages in the parent directory of the
|
paulb@26 | 150 | distribution's root directory.
|