change scratch_dir, threads use one dir