Repository navigation
Set $SYSTEMNAME in machine-specific environment file #73
Copy link
Copy link
Closed
Description
Address this TODO item in default.2025.env:
Lines 12 to 29 in b8d5689
| # TODO: Deducing which environment file maps to a machine relies on | |
| # partial string match, which makes surgically-precise SYSTEMNAME | |
| # introspection unnecessary. A substring match allows for simple | |
| # and robust solution, e.g. `MACHINE=$(hostname)` already works 99% | |
| # of the time (other 1% comes from intentionally obfuscated hostnames) | |
| # | |
| # HPC admins know best so perhaps it's better to let them handle | |
| # SYSTEMNAME setting on their respective environment file. Saving the | |
| # machine name to a dummy variable is sufficient. | |
| # | |
| # Set SYSTEMNAME if not yet set | |
| if [ -z "${SYSTEMNAME}" ]; then | |
| if [ $(command -v sinfo) ]; then | |
| export SYSTEMNAME=$(scontrol show config | grep ClusterName | awk -F= '{ print $2 }' | xargs) | |
| else | |
| export SYSTEMNAME=$(hostname | awk -F. '{ for(i=1;i<=NF;i++) if(!match($i, /[0-9]$/)) { print $i; break }; if(i==NF+1) { print $1 } }') | |
| fi | |
| fi |
Lines 31 to 46 in b8d5689
| # Map machine to environment file by detecting a | |
| # unique signature from the machine name. | |
| known_machine="true" | |
| env_dir=$(dirname $(realpath ${BASH_SOURCE:-$0})) | |
| if [[ $SYSTEMNAME == *"jedi"* || $SYSTEMNAME == *"jupiter"* ]]; then | |
| export TSMP2_ENV_FILE=${env_dir}/jsc.2025.gnu.openmpi | |
| elif [[ $SYSTEMNAME == *"jureca"* || $SYSTEMNAME == *"juwels"* || $SYSTEMNAME == *"jusuf"* ]]; then | |
| export TSMP2_ENV_FILE=${env_dir}/jsc.2025.intel.psmpi | |
| elif [[ $SYSTEMNAME == *"marvin"* ]]; then | |
| export TSMP2_ENV_FILE=${env_dir}/uni-bonn.gnu.openmpi | |
| elif [[ $SYSTEMNAME == *"UBUNTU"* ]]; then | |
| export TSMP2_ENV_FILE=${env_dir}/ubuntu.gnu.openmpi | |
| else | |
| echo "WARNING: Unknown default environment for machine '$(hostname)'" | |
| known_machine="false" | |
| fi |
Metadata
Metadata
Assignees
Labels
No labels
Activity
mvhulten commentedon Nov 26, 2025
I think this is long addressed as best as possible in
env/default.2025.env (22)(and below that line overwritten—above code—for certainty) and this issue can be closed.