is prange coming back?

13 views
Skip to first unread message

Tal Kaminker

unread,
Mar 26, 2015, 5:04:34 PM3/26/15
to numba...@continuum.io
Hi,
in numba 0.11 there was a prange function which allowed simple use of multithreading. In numba 0.17 I can't find it.
Is there gonna be some similar functionality in newer versions?
thanks.

m...@huntershome.org

unread,
May 28, 2015, 4:19:42 PM5/28/15
to numba...@continuum.io
Hi,

Is there any update on this? If it's gone for good, so be it: but has anyone considered resurrecting it? We'd love to switch from cython to numba but this is the one blocking feature...

Max

Stanley Seibert

unread,
May 28, 2015, 4:42:39 PM5/28/15
to Numba Public Discussion - Public
Now that we can release the GIL in nopython mode again, we can consider reimplementing this feature.  We don't have it on our immediate roadmap, but I've created an issue to track it:

https://github.com/numba/numba/issues/1193

--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To post to this group, send email to numba...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/numba-users/634a79d2-fff1-484b-96b0-57e9c011c312%40continuum.io.

kirchen...@googlemail.com

unread,
Jun 10, 2015, 5:25:53 PM6/10/15
to numba...@continuum.io
I just wanted to add, that we would also be very very very happy if this would be possible again.

Cheers,
Manuel

Leopold Haimberger

unread,
Jun 11, 2015, 1:15:30 AM6/11/15
to numba...@continuum.io
Hi,
I agree, that would be awesome. 
Performance differences between Numba and f2py or cython are mostly negligible as long as the code is serial.
However especially numerical algorithms can often be relatively easily parallelized openmp.
No problem with e.g. f2py but with Numba I am stuck here at the moment. Already implementing
the most basic features of openm such as. parallelizing loops with no reduction would help a lot.

Kind regards
Leo

rl...@lbl.gov

unread,
Jun 19, 2015, 12:57:26 PM6/19/15
to numba...@continuum.io
Hi,

I also agree that having prange available again would be tremendously useful.

In my case, my code uses multi-threading for part of the algorithm, by using libraries that do support multi-threading (e.g. pyfftw). However, the parts of the codes that don't use libraries but simply numba functions are still not multi-threaded, and they are now the real bottleneck. In theory though, they are parallelizable and thus having prange available would result in a large overall speedup for the code !

Also, in case prange would not be available in the near future, what would be the advised workaround for using multi-threading ? Is using the threads package + numba functions in nogil mode a viable option ? (I need to precise that I do need to perform reductions, in my case.)

Thanks for your help in advance,

Remi

PS : As a side note, I'd like to warmly thank all the Numba team for their great work ! I am now using Numba extensively, both on CPU and GPU, and it has made the development of production-suited code incredibly fast and easy.

Stanley Seibert

unread,
Jun 19, 2015, 1:15:42 PM6/19/15
to Numba Public Discussion - Public
For multithreading, we have an example in the Numba manual:


To echo the note in the manual: concurrent.futures is very nice if you are using Python 3.  It lets you apply a function (which you can write with Numba and pass the nogil=True option to @jit) to every element of an iterable.

Since we are on the topic of concurrency, I do want to remind people that the built-in random number generator in Numba is not currently thread-safe.  Everything else is should be fine, however.

--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To post to this group, send email to numba...@continuum.io.

rl...@lbl.gov

unread,
Jun 19, 2015, 1:44:38 PM6/19/15
to numba...@continuum.io
The example is quite clear, thanks.

As I understand it though, the reduction has to be done by hand, when using threading, while it used to be done automatically with prange. Is this correct ?

Thanks again,

Remi
Reply all
Reply to author
Forward
0 new messages