[AstroPy] Plan to port astropy to python3?

Matthew Turk matthewturk at gmail.com
Tue Jun 7 12:01:48 EDT 2011


Hi Matt,

It's not clear yet how well the new, improved global interpreter lock
(which was improved in Python 3.2) will perform.  David Beazley has
done a number of studies of how it performs.  This is the most recent
one I could find:

http://dabeaz.blogspot.com/2010/02/revisiting-thread-priorities-and-new.html

There are interesting things going on in the Cython space, including
threading, "nogil" and OpenMP directives.  Cython is already agnostic
to 2.x versus 3.x, as well, so any extensions written in Cython should
be fine.  For process-based parallelism, mpi4py is written largely if
not completely in Cython and optimistically it will either work as is
or will be portable soon.

On the front of porting to 3.x, I spent some time porting the package
I work on (yt) to 3.0; it has a number of both hand-coded C extensions
as well as Cython-based extensions, and overall I found the experience
very straightforward.  The 2to3 tool worked as advertised, and
modifications to hand-coded C extensions such as registering functions
in the module definition, registering types and creating modules were
all relatively simple to modify.  To keep a 2- and 3-compatible, the C
extensions have to be peppered with #ifdefs, but otherwise I didn't
find it to be too big of a hassle.

-Matt

On Tue, Jun 7, 2011 at 8:52 AM, Matt Davis <mrdavis at stsci.edu> wrote:
> Python 3 is adding some new concurrency tools, something Erik brought up in
> a local list a while ago. To quote Erik:
> Python 3.2 added a new package called 'concurrent' that has an even
> higher-level API built on top of the threading, multiprocessing, and other
> related modules.  See:
> http://docs.python.org/dev/whatsnew/3.2.html#pep-3148-the-concurrent-futures-module
>
> http://docs.python.org/dev/library/concurrent.futures.html#module-concurrent.futures
> - Matt
>
> On Jun 7, 2011, at 11:39 AM, Perry Greenfield wrote:
>
> On Jun 7, 2011, at 11:22 AM, Bridgman, William T. wrote:
>
> This is the first I've heard that my main components of interest are
>
> ALL working on Python 3.
>
> Which means I will probably try a test installation of Python 3 on one
>
> of my systems this summer.
>
> I want to make more use of threading on multi-core systems since
>
> graphical rendering is a lot of 'embarrassingly parallel' type
>
> processing.
>
> http://en.wikipedia.org/wiki/Embarrassingly_parallel
>
> Tom
>
> Threading in Python won't necessarily exploit multi-core systems very
> well. You may want to look at other alternatives in Python.
>
> Perry
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
>



More information about the AstroPy mailing list