[SciPy-user] shared memory machines

Robert Kern robert.kern@gmail....
Tue Feb 10 17:24:37 CST 2009


On Tue, Feb 10, 2009 at 17:13, Gael Varoquaux
<gael.varoquaux@normalesup.org> wrote:
> 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

I believe that was the error I kept running into when I was futzing
around with this.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the SciPy-user mailing list