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