Skip to content

Environment variables

Detecting the system environment

The userenv module sets an environment variable, ISAMBARD_HOST, by default. This allows you to programmatically detect which system your code is running on.

ISAMBARD_HOST is set to one of the following values:

  • Isambard 3
  • Isambard 3 MACS
  • Isambard AI P1/P2

For example, from the command line:

$ env | grep ISAMBARD
ISAMBARD_HOST=I-AI_P2

Or, in Python:

import os

host = os.getenv("ISAMBARD_HOST", "Unknown System")
print(f"Running on: {host}")