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

Minor: Print filename when missing in distributed.py #4018

Merged
merged 3 commits into from
Sep 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm maybe we should only try-catch the subprocess.check_output section. That way we won't eat the FileNotFoundError from way down in the stack

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't have enough context to know what that means exactly... seeing as how it's not clear if anyone else has run into this, maybe I'll land this as is for now?

'SLURM does not appear to be installed. Missing file: ' + e.filename
)


def find_free_port() -> int:
Expand Down