forked from ahijevyc/MPASSIT
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdetect_machine.sh
More file actions
executable file
·98 lines (84 loc) · 2.73 KB
/
Copy pathdetect_machine.sh
File metadata and controls
executable file
·98 lines (84 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env bash
# First detect w/ hostname
export MACHINE
if [[ "${MACHINE:-''}" == "hostgeneric" ]]; then
return 0
fi
case $(hostname -f) in
adecflow0[12].acorn.wcoss2.ncep.noaa.gov) MACHINE=acorn ;; ### acorn
alogin0[12].acorn.wcoss2.ncep.noaa.gov) MACHINE=acorn ;; ### acorn
clogin0[1-9].cactus.wcoss2.ncep.noaa.gov) MACHINE=wcoss2 ;; ### cactus01-9
clogin10.cactus.wcoss2.ncep.noaa.gov) MACHINE=wcoss2 ;; ### cactus10
dlogin0[1-9].dogwood.wcoss2.ncep.noaa.gov) MACHINE=wcoss2 ;; ### dogwood01-9
dlogin10.dogwood.wcoss2.ncep.noaa.gov) MACHINE=wcoss2 ;; ### dogwood10
gaea|gaea5[1-8]) MACHINE=gaeac5 ;;
gaea6[1-8]) MACHINE=gaeac6 ;;
gaea.ncrc.gov|gaea5[1-8].ncrc.gov) MACHINE=gaeac5 ;;
gaea6[1-8].ncrc.gov) MACHINE=gaeac6 ;;
hfe0[1-9]) MACHINE=hera ;; ### hera01-09
hfe1[0-2]) MACHINE=hera ;; ### hera10-12
hecflow01) MACHINE=hera ;; ### heraecflow01
ufe*) MACHINE=ursa ;;
u01*) MACHINE=ursa ;;
uecflow01) MACHINE=ursa ;;
derecho*) MACHINE=derecho ;;
s4-submit.ssec.wisc.edu) MACHINE=s4 ;; ### s4
fe[1-8]) MACHINE=jet ;; ### jet01-8
tfe[12]) MACHINE=jet ;; ### tjet1-2
orion*|Orion*) MACHINE=orion ;;
hercules*|Hercules*) MACHINE=hercules ;;
login[1-4].stampede2.tacc.utexas.edu) MACHINE=stampede ;; ### stampede1-4
login0[1-2].expanse.sdsc.edu) MACHINE=expanse ;; ### expanse1-2
discover3[1-5].prv.cube) MACHINE=discover ;; ### discover31-35
*) MACHINE=UNKNOWN ;; # Unknown platform
esac
if [[ ${MACHINE} == "UNKNOWN" ]]; then
case ${PW_CSP:-} in
"aws" | "google" | "azure") MACHINE=noaacloud ;;
*) PW_CSP="UNKNOWN"
esac
fi
# If MACHINE is still UNKNOWN,
# Try searching based on paths since hostname may not match on compute nodes
if [[ "${MACHINE}" == "UNKNOWN" ]]; then
if [[ -d /lfs/h3 ]]; then
# We are on NOAA Cactus or Dogwood
MACHINE=wcoss2
elif [[ -d /lfs/h1 && ! -d /lfs/h3 ]]; then
# We are on NOAA TDS Acorn
MACHINE=acorn
elif [[ -d /mnt/lfs5 ]]; then
# We are on NOAA Jet
MACHINE=jet
elif [[ -d /scratch3 ]]; then
if [[ -d /apps/slurm_hera ]]; then
# We are on Hera
MACHINE=hera
else
# We are on Ursa
MACHINE=ursa
fi
elif [[ -d /glade/derecho ]]; then
# We are on Derecho
MACHINE=derecho
elif [[ -d /work ]]; then
# We are on MSU Orion or Hercules
if [[ -d /apps/etc ]]; then
# We are on Hercules
MACHINE=hercules
else
MACHINE=orion
fi
elif [[ -d /gpfs/f5 && -d /ncrc ]]; then
# We are on GAEA C5
MACHINE=gaeac5
elif [[ -d /gpfs/f6 && -d /ncrc ]]; then
# We are on GAEA C6
MACHINE=gaeac6
elif [[ -d /data/prod ]]; then
# We are on SSEC's S4
MACHINE=s4
else
echo WARNING: UNKNOWN PLATFORM 1>&2
fi
fi