Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Minor: Print filename when missing in distributed.py (#4018)
Browse files Browse the repository at this point in the history
* Minor: Print filename when missing in distributed.py

...when you have a script that potentially includes file operations (ex when opening a file to load data for a task), this piece of code will eat the filename if it's missing.

* pre commit lint
  • Loading branch information
moyapchen authored Sep 16, 2021
1 parent 94d04d0 commit ca9da73
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions parlai/utils/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,11 @@ def slurm_distributed_context(opt):
except subprocess.CalledProcessError as e:
# scontrol failed
raise e
except FileNotFoundError:
except FileNotFoundError as e:
# Slurm is not installed
raise RuntimeError('SLURM does not appear to be installed.')
raise RuntimeError(
'SLURM does not appear to be installed. Missing file: ' + e.filename
)


def find_free_port() -> int:
Expand Down

0 comments on commit ca9da73

Please sign in to comment.