# Too many open files error

**URL:** <http://hpc-community.unige.ch/t/too-many-open-files-error/3388>\
**Category:** HPC Technical\
**Created:** [March 22, 2024, 9:16am UTC](http://hpc-community.unige.ch/t/too-many-open-files-error/3388 "2024-03-22T09:16:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Debajyoti.Sengupta](http://hpc-community.unige.ch/letter_avatar_proxy/v4/letter/d/2acd7d/32.png) [@Debajyoti.Sengupta](http://hpc-community.unige.ch/u/Debajyoti.Sengupta)\
**Post date:** [March 22, 2024, 9:16am UTC](http://hpc-community.unige.ch/t/too-many-open-files-error/3388/1 "2024-03-22T09:16:57Z")

</div>

Hi I am trying to run an export job (involves pytorch) with the following job specifications

```auto
#!/bin/sh
#SBATCH --job-name=export
#SBATCH --cpus-per-task=12
#SBATCH --time=1:00:00
#SBATCH --partition=private-dpnc-gpu,shared-gpu
#SBATCH --output=/home/users/s/senguptd/UniGe/astro/skycurtains/logs/%A_%a.out
#SBATCH --chdir=/home/users/s/senguptd/UniGe/astro/skycurtains/
#SBATCH --mem=15GB
#SBATCH --gpus=1

```

I get the following error `Too many open files. Communication with the workers is no longer possible.` But this seems to happen only on certain nodes gpu023, gpu024, gpu038. This worked on gpu040 for instance. Is the number of cpu requests too high for the former nodes and I need to turn those down?

What I can confirm is that within the code there are no files that are opened outside of a context manager.  
Any help figuring this issue would be appreciated. If you require additional information, please let me know.

Thanks,  
Deb

---

<div class="post-metadata">

**Author:** ![Adrien.Albert](http://hpc-community.unige.ch/user_avatar/hpc-community.unige.ch/adrien.albert/32/188_2.png) [@Adrien.Albert](http://hpc-community.unige.ch/u/Adrien.Albert)\
**Post date:** [March 26, 2024, 5:44pm UTC](http://hpc-community.unige.ch/t/too-many-open-files-error/3388/2 "2024-03-26T17:44:24Z")

</div>

Hi @Debajyoti.Sengupta

This problem does not concern nodes or software, but shared storage. At the time you needed to open/read a file, there were “Too many files open” at the same time.

This behavior is often due to a user (or several users) whose jobs perform a lot of I/O.

Can you tell me which jobID is affected? I’ll check the logs for any matches that might explain your problems.

---

<div class="post-metadata">

**Author:** ![Yann.Sagon](http://hpc-community.unige.ch/user_avatar/hpc-community.unige.ch/yann.sagon/32/3_2.png) [@Yann.Sagon](http://hpc-community.unige.ch/u/Yann.Sagon)\
**Post date:** [March 27, 2024, 7:56am UTC](http://hpc-community.unige.ch/t/too-many-open-files-error/3388/3 "2024-03-27T07:56:44Z")

</div>

> [@Debajyoti.Sengupta](#):
>
> I get the following error `Too many open files. Communication with the workers is no longer possible.`

My 2 cents: this error seems to be a known output/issue from PyTorch [Too many open files error · Issue #11201 · pytorch/pytorch · GitHub](https://github.com/pytorch/pytorch/issues/11201) . As the `sbatch` you posted is incomplete, we don’t know which PyTorch you are running with what parameters. Please share that with us.
