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 -h --hardware option #201

Merged

Conversation

stevebachmeier
Copy link
Contributor

Add -h/--hardware option to psimulate

Description

  • Category: implementation
  • JIRA issue: MIC-4756

Changes and notes

There are many ways to implement this -C flag including a simple
comma-separated list as well as boolean strings. I opted to have the
user provide a comma-separated list (e.g. psimulate --hardware r630,r650xs)
which then gets converted for the job template to -C "r630|r650xs". I figured
maybe one day we will want to get crazy with logic.

Testing

used psimulate test to confirm this is working.

import click

_RUNTIME_FORMAT = "hh:mm:ss"

# https://docs.cluster.ihme.washington.edu/#hpc-execution-host-hardware-specifications
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure of the best way to deal with the fact that the hardware changes. Alternatively we can not provide any constraints on what is passed in and leave it up to the user to "do their research"

hardware = value.split(",") if value else []
bad_requests = set(hardware) - set(_AVAILABLE_HARDWARE)
if bad_requests:
raise click.BadParameter(
Copy link
Contributor

Choose a reason for hiding this comment

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

Related to your above GitHub comment, do you think it would be useful to provide the URL in the code comment in the error message? (I see that's in the help already)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea

@stevebachmeier stevebachmeier merged commit 06f1796 into main Jan 5, 2024
6 checks passed
@stevebachmeier stevebachmeier deleted the feature/sbachmei/MIC-4756-hardware-request-option branch January 5, 2024 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants