Re: [Numpy-discussion] [SciPy-Dev] ANN: Scipy 0.15.0 beta 1 release
On Tue, Nov 25, 2014 at 7:07 PM, Sturla Molden
Nathaniel Smith
wrote: On Tue, Nov 25, 2014 at 12:53 PM, David Cournapeau
wrote: Shall we consider https://github.com/scipy/scipy/issues/4168 to be a blocker (the issue arises on scipy master as well as 0.14.1) ?
Do you think there's anything scipy can do about it? It looks like a pure numpy bug to me.
I think we should assume it is not a bug in NumPy. There is nothing that dictates that an ndarray's buffer must be aligned. It can just as well be an unaligned view or wrap an external buffer. An ndarray is valud with any alignment, but it does not mean it can be used with intent(inout) in f2py.
Then by deduction if it is not a NumPy bug it must be a SciPy bug, which means the bug must be the unprotected use of intent(inout) in the f2py wrapper. I would think it is the responsibility of SciPy to ensure that whatever is passed with intent(inout) in SciPy is properly aligned.
In general you have a point, but in this case the reason the array is "unaligned" is that numpy is being overly strict about its definition of "aligned". In fact, it's so strict that numpy itself doesn't provide any standard and reliable way to *create* an aligned array by this definition. (I guess scipy could create an overallocated copy and then take a slice at the right offset, but asking scipy to use such hacks to work around our bugs is clearly wrong.) -n -- Nathaniel J. Smith Postdoctoral researcher - Informatics - University of Edinburgh http://vorpus.org
25.11.2014, 21:14, Nathaniel Smith kirjoitti: [clip]
(I guess scipy could create an overallocated copy and then take a slice at the right offset, but asking scipy to use such hacks to work around our bugs is clearly wrong.)
Note that the issue is not just with Scipy, but with *all* f2py code that is out there. Everyone who uses "double complex, intent(inout)" in their f2py wrapped code will start getting random exceptions on Windows. Users of "double complex, intent(in)" pay a performance penalty. -- Pauli Virtanen
participants (2)
-
Nathaniel Smith
-
Pauli Virtanen