[SciPy-dev] f2py and ATLAS crashing bug
Pauli Virtanen
pav+sp at iki.fi
Mon Nov 9 04:19:43 EST 2009
Hi,
Sun, 08 Nov 2009 18:42:56 -0500, Anne Archibald wrote:
> I am still trying to fix the bug where non-aligned matrices can cause
> ATLAS to segfault, and I think I need to improve my understanding of
> f2py somewhat.
>
> First of all, I'll note that the bug appears in several routines (eig,
> svd, qr, rq, hessenberg, and schur that I have found so far) but only
> when the overwrite_a flag is passed in. So I tried to determine how
> overwrite_a is used in these routines, and I am puzzled. The python
> routines appear to pass it unmodified to the FORTRAN routines. The .pyf
> files mention it in the python call signatures, but nowhere else; from
> the f2py files it looks like it should be ignored. But clearly it has
> some effect, since it allows crashes.
[clip]
You can probably get more insight by looking at what f2py generates from
the .pyf files:
build/src.linux-i686-2.6/build/src.linux-i686-2.6/scipy/linalg
/flapackmodule.c:
capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
So, overwrite_a seems to turn copying the array off. Now the question is
then why intent(align8) doesn't help: looking at
build/src.linux-i686-2.6/fortranobject.c:array_from_pyobj
it seems that it always forces a copy of misaligned arrays -- but taking
a look with gdb could be useful to verify this... Maybe there's a bug?
(BTW, did you rm -rf build/ after adding the align8 directives -- there's
so much autogeneration going on there that it might be possible that
something is not updating correctly.)
--
Pauli Virtanen
More information about the SciPy-Dev
mailing list