[Numpy-discussion] ticket #551

Charles R Harris charlesr.harris@gmail....
Sat Apr 12 20:19:03 CDT 2008


On Sat, Apr 12, 2008 at 7:01 PM, Pauli Virtanen <pav@iki.fi> wrote:

> http://projects.scipy.org/scipy/numpy/ticket/551
>
> This ticket (milestone 1.0.5 critical) seems to occur because
> cblas_DGEMV in SSE2-enabled Atlas, at least the one shipped with
> Debian/Ubuntu, apparently requires that doubles are aligned on 8-byte
> boundaries in memory. If not, a segmentation fault ensues. When
> unpickling arrays, numpy uses data directly from a Python string, which
> is consistently not aligned on a 8-byte boundary => crash.
>
> [I'm quite sure this is the reason. There is a minimal testcase in
> comment 22 in the ticket is someone wants to confirm this.]
>
>    ***
>
> So should numpy try to work around this by reallocating the memory when
> unpickling, and forcibly aligning it as required by SSE2-Atlas?
>

My vote is for checking the alignment and reallocating if needed and sending
a ticket upstream. Pickling is probably not the preferred way to store large
arrays so a workaround is acceptable. I wonder if Python itself shouldn't be
allocating strings on 8 byte boundaries? Or maybe it is the unpickling
routine that could use fixing, maybe its reading into a large string and
using an offset not divisible by 8.

Have there been any problems with Atlas in other distributions?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080412/16daa284/attachment.html 


More information about the Numpy-discussion mailing list