rbrewer123 / pycsp

Automatically exported from code.google.com/p/pycsp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The PyCSP project is an on-going project to bring CSP (Communicating Sequential Processes) to Python.

It was started in 2006 and is still under active development. Bug reports and suggestions for new features are most welcome.

News

( Updated 2013-02-14 ) Released PyCSP 0.9.0

( Updated 2013-02-13 ) Found a design flaw in AltSelect, which means that AltSelect does not guarantee priority when affected by network and scheduling latencies. A new PriSelect have been added which is slightly slower but does guarantee priority and thus should be used whenever the SkipGuard is needed.

( Updated 2013-01-21 ) Windows support has now been tested and should work, with a few differences when using @multiprocess. Getting closer to a release. Still a few minor tweaks and bugs left. Please use the latest version from svn. See below for instructions.

( Updated 2012-12-13 ) We are finally very close to releasing a new 0.9.0 version, which will provide a long list of new features. The project is considered stable on linux or MacOSX and we recommend that downloads are retrieved by fetching the latest trunk version using svn. Currently windows is not supported. We recommend using CPython 2.7.

The documentation on this website is updated to focus on the 0.9.0 PyCSP version.

wget http://pycsp.googlecode.com/files/pycsp-complete-0.9.0.tar.gz
tar -zxf pycsp-complete-0.9.0.tar.gz
cd pycsp-0.9.0
sudo python setup.py install

PyCSP Provides

  • A flexible CSP library for Python
  • Synchronous communication
  • Buffered channels
  • Multiple process types such as, greenlets, threads, processes and remote processes
  • Both input and output guards supported in external choice (Alts)
  • A single any-to-any channel type
  • Mobile channel-ends
  • Retire and poison signals for shutting down networks nicely
  • A channel which can communicate using inter-process communication as well as sockets.
  • A PyCSP providing local and distributed communication using only standard python modules bundled with CPython
  • NAT traversal
  • Tracing PyCSP executions to a log file, for later visualisation

Project Plan

  • Add visualisation of tracing information for hosts, when using distributed communication
  • Add Python3 support
  • Add ssh_process, qsub_process (PBS) and grid_process process types

Getting Started

The best way to get started on PyCSP is through the tutorials:

Documentation on all parts of PyCSP: Reference documentation

Example:

import sys

from pycsp.parallel import *

@process
def source(chan_out):
for i in range(10):
chan_out("Hello world (%d)\n" % (i))
retire(chan_out)

@process
def sink(chan_in):
while True:
sys.stdout.write(chan_in())

chan = Channel()
Parallel(
5 * source(-chan),
5 * sink(+chan)
)

shutdown()

Related publications

  • Friborg, Rune Møllegaard ; Vinter, Brian ; Bjørndalen, John Markus. PyCSP - controlled concurrency. International Journal of Information Processing and Management, Volume 1, Number 2, October 2010
  • Vinter, Brian ; Bjørndalen, John Markus ; Friborg, Rune Møllegaard. PyCSP Revisited. Communicating Process Architectures 2009 : WoTUG-32, Proceedings of the 32st WoTUG Technical Meeting (CPA-09). Eindhoven, The Netherlands.
  • Friborg, Rune Møllegaard ; Bjørndalen, John Markus ; Vinter, Brian. Three Unique Implementations of Processes for PyCSP. Communicating Process Architectures 2009 : WoTUG-32, Proceedings of the 32st WoTUG Technical Meeting (CPA-09). Eindhoven, The Netherlands.
  • Bjørndalen, John Markus ; Sampson, Adam T. Process-Oriented Collective Operations. Communicating Process Architectures 2008 : WoTUG-31, Proceedings of the 31st WoTUG Technical Meeting (CPA-08). York, UK.

About

Automatically exported from code.google.com/p/pycsp


Languages

Language:Python 98.3%Language:C 1.1%Language:Makefile 0.4%Language:Shell 0.1%Language:Batchfile 0.1%