Re: [Numpy-discussion] numpy array sharing between processes? (and ctypes)

2007-05-15 Thread Albert Strasheim
Agreed. Could someone with wiki admin access please delete the Ctypes page and rename type Ctypes2 page to Ctypes? As far as I know, Ctypes2 is really what you want to look at (at least it was, last time I worked on it). Thanks. Cheers, Albert On Mon, 14 May 2007, Stefan van der Walt wrote:

Re: [Numpy-discussion] numpy array sharing between processes? (and ctypes)

2007-05-14 Thread Stefan van der Walt
On Mon, May 14, 2007 at 11:44:11AM -0700, Ray S wrote: > While investigating ctypes and numpy for sharing, I saw that the > example on > http://www.scipy.org/Cookbook/Ctypes#head-7def99d882618b52956c6334e08e085e297cb0c6 > does not quite work. However, with numpy.version.version=='1.0b1', > Active

Re: [Numpy-discussion] numpy array sharing between processes? (and ctypes)

2007-05-14 Thread Travis Oliphant
Ray S wrote: > print N.diag(x) > > Works for me... > > I can then do: > >>> import numpy.core.multiarray as MA > >>> xBuf = MA.getbuffer(x) > >>> z = MA.frombuffer(xBuf).reshape((3,3)) > I see this kind of importing used more often than it should be. It is dangerous to import directly fro

Re: [Numpy-discussion] numpy array sharing between processes? (and ctypes)

2007-05-14 Thread Ray S
While investigating ctypes and numpy for sharing, I saw that the example on http://www.scipy.org/Cookbook/Ctypes#head-7def99d882618b52956c6334e08e085e297cb0c6 does not quite work. However, with numpy.version.version=='1.0b1', ActivePython 2.4.3 Build 12: import numpy as N from ctypes import * x

Re: [Numpy-discussion] numpy array sharing between processes?

2007-05-12 Thread Charles R Harris
On 5/12/07, Andrew Straw <[EMAIL PROTECTED]> wrote: Charles R Harris wrote: > > I'll pitch in a few donuts (and my eternal gratitude) for an > example of > shared memory use using numpy arrays that is cross platform, or at > least > works in linux, mac, and windows. > > > I w

Re: [Numpy-discussion] numpy array sharing between processes?

2007-05-12 Thread Andrew Straw
Charles R Harris wrote: > > I'll pitch in a few donuts (and my eternal gratitude) for an > example of > shared memory use using numpy arrays that is cross platform, or at > least > works in linux, mac, and windows. > > > I wonder if you could mmap a file and use it as common mem

Re: [Numpy-discussion] numpy array sharing between processes?

2007-05-12 Thread Ray Schumacher
Andrew added: I'll pitch in a few donuts (and my eternal gratitude) for an example of shared memory use using numpy arrays that is cross platform, or at least  works in linux, mac, and windows. I thought that getting the address from the buffer() of the array and creating a new one from it in th

Re: [Numpy-discussion] numpy array sharing between processes?

2007-05-12 Thread Charles R Harris
On 5/12/07, Andrew Straw <[EMAIL PROTECTED]> wrote: Ray Schumacher wrote: > > After Googling for examples on this, in the Cookbook > http://www.scipy.org/Cookbook/Multithreading > MPI and POSH (dead?), I don't think I know the answer... > We have a data collection app running on dual core proces

Re: [Numpy-discussion] numpy array sharing between processes?

2007-05-12 Thread Andrew Straw
Ray Schumacher wrote: > > After Googling for examples on this, in the Cookbook > http://www.scipy.org/Cookbook/Multithreading > MPI and POSH (dead?), I don't think I know the answer... > We have a data collection app running on dual core processors; I start > one thread collecting/writing new data

[Numpy-discussion] numpy array sharing between processes?

2007-05-12 Thread Ray Schumacher
After Googling for examples on this, in the Cookbook http://www.scipy.org/Cookbook/Multithreading MPI and POSH (dead?), I don't think I know the answer... We have a data collection app running on dual core processors; I start one thread collecting/writing new data directly into a numpy circular