Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hostlist expand as alternative to scontrol #2092

Merged
merged 6 commits into from
Jul 3, 2021

Conversation

sdesrozis
Copy link
Contributor

Fixes #2051

Description:

Add an alternative to scontrol for expanding hostname list used by SLURM.

hostnames = expand_hostlist("quartz[4-8]")
print(hostnames)

> ['quartz4', 'quartz5', 'quartz6', 'quartz7', 'quartz8']

Based on https://github.com/LLNL/py-hostlist

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@github-actions github-actions bot added module: distributed Distributed module module: utils Utils module labels Jun 30, 2021
@sdesrozis sdesrozis requested review from vfdev-5, trsvchn and fco-dv July 1, 2021 20:58
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

@sdesrozis thanks for the PR

ignite/utils.py Outdated
@@ -271,3 +272,70 @@ def wrapper(*args: Any, **kwargs: Dict[str, Any]) -> Callable:
return cast(F, wrapper)

return decorator


def expand_hostlist(nodelist: str) -> List[str]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if we need this in ignite.utils and as a public method. Let's keep it near in ignite/distributed/comp_models/native.py and as a private method...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok 👍🏻

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Thanks @sdesrozis !

@vfdev-5 vfdev-5 enabled auto-merge (squash) July 3, 2021 07:47
@vfdev-5 vfdev-5 merged commit 18dab7c into pytorch:master Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: distributed Distributed module module: utils Utils module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alternative to the command scontrol
2 participants