Re: [Numpy-discussion] Numpy and OpenMP

2008-03-19 Thread David Cournapeau
Charles R Harris wrote: > > > Image processing may be a special in that many cases it is almost > embarrassingly parallel. Perhaps some special libraries for that sort > of application could be put together and just bits of c code be run on > different processors. Not that I know much about para

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-17 Thread Robert Kern
On Mon, Mar 17, 2008 at 6:03 PM, Gnata Xavier <[EMAIL PROTECTED]> wrote: > Ok fine. Fine but in a few months quadcores will be "cheap". Using > numpy, I now I never get the best performances on a multicores machine > and I do not care. I just get the best > performance/time_needed_to_code_that

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-17 Thread Gnata Xavier
Charles R Harris wrote: > > > On Mon, Mar 17, 2008 at 1:59 PM, Gnata Xavier <[EMAIL PROTECTED] > > wrote: > > Francesc Altet wrote: > > A Monday 17 March 2008, Christopher Barker escrigué: > > > >>> > Plus a certain amount of numpy code depends on order o

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-17 Thread Charles R Harris
On Mon, Mar 17, 2008 at 1:59 PM, Gnata Xavier <[EMAIL PROTECTED]> wrote: > Francesc Altet wrote: > > A Monday 17 March 2008, Christopher Barker escrigué: > > > >>> > Plus a certain amount of numpy code depends on order of > >>> > evaluation: > >>> > > >>> > a[:-1] = 2*a[1:] > >>> > >> I'm conf

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-17 Thread Gnata Xavier
Francesc Altet wrote: > A Monday 17 March 2008, Christopher Barker escrigué: > >>> > Plus a certain amount of numpy code depends on order of >>> > evaluation: >>> > >>> > a[:-1] = 2*a[1:] >>> >> I'm confused here. My understanding of how it now works is that the >> above translates to

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-17 Thread Francesc Altet
A Monday 17 March 2008, Christopher Barker escrigué: > > > Plus a certain amount of numpy code depends on order of > > > evaluation: > > > > > > a[:-1] = 2*a[1:] > > I'm confused here. My understanding of how it now works is that the > above translates to: > > 1) create a new array (call it tem

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-17 Thread Robert Kern
On Mon, Mar 17, 2008 at 12:06 PM, Christopher Barker <[EMAIL PROTECTED]> wrote: > > > Plus a certain amount of numpy code depends on order of > > > evaluation: > > > > > > a[:-1] = 2*a[1:] > > I'm confused here. My understanding of how it now works is that the > above translates to: > > 1

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-17 Thread Christopher Barker
> > Plus a certain amount of numpy code depends on order of > > evaluation: > > > > a[:-1] = 2*a[1:] I'm confused here. My understanding of how it now works is that the above translates to: 1) create a new array (call it temp1) from a[1:], which shares a's data block. 2) create a temp2 arra

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-15 Thread Robert Kern
On Sat, Mar 15, 2008 at 8:25 PM, Damian Eads <[EMAIL PROTECTED]> wrote: > Robert: what benchmarks were performed showing less than pleasing > performance gains? The implementation is in the multicore branch. This particular file is the main benchmark Eric was using. http://svn.scipy.org/svn/num

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-15 Thread Damian Eads
I am forwarding a response from one of my colleagues, Edward Rosten. Edward Rosten writes: Anne Archibald wrote: > On 15/03/2008, Damian Eads <[EMAIL PROTECTED]> wrote: > > Robert Kern wrote: > > > Eric Jones tried to use multithreading to split the computation > > > of ufuncs across CPUs. U

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-15 Thread Damian Eads
Anne, Sure. I've found multi-threaded scientific computation to give mixed results. For some things, it results in very significant performance gains, and other things, it's not worth the trouble at all. It really does depend on what you're doing. But, I don't think it's fair to paint multithr

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-15 Thread Gnata Xavier
Scott Ransom wrote: > On Sat, Mar 15, 2008 at 07:33:51PM -0400, Anne Archibald wrote: > >> ... >> To answer the OP's question, there is a relatively small number of C >> inner loops that could be marked up with OpenMP #pragmas to cover most >> matrix operations. Matrix linear algebra is a separa

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-15 Thread Scott Ransom
On Sat, Mar 15, 2008 at 07:33:51PM -0400, Anne Archibald wrote: > ... > To answer the OP's question, there is a relatively small number of C > inner loops that could be marked up with OpenMP #pragmas to cover most > matrix operations. Matrix linear algebra is a separate question, since > numpy/scip

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-15 Thread Anne Archibald
On 15/03/2008, Damian Eads <[EMAIL PROTECTED]> wrote: > Robert Kern wrote: > > Eric Jones tried to use multithreading to split the computation of > > ufuncs across CPUs. Ultimately, the overhead of locking and unlocking > > made it prohibitive for medium-sized arrays and only somewhat > > disap

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-15 Thread Damian Eads
Robert Kern wrote: > On Sat, Mar 15, 2008 at 2:48 PM, Gnata Xavier <[EMAIL PROTECTED]> wrote: >> Hi, >> >> Numpy is great : I can see several IDL/matlab projects switching to numpy :) >> However, it would be s nice to be able to put some OpenMP into the >> numpy code. >> >> It would be nice

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-15 Thread Gnata Xavier
Robert Kern wrote: On Sat, Mar 15, 2008 at 2:48 PM, Gnata Xavier <[EMAIL PROTECTED]> wrote: Hi, Numpy is great : I can see several IDL/matlab projects switching to numpy :) However, it would be s nice to be able to put some OpenMP into the numpy code. It would be nice to be able to

Re: [Numpy-discussion] Numpy and OpenMP

2008-03-15 Thread Robert Kern
On Sat, Mar 15, 2008 at 2:48 PM, Gnata Xavier <[EMAIL PROTECTED]> wrote: > Hi, > > Numpy is great : I can see several IDL/matlab projects switching to numpy :) > However, it would be s nice to be able to put some OpenMP into the > numpy code. > > It would be nice to be able to be able to us

[Numpy-discussion] Numpy and OpenMP

2008-03-15 Thread Gnata Xavier
Hi, Numpy is great : I can see several IDL/matlab projects switching to numpy :) However, it would be s nice to be able to put some OpenMP into the numpy code. It would be nice to be able to be able to use several CPU using the numpy syntax ie A=sqrt(B). Ok, we can use some inline C/C++ co