[Numpy-discussion] "buffer not aligned on 8 byte boundary" errors when running numarray.testall.test()

Wendy Langer wlanger at bigpond.net.au
Thu Jul 8 10:29:01 CDT 2004


Hi there all :)

I am having trouble with my installation of numarray.  :(

I am a python newbie and a numarray extreme-newbie, so it could be that I
don't yet have the first clue what I am doing. ;)



Python 2.3.3 (#51, Feb 16 2004, 04:07:52) [MSC v.1200 32 bit (Intel)] on
win32
numarray 1.0


The Python I am using is the one that comes with the "Enthought" version
(www.enthought.com), a distro specifically designed to be useful for
scientists, so it comes with numerical stuff and scipy and chaco and things
like that preinstalled.

I used the windows binary installer. However it came with Numeric and not
numarray, so I installed numarray "by hand". This seemed to go ok, and it
seems that there is no problem having both Numeric and numarray in the same
installation, since they have (obviously) different names (still getting
used to this whole modules and namespaces &c &c)




At the bottom of this email I have pasted an example of what it was I was
trying to do, and the error messages that the interpreter gave me - but
before anyone bothers reading them in any detail, the essential error seems
to be as follows:

error: multiply_Float64_scalar_vector: buffer not aligned on 8 byte
boundary.


I have no idea what this means, but I do recall that when I ran the
numarray.testall.test() procedure after first completing my installation a
couple of days ago, it  reported a *lot* of problems, many of which sounded
quite similar to this.

I hoped for the best and  thought that perhaps I had "run the test wrong"(!)
since numarray seemed to be working ok, and I had investigated many of the
examples in chapters 3 and 4 of the user manual withour any obvious problems
(chapter 3 = "high level overview" and chapter 4 = "array basics")

I decided at the time to leave well enough alone until I actually came
across odd or mysterious behaviour ...however that time has come
all-too-soon...




The procedure I am using to run the test is as described on page 11 of the
excellent user's manual (release 0.8 at
http://www.pfdubois.com/numpy/numarray.pdf):


---------------------------------------------
Testing your Installation
Once you have installed numarray, test it with:
C:\numarray> python
Python 2.2.2 (#18, Dec 30 2002, 02:26:03) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import numarray.testall as testall
>>> testall.test()
numeric: (0, 1115)
records: (0, 48)
strings: (0, 166)
objects: (0, 72)
memmap: (0, 75)
Each line in the above output indicates that 0 of X tests failed. X grows
steadily with each release, so the numbers
shown above may not be current.
------------------------------------------------------------------------

Anyway, when I ran this, instead of the nice, comforting output above,  I
got about a million(!) errors and then a final count of 320 failures. This
number is not always constant - I recall the first time I ran it it was 209.
[I just ran it again and this time it was 324...it all has a rather
disturbing air of semi-randomness...]


So below is the (heavily snipped) output from the testall.test() run, and
below that is the code where I first noticed a possibly similar error, and
below *that*  is the output of that code, with the highly suspicous
error....


Any suggestions greatly appreciated!

I can give you more info about the setup on my computer and so on if you
need :)

wendy langer


======================================================================
<output when I ran numarray.testall.test() >
====================================

IDLE 1.0.2      ==== No Subprocess ====
>>> import numarray.testall as testall
>>> testall.test()
*****************************************************************
Failure in example: x+y
from line #50 of first pass
Exception raised:
Traceback (most recent call last):
  File "C:\PYTHON23\lib\doctest.py", line 442, in _run_examples_inner
    compileflags, 1) in globs
  File "<string>", line 1, in ?
  File "C:\PYTHON23\Lib\site-packages\numarray\numarraycore.py", line 733,
in __add__
    return ufunc.add(self, operand)
error: Int32asFloat64: buffer not aligned on 8 byte boundary.
*****************************************************************
Failure in example: x[:] = 0.1
from line #72 of first pass
Exception raised:
Traceback (most recent call last):
  File "C:\PYTHON23\lib\doctest.py", line 442, in _run_examples_inner
    compileflags, 1) in globs
  File "<string>", line 1, in ?
error: Float64asBool: buffer not aligned on 8 byte boundary.
*****************************************************************
Failure in example: y
from line #74 of first pass
Expected: array([ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.])
Got: array([ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.])
*****************************************************************
Failure in example: x + z
from line #141 of first pass
Exception raised:
Traceback (most recent call last):
  File "C:\PYTHON23\lib\doctest.py", line 442, in _run_examples_inner
    compileflags, 1) in globs
  File "<string>", line 1, in ?
  File "C:\PYTHON23\Lib\site-packages\numarray\numarraycore.py", line 733,
