Python multiprocessing RawArray no disk space, or very slow

It seems that Python writes to /tmp on linux base os when allocating python.multiprocessing.sharedctypes.RawArray. If the disk space on that path is not sufficient, “no disk space” error occurs.
The solution is to change the default TMPDIR environment, using one of below methods:

  • bash: export TMPDIR='/the/new/path'
  • bash: TMPDIR=/the/new/path python3 your_script.py
  • python: os.environ['TMPDIR']='/your/new/path'

By the way, using /dev/shm as the tmpdir enhances performance to me~


已发布

分类

来自

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据