Skip to content

Commit

Permalink
Use E3SM-Unified environment variable for machine
Browse files Browse the repository at this point in the history
If `E3SMU_MACHINE` has been set (e.g. by sourcing an E3SM-Unified
load script), use that as the `machine`.  This makes it possible
to detect the machine on compute nodes if you are using E3SM-Unified.
  • Loading branch information
xylar committed Sep 17, 2023
1 parent 1eeb96c commit fff6a54
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions zppy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,13 @@ def main(): # noqa: C901
pass

if ("machine" not in config["default"]) or (config["default"]["machine"] == ""):
# MachineInfo below will then call `discover_machine()`,
# which only works on log-in nodes.
machine = None
if "E3SMU_MACHINE" in os.environ:
# Use the machine identified by E3SM-Unified
machine = os.environ["E3SMU_MACHINE"]
else:
# MachineInfo below will then call `discover_machine()`,
# which only works on log-in nodes.
machine = None
else:
# If `machine` is set, then MachineInfo can bypass the
# `discover_machine()` function.
Expand Down

0 comments on commit fff6a54

Please sign in to comment.