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 detection of Azure #307

Merged
merged 2 commits into from
Feb 28, 2023
Merged

Add detection of Azure #307

merged 2 commits into from
Feb 28, 2023

Conversation

mathomp4
Copy link
Member

This is an attempt to add detection of Azure machines in ESMA_cmake. It's a bit hacky1, but it does seem work on Azure, but I need to make sure I didn't just break NCCS, etc. So I'll keep draft for now.

Also, I don't have access to GCE at the moment but I'm guessing it'll be something similar following:

https://cloud.google.com/compute/docs/instances/detect-compute-engine

Footnotes

  1. I'm sure at some point I'll find the post on the @scivision blog that has nice elegant code for this sort of thing 😄

@mathomp4 mathomp4 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Feb 22, 2023
@mathomp4 mathomp4 self-assigned this Feb 22, 2023
@scivision
Copy link

scivision commented Feb 22, 2023

There's no cmake_minimum_required in this project, which is fine. You may be aware this file(DOWNLOAD ...) syntax without filename requires CMake >= 3.19.

At a high level, likewise to identify machines I typically use environment variables that the system owners set as a de facto standard they've decided. For machines like this where they provide an HTTP API instead, I think this kind of file(DOWNLOAD) query is a good approach. If it became necessary, you could regex the API response.

I think your approach of having this separate CMake module Git project that can be FetchContent'ed by many of your other CMake projects is a good one and suggested by expert CMake developers like Craig Scott.

In my own work with specialized systems like Cray that provide their own compiler frontend with multiple compiler backends, and for which institutions may have multiple large machines each with their own quirks and bugs over time, I have also made CMake modules that handle the quirks of each machine I know. There are a finite number of important machines as in your work. We can't tell the sysadmins what to do, but we can patch around per-machine quirks with CMake this way.

@mathomp4 mathomp4 marked this pull request as ready for review February 28, 2023 14:32
@mathomp4 mathomp4 requested a review from a team as a code owner February 28, 2023 14:32
@mathomp4 mathomp4 merged commit 8c3eae0 into develop Feb 28, 2023
@mathomp4 mathomp4 deleted the feature/mathomp4/add-azure-detect branch February 28, 2023 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants