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:
| System | ISAMBARD_HOST value |
|---|---|
| Isambard-AI Phase 1 | I-AI_P1 |
| Isambard-AI Phase 2 | I-AI_P2 |
| Isambard 3 (Grace) | I3 |
| Isambard 3 MACS | I3MACS |
For example, from the command line:
Or, in Python: