[SciPy-user] shared memory machines

Gael Varoquaux gael.varoquaux@normalesup....
Tue Feb 10 17:13:56 CST 2009


On Tue, Feb 10, 2009 at 02:23:09AM +0100, Sturla Molden wrote:
> Ok, the work is basically done :)

> What remains is testing/debugging and a setup script.

I did a setup script, and I had to change a few detail because Cython was
unhappy with the names of the modules (I suspect local imports happening
instead of absolute ones).

I had to add a __weakref__ attribute to the handle, to make it so that it
can be weakref'd.

Now I am stuck because shared memory allocation is not working. This
boils down to the following traceback:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    a = shmem.shared_zeros(10)
  File "ndarray.py", line 135, in shared_zeros
    arr = shared_empty(shape, dtype, order)
  File "ndarray.py", line 126, in shared_empty
    wrapper = heap.BufferWrapper(nbytes)
  File "array_heap.py", line 168, in __init__
    block = BufferWrapper._heap.malloc(size)
  File "array_heap.py", line 148, in malloc
    (arena, start, stop) = self._malloc(size)
  File "array_heap.py", line 70, in _malloc
    arena = Arena(length)
  File "array_heap.py", line 37, in __init__
    self.buffer = SharedMemoryBuffer(size)
  File "sharedmemory_sysv.pyx", line 170, in
sharedmemory_sysv.SharedMemoryBuffer.__init__ (sharedmemory_sysv.c:1400)
    raise OSError, "Failed to attach shared memory: permission denied"
OSError: Failed to attach shared memory: permission denied

Basically this means that the shmat on line 167 of sharedmemory_sysv.pyx
is failing. I don't really know why, but I suspect this might be
something stupid.

I need to go to bed now, and I probably won't have time to look at that
at all before thursday evening. Maybe I will be in luck	and someone more
clever than me will have time to look at that in the mean time :).

Cheers,

Gaël

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sharedmem.zip
Type: application/x-zip-compressed
Size: 14704 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20090211/984a4e74/attachment-0001.bin 


More information about the SciPy-user mailing list