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 gpuId proc on locale #25943

Merged
merged 3 commits into from
Oct 1, 2024
Merged

Add gpuId proc on locale #25943

merged 3 commits into from
Oct 1, 2024

Conversation

stonea
Copy link
Contributor

@stonea stonea commented Sep 13, 2024

This PR adds a way to query gpuID (the location in the parent locale's here.gpus array) that a gpu locale is.

If used on a non gpu locale it will error out with this message:

Can not use 'gpuId' field on a non gpu locale

This should resolve #23650

TODO:

  • paratest
  • paratest nvidia

---
Signed-off-by: Andy Stone <[email protected]>
---
Signed-off-by: Andy Stone <[email protected]>
---
Signed-off-by: Andy Stone <[email protected]>
@stonea stonea self-assigned this Sep 13, 2024
halt("Can not use 'gpuId' field on a non gpu locale");
return -1;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

There's an unfortunate consequence of adding this here: they are not documented. I believe the locale documentation is in https://chapel-lang.org/docs/main/language/spec/locales.html#locale-methods, and it comes from the record _locale rather than this base implementation class, which is a forwarding field in the record. I believe Jade has recently mentioned that isGpu is also not documented. I believe the same applies for proc gpus.

This is not specific to this PR, and I think we can merge this as is, but could you open an issue about these methods that I think should be documented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stonea stonea merged commit ffa6df5 into chapel-lang:main Oct 1, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Querying sublocale ID with the GPU locale model
2 participants