我想在Planetlab节点中的 Planetlab 节点上运行脚本,许多用户共享同一台计算机,每个用户都分配了一个切片我有一个 root,但我认为这是该脚本的有限 root 特权
#!/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 /dev/shm
仍然存在相同的错误是否可以在planetlab节点切片中解决此类问题?谢谢!