where does one run the following:
import torch.multiprocessing
torch.multiprocessing.set_sharing_strategy('file_system')

suppose to be ran by every process or only the main one?
Traceback (most recent call last):
  File "/var/spool/pbs/mom_priv/jobs/486213.iam-pbs.SC", line 321, in <module>
    main_distributed()
  File "/var/spool/pbs/mom_priv/jobs/486213.iam-pbs.SC", line 239, in main_distributed
    mp.spawn(fn=parallel_train, args=(opts,), nprocs=opts.world_size)
  File "/homes/miranda9/.conda/envs/automl-meta-learning/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 199, in spawn
    return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
  File "/homes/miranda9/.conda/envs/automl-meta-learning/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 148, in start_processes
    process.start()
  File "/homes/miranda9/.conda/envs/automl-meta-learning/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/homes/miranda9/.conda/envs/automl-meta-learning/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
    return Popen(process_obj)
  File "/homes/miranda9/.conda/envs/automl-meta-learning/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/homes/miranda9/.conda/envs/automl-meta-learning/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/homes/miranda9/.conda/envs/automl-meta-learning/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 58, in _launch
    self.pid = util.spawnv_passfds(spawn.get_executable(),
  File "/homes/miranda9/.conda/envs/automl-meta-learning/lib/python3.8/multiprocessing/util.py", line 427, in spawnv_passfds
    errpipe_read, errpipe_write = os.pipe()
OSError: [Errno 24] Too many open files


ref:

Too many open files error · Issue #11201 · pytorch/pytorch · GitHub 8
Multiprocessing package - torch.multiprocessing — PyTorch 1.7.1 documentation 6
python - How does one setup the set_sharing_strategy strategy for multiprocessing in Pytorch? - Stack Overflow 9