[Numpy-discussion] numpy.test() errors r6862

Nils Wagner nwagner@iam.uni-stuttgart...
Mon Apr 13 02:56:42 CDT 2009


On Sun, 12 Apr 2009 12:56:46 -0600
  Charles R Harris <charlesr.harris@gmail.com> wrote:
> On Sun, Apr 12, 2009 at 12:52 PM, Charles R Harris <
> charlesr.harris@gmail.com> wrote:
> 
>>
>>
>> On Sun, Apr 12, 2009 at 12:17 PM, Nils Wagner <
>> nwagner@iam.uni-stuttgart.de> wrote:
>>
>>> ======================================================================
>>> ERROR: test suite
>>> ----------------------------------------------------------------------
>>> Traceback (most recent call last):
>>>   File
>>>
>>> "/home/nwagner/local/lib64/python2.6/site-packages/nose-0.10.4-py2.6.egg/nose/suite.py",
>>> line 154, in run
>>>     self.setUp()
>>>   File
>>>
>>> "/home/nwagner/local/lib64/python2.6/site-packages/nose-0.10.4-py2.6.egg/nose/suite.py",
>>> line 180, in setUp
>>>     if not self:
>>>   File
>>>
>>> "/home/nwagner/local/lib64/python2.6/site-packages/nose-0.10.4-py2.6.egg/nose/suite.py",
>>> line 65, in __nonzero__
>>>     test = self.test_generator.next()
>>>   File
>>>
>>> "/home/nwagner/local/lib64/python2.6/site-packages/nose-0.10.4-py2.6.egg/nose/loader.py",
>>> line 221, in generate
>>>     for test in g():
>>>   File
>>>
>>> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/lib/tests/test_format.py",
>>> line 440, in test_memmap_roundtrip
>>>     shape=arr.shape, fortran_order=fortran_order)
>>>   File
>>> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/lib/format.py",
>>> line 484, in open_memmap
>>>     mode=mode, offset=offset)
>>>   File
>>> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/core/memmap.py",
>>> line 231, in __new__
>>>     mm = mmap.mmap(fid.fileno(), bytes, access=acc,
>>> offset=offset)
>>> error: [Errno 22] Invalid argument
>>>
>>> ======================================================================
>>> ERROR: test_mmap (test_io.TestSaveLoad)
>>> ----------------------------------------------------------------------
>>> Traceback (most recent call last):
>>>   File
>>>
>>> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/testing/decorators.py",
>>> line 169, in knownfailer
>>>     return f(*args, **kwargs)
>>>   File
>>>
>>> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/lib/tests/test_io.py",
>>> line 92, in test_mmap
>>>     self.roundtrip(a, file_on_disk=True,
>>> load_kwds={'mmap_mode': 'r'})
>>>   File
>>>
>>> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/lib/tests/test_io.py",
>>> line 100, in roundtrip
>>>     RoundtripTest.roundtrip(self, np.save, *args,
>>> **kwargs)
>>>   File
>>>
>>> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/lib/tests/test_io.py",
>>> line 67, in roundtrip
>>>     arr_reloaded = np.load(load_file, **load_kwds)
>>>   File
>>> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/lib/io.py",
>>> line 193, in load
>>>     return format.open_memmap(file, mode=mmap_mode)
>>>   File
>>> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/lib/format.py",
>>> line 484, in open_memmap
>>>     mode=mode, offset=offset)
>>>   File
>>> "/home/nwagner/local/lib64/python2.6/site-packages/numpy/core/memmap.py",
>>> line 231, in __new__
>>>     mm = mmap.mmap(fid.fileno(), bytes, access=acc,
>>> offset=offset)
>>> error: [Errno 22] Invalid argument
>>>
>>> ----------------------------------------------------------------------
>>> Ran 1889 tests in 12.656s
>>>
>>> FAILED (KNOWNFAIL=1, errors=2)
>>>
>>
>> Hmm, I'll guess that the problem is this:
>>
>> *offset* must be a multiple of the 
>>ALLOCATIONGRANULARITY.
>>
>> This conflicts with the current intent of offset. Looks 
>>like we need to fix
>> up the patch to use the  nearest multiple of 
>>ALLOCATIONGRANULARITY and then
>> offset the usual way. Or, since ALLOCATIONGRANULARITY is 
>>likely to be
>> platform dependent, maybe we should just revert the 
>>patch.
>>
> 
> Can you import mmap, then do a dir(mmap) and see if 
> ALLOCATIONGRANULARITY
> is available?
> 
> TIA,
> 
> Chuck

Hi Chuck,

>>> import mmap
>>> dir (mmap)
['ACCESS_COPY', 'ACCESS_READ', 'ACCESS_WRITE', 
'ALLOCATIONGRANULARITY', 'MAP_ANON', 'MAP_ANONYMOUS', 
'MAP_DENYWRITE', 'MAP_EXECUTABLE', 'MAP_PRIVATE', 
'MAP_SHARED', 'PAGESIZE', 'PROT_EXEC', 'PROT_READ', 
'PROT_WRITE', '__doc__', '__file__', '__name__', 
'__package__', 'error', 'mmap']


All tests pass with '1.4.0.dev6864'. Thank you very much.

Cheers,
             Nils


More information about the Numpy-discussion mailing list