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@78 | 66 | New in parallel 0.2.5 (Changes since parallel 0.2.4)
|
paulb@78 | 67 | ----------------------------------------------------
|
paulb@78 | 68 |
|
paulb@78 | 69 | * Added a start method to the Exchange class for more convenient creation of
|
paulb@78 | 70 | processes.
|
paulb@78 | 71 | * Relicensed under the LGPL (version 3 or later) - this also fixes the
|
paulb@78 | 72 | contradictory situation where the GPL was stated in the pprocess module
|
paulb@78 | 73 | (which was not, in fact, the intention) and the LGPL was stated in the
|
paulb@78 | 74 | documentation.
|
paulb@78 | 75 |
|
paulb@73 | 76 | New in parallel 0.2.4 (Changes since parallel 0.2.3)
|
paulb@73 | 77 | ----------------------------------------------------
|
paulb@73 | 78 |
|
paulb@73 | 79 | * Set buffer sizes to zero for the file object wrappers around sockets: this
|
paulb@73 | 80 | may prevent deadlock issues.
|
paulb@73 | 81 |
|
paulb@68 | 82 | New in parallel 0.2.3 (Changes since parallel 0.2.2)
|
paulb@68 | 83 | ----------------------------------------------------
|
paulb@68 | 84 |
|
paulb@68 | 85 | * Added convenient message exchanges, offering methods handling common
|
paulb@68 | 86 | situations at the cost of having to define a subclass of Exchange.
|
paulb@68 | 87 | * Added a simple example of performing a parallel computation.
|
paulb@68 | 88 | * Improved the PyGmy raytracer example to use the newly added functionality.
|
paulb@68 | 89 |
|
paulb@55 | 90 | New in parallel 0.2.2 (Changes since parallel 0.2.1)
|
paulb@55 | 91 | ----------------------------------------------------
|
paulb@55 | 92 |
|
paulb@55 | 93 | * Changed the status testing in the Exchange class, potentially fixing the
|
paulb@55 | 94 | premature closure of channels before all data was read.
|
paulb@55 | 95 | * Fixed the PyGmy raytracer example's process accounting by relying on the
|
paulb@55 | 96 | possibly more reliable Exchange behaviour, whilst also preventing
|
paulb@55 | 97 | erroneous creation of "out of bounds" processes.
|
paulb@58 | 98 | * Added a removed attribute on the Exchange to record which channels were
|
paulb@58 | 99 | removed in the last call to the ready method.
|
paulb@55 | 100 |
|
paulb@48 | 101 | New in parallel 0.2.1 (Changes since parallel 0.2)
|
paulb@48 | 102 | --------------------------------------------------
|
paulb@48 | 103 |
|
paulb@48 | 104 | * Added a PyGmy raytracer example.
|
paulb@53 | 105 | * Updated copyright and licensing details (FSF address, additional works).
|
paulb@48 | 106 |
|
paulb@40 | 107 | New in parallel 0.2 (Changes since parallel 0.1)
|
paulb@40 | 108 | ------------------------------------------------
|
paulb@40 | 109 |
|
paulb@40 | 110 | * Changed the name of the included module from parallel to pprocess in order
|
paulb@40 | 111 | to avoid naming conflicts with PyParallel.
|
paulb@40 | 112 |
|
paulb@22 | 113 | Release Procedures
|
paulb@22 | 114 | ------------------
|
paulb@22 | 115 |
|
paulb@40 | 116 | Update the pprocess __version__ attribute.
|
paulb@22 | 117 | Change the version number and package filename/directory in the documentation.
|
paulb@22 | 118 | Update the release notes (see above).
|
paulb@22 | 119 | Check the release information in the PKG-INFO file.
|
paulb@22 | 120 | Tag, export.
|
paulb@22 | 121 | Archive, upload.
|
paulb@68 | 122 | Update PyPI.
|
paulb@26 | 123 |
|
paulb@26 | 124 | Making Packages
|
paulb@26 | 125 | ---------------
|
paulb@26 | 126 |
|
paulb@44 | 127 | To make Debian-based packages:
|
paulb@26 | 128 |
|
paulb@44 | 129 | 1. Create new package directories under packages if necessary.
|
paulb@26 | 130 | 2. Make a symbolic link in the distribution's root directory to keep the
|
paulb@26 | 131 | Debian tools happy:
|
paulb@26 | 132 |
|
paulb@44 | 133 | ln -s packages/ubuntu-hoary/python2.4-parallel-pprocess/debian/
|
paulb@26 | 134 |
|
paulb@26 | 135 | 3. Run the package builder:
|
paulb@26 | 136 |
|
paulb@26 | 137 | dpkg-buildpackage -rfakeroot
|
paulb@26 | 138 |
|
paulb@26 | 139 | 4. Locate and tidy up the packages in the parent directory of the
|
paulb@26 | 140 | distribution's root directory.
|