[Numpy-discussion] Should object arrays have a buffer interface?

Andreas Klöckner lists at informa.tiker.net
Sun Dec 28 21:52:00 EST 2008


On Montag 29 Dezember 2008, Robert Kern wrote:
> On Sun, Dec 28, 2008 at 20:38, Andreas Klöckner <lists at informa.tiker.net> 
wrote:
> > On Montag 29 Dezember 2008, Robert Kern wrote:
> >> On Sun, Dec 28, 2008 at 19:23, Andreas Klöckner
> >> <lists at informa.tiker.net>
> >
> > wrote:
> >> > Hi all,
> >> >
> >> > I don't think PyObject pointers should be accessible via the buffer
> >> > interface. I'd throw an error, but maybe a (silenceable) warning would
> >> > do. Would have saved me some bug-hunting.
> >>
> >> Can you describe in more detail what problem it caused?
> >
> > Well, I'm a little bit embarrassed. :) But here goes.
> >
> > I have one-line MPI wrappers that build on Boost.MPI and Boost.Python.
> > They take a numpy array, obtain its buffer, and shove that into
> > Boost.MPI's isend().
>
> How do you communicate the dtype?

I don't. The app is a PDE solver, both ends are working at the same (known) 
precision. Passing an object array was completely wrong, but since my wrapper 
functions only deal with the buffer API, they couldn't really do the checking.

Andreas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20081228/77f6b2c3/attachment.sig>


More information about the NumPy-Discussion mailing list