Parallel processing

Jon jhujsak at neotopica.com
Wed Nov 17 20:06:56 EST 2004


Josiah Carlson <jcarlson at uci.edu> wrote in message news:<mailman.6501.1100717187.5135.python-list at python.org>...
> bearophileHUGS at lycos.com (bearophile) wrote:
> > 
> > Hello, this is a small tutorial page about NESL, an easy parallel
> > programming language:
> > http://www-2.cs.cmu.edu/~scandal/nesl/tutorial2.html
> > 
> > Its syntax shares some similarities with python one, for example:
> > 
> > function factorial(n) =
> >   if (n <= 1) then 1
> >   else n*factorial(n-1);
> > 
> > {factorial(i) : i in [3, 1, 7]};
> > 
> > This computes "in parallel, for each i in the sequence [3, 1, 7],
> > factorial i"
> > 
> > 
> > {sum(a) : a in [[2,3], [8,3,9], [7]]};
> > 
> > sum of sequences is already a parallel operation, so this is a nested
> > parallelism example.
> 
> The look of a language has nothing to do with its parallelizability.  It
> just so happens that the designers of NESL had a similar language design
> ideas as the designers of Python.
> 
> 
> > So it seems to me that Python can be already fit to be interpreted in
> > parallel, for multicore CPUs, Playstation Cell-like processors, etc.
> > (few things have to be changed/added in the syntax to make it fit for
> > parallelism).
> 
> There are various other reasons why Python is not as parallelizable as
> you would think.  Among them is the semantics of scoping, and whether
> there is shared or unshared scope among the processors/nodes.  If shared,
> then any operation that could change scopes would need to be distributed
> (ick), or if unshared, then you are basically looking at an
> automatically distributed tuplespace (LINDA).  It gets even uglier with
> certain kinds of generators.
> 
> Regardless of which one is the case, heavy modifications to Python would
> necessarily need to be done in order to make them happen.
> 
> 
>  - Josiah

Even considering the above caveats, one can still employ Python based
interpretive layers such as pyMPI over quite solid parallel computing
tools such as MPI. See http://pympi.sourceforge.net/.

--Jon



More information about the Python-list mailing list