in __add__
    return ufunc.add(self, operand)
error: Int32asFloat64: buffer not aligned on 8 byte boundary.
*****************************************************************


<BIG SNIP!!!!!!!!!!!!>

<snip a lot more  errors>

*****************************************************************
Failure in example: a2dma = average(a2dm, axis=1)
from line #812 of numarray.ma.dtest
Exception raised:
Traceback (most recent call last):
  File "C:\PYTHON23\lib\doctest.py", line 442, in _run_examples_inner
    compileflags, 1) in globs
  File "<string>", line 1, in ?
  File "C:\PYTHON23\Lib\site-packages\numarray\ma\MA.py", line 1686, in
average
    w = Numeric.choose(mask, (1.0, 0.0))
  File "C:\PYTHON23\Lib\site-packages\numarray\ufunc.py", line 1666, in
choose
    return _choose(selector, population, outarr, clipmode)
  File "C:\PYTHON23\Lib\site-packages\numarray\ufunc.py", line 1573, in
__call__
    result = self._doit(computation_mode, woutarr, cfunc, ufargs, 0)
  File "C:\PYTHON23\Lib\site-packages\numarray\ufunc.py", line 1558, in
_doit
    blockingparameters)
error: choose8bytes: buffer not aligned on 8 byte boundary.
*****************************************************************
Failure in example: alltest(a2dma, [1.5, 4.0])
from line #813 of numarray.ma.dtest
Exception raised:
Traceback (most recent call last):
  File "C:\PYTHON23\lib\doctest.py", line 442, in _run_examples_inner
    compileflags, 1) in globs
  File "<string>", line 1, in ?
NameError: name 'a2dma' is not defined
*****************************************************************
1 items had failures:
 320 of 671 in numarray.ma.dtest
***Test Failed*** 320 failures.
numarray.ma:                            (320, 671)



</output when I ran numarray.testall.test() >

=========================================================================
<my code>
========================


import numarray

class anXmatrix:
    def __init__(self, stepsize = 3):
        self.stepsize = stepsize
        self.populate_matrix()


    def describe(self):
        print "I am a ", self.__class__
        print "my stepsize is", self.stepsize
        print "my matrix is: \n"
        print self.matrix

    def populate_matrix(self):

        def xvalues(i,j):
            return self.stepsize*j

        mx = numarray.fromfunction(xvalues, (4,4))
        self.matrix = mx


if __name__ == '__main__':


    print "      "
    print "Making anXmatrix..."
    r = anXmatrix(stepsize = 5)
    r.describe()
    r = anXmatrix(stepsize = 0.02)
    r.describe()

</my code>

============================================================================
========
<output from interpreter when I run my code>



Making anXmatrix...
I am a  __main__.anXmatrix
my stepsize is 5
my matrix is:

[[ 0  5 10 15]
 [ 0  5 10 15]
 [ 0  5 10 15]
 [ 0  5 10 15]]
Traceback (most recent call last):
  File
"C:\Python23\Lib\site-packages\WendyStuff\wendycode\propagatorstuff\core_obj
ects\domain_objects.py", line 97, in ?
    r = anXmatrix(stepsize = 0.02)
  File
"C:\Python23\Lib\site-packages\WendyStuff\wendycode\propagatorstuff\core_obj
ects\domain_objects.py", line 72, in __init__
    self.populate_matrix()
  File
"C:\Python23\Lib\site-packages\WendyStuff\wendycode\propagatorstuff\core_obj
ects\domain_objects.py", line 86, in populate_matrix
    mx = numarray.fromfunction(xvalues, (4,4))
  File "C:\PYTHON23\Lib\site-packages\numarray\generic.py", line 1094, in
fromfunction
    return apply(function, tuple(indices(dimensions)))
  File
"C:\Python23\Lib\site-packages\WendyStuff\wendycode\propagatorstuff\core_obj
ects\domain_objects.py", line 84, in xvalues
    return self.stepsize*j
  File "C:\PYTHON23\Lib\site-packages\numarray\numarraycore.py", line 772,
in __rmul__
    r = ufunc.multiply(operand, self)
error: multiply_Float64_scalar_vector: buffer not aligned on 8 byte
boundary.
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


</output from interpreter when I run my code>
============================================================================
========

"You see, wire telegraph is a kind of a very, very long cat. You pull his
tail in New York and his head is meowing in Los Angeles. Do you understand
this? And radio operates exactly the same way: you send signals here, they
receive them there. The only difference is that there is no cat."  Albert
Einstein






More information about the Numpy-discussion mailing list