我想在Planetlab节点上运行脚本 在Planetlab节点中,许多用户共享同一台计算机 并为每个用户分配一个切片 我有一个根,但我认为这是一个有限的根特权 对于这个脚本
#!/usr/bin/env python
import multiprocessing
import time
def func(msg):
print msg
time.sleep(20)
print 'finish '+str(msg)
if __name__ == "__main__":
pool = multiprocessing.Pool(processes=100)
for i in xrange(20):
msg = "hello %d" %(i)
pool.apply_async(func, (msg, ))
time.sleep(5)
pool.close()
pool.join()
print "Sub-process(es) done."
我收到以下错误
Traceback (most recent call last):
File "try.py", line 12, in <module>
pool = multiprocessing.Pool(processes=100)
File "/usr/lib/python2.6/multiprocessing/__init__.py", line 227, in Pool
return Pool(processes, initializer, initargs)
File "/usr/lib/python2.6/multiprocessing/pool.py", line 84, in __init__
self._setup_queues()
File "/usr/lib/python2.6/multiprocessing/pool.py", line 131, in _setup_queues
self._inqueue = SimpleQueue()
File "/usr/lib/python2.6/multiprocessing/queues.py", line 315, in __init__
self._rlock = Lock()
File "/usr/lib/python2.6/multiprocessing/synchronize.py", line 117, in __init__
SemLock.__init__(self, SEMAPHORE, 1, 1)
File "/usr/lib/python2.6/multiprocessing/synchronize.py", line 49, in __init__
sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 38] Function not implemented
来自谷歌,有人建议解决方案是:
Add to /etc/fstab mounting of /dev/shm command
1 tmpfs /dev/shm tmpfs defaults,noexec,nosuid 0 0
Mount all unmounted filesystems from /etc/fstab.
1 $ mount -a
但是我收到了错误: mount:权限被拒绝
我也尝试过:
mount /dev/shm
仍然是同样的错误 是否有可能在Planetlab节点切片中解决这类问题? 谢谢!