标签: RawArray

  • 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~