-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster_info.py
executable file
·132 lines (102 loc) · 6.03 KB
/
cluster_info.py
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/env python
from os.path import expanduser,expandvars,basename
import subprocess
user_name = basename( expanduser('~') )
biox3_user_name = expandvars( '$BIOX3_USER_NAME' )
if biox3_user_name == '$BIOX3_USER_NAME': biox3_user_name = user_name
sherlock_user_name = expandvars( '$SHERLOCK_USER_NAME' )
if sherlock_user_name == '$SHERLOCK_USER_NAME': sherlock_user_name = user_name
comet_user_name = expandvars( '$COMET_USER_NAME' )
if not len(comet_user_name): comet_user_name = user_name
xsede_user_name = expandvars( '$XSEDE_USER_NAME' )
xsede_dir_number = expandvars( '$XSEDE_DIR_NUMBER' )
def cluster_check( cluster_in ):
clusterlist = [ 'syd','niau','seth','bes','hapy','apep','gebb','ptah','yah','isis','yah','maat','nut','fin','dig','biox2','biox2_scratch','biox3','biox3_scratch','vanlang_scratch','ade','ade.stanford.edu','steele','steele_scratch','tg-condor','tg-condor_scratch','abe','ncsa','abe_scratch','ade_scratch','vanlang','kwipapat','kwip','lovejoy','tsuname','lovejoy_scratch','backup','lonestar','ranger','lonestar_work','lonestar_scratch','trestles','stampede','stampede_scratch','sherlock', 'comet', 'sherlock','sherlock_scratch','sherlock_group','sherlock_scratch_group' ];
cluster = cluster_in
if cluster not in clusterlist:
print ('Hey, '+cluster+' is not a known cluster.')
cluster = 'unknown'
cluster_dir = ''
old_teragrid_user_name = 'dasr' # defunct
if cluster == 'biox2': cluster = 'biox2.stanford.edu'
if cluster == 'ade': cluster = '%[email protected]' % user_name
if cluster == 'steele': cluster = '%[email protected]' % old_teragrid_user_name
if cluster == 'tg-condor': cluster ='%[email protected]' % old_teragrid_user_name
if cluster == 'abe': cluster = '%[email protected]' % xsede_user_name
if cluster == 'ncsa': cluster ='%[email protected]' % xsede_user_name
if cluster == 'lonestar': cluster ='%[email protected]' % xsede_user_name
if cluster == 'trestles': cluster ='%[email protected]' % xsede_user_name
if cluster == 'ranger': cluster ='%[email protected]' % xsede_user_name
if cluster == 'backup':
cluster = ''
cluster_dir = '/Volumes/RhijuBackup/%s/' % user_name
if cluster == 'steele_scratch': # defunct
cluster = '[email protected]'
cluster_dir = '/scratch/scratch95/d/%s/' % old_teragrid_user_name
if cluster == 'stampede':
cluster = '%[email protected]' % xsede_user_name
cluster_dir = '/work/%s/%s/' % (xsede_dir_number, xsede_user_name)
if cluster == 'stampede_scratch':
cluster = '%[email protected]' % xsede_user_name
cluster_dir = '/scratch/%s/%s/' % (xsede_dir_number, xsede_user_name)
if cluster == 'lonestar_work':
cluster ='%[email protected]' % xsede_user_name
cluster_dir = '/work/%s/%s/' % (xsede_dir_number, xsede_user_name)
if cluster == 'lonestar_scratch':
cluster ='%[email protected]' % xsede_user_name
cluster_dir = '/scratch/%s/%s/' % (xsede_dir_number, xsede_user_name)
if cluster == 'tg-condor_scratch':
cluster = '[email protected]'
cluster_dir = '/scratch/scratch95/d/dasr/'
if cluster == 'biox2_scratch':
cluster = 'biox2.stanford.edu'
cluster_dir = '/scratch/users/%s/' % user_name
if cluster == 'biox3':
cluster = '%[email protected]' % biox3_user_name
cluster_dir = '/home/%s/' % biox3_user_name
if cluster == 'biox3_scratch':
cluster = '%[email protected]' % biox3_user_name
cluster_dir = '/scratch/users/%s/' % biox3_user_name
if cluster == 'sherlock':
cluster = '%[email protected]' % biox3_user_name
cluster_dir = '/home/users/%s/' % biox3_user_name
if cluster == 'sherlock_group':
cluster = '%[email protected]' % sherlock_user_name
cluster_dir = '/home/groups/rhiju/%s/' % sherlock_user_name
if cluster == 'sherlock_scratch':
cluster = '%[email protected]' % sherlock_user_name
cluster_dir = '/scratch/users/%s/' % sherlock_user_name
if cluster == 'sherlock_scratch_group':
cluster = '%[email protected]' % sherlock_user_name
cluster_dir = '/scratch/groups/rhiju/%s/' % sherlock_user_name
if cluster == 'ade_scratch':
cluster = 'ade.stanford.edu'
cluster_dir = '/scr/%s/' % user_name
if cluster == 'ade':
cluster = 'ade.stanford.edu'
cluster_dir = '/home/%s/' % user_name
if cluster == 'abe_scratch':
cluster = '%[email protected]' % xsede_user_name
cluster_dir = '/scratch/users/%s/' % xsede_user_name
if cluster == 'kwipapat': cluster = '[email protected]'
if cluster == 'kwip': cluster = '[email protected]'
if cluster == 'tsuname': cluster = '[email protected]'
if cluster == 'sherlock':
cluster = '%[email protected]' % sherlock_user_name
cluster_dir = '/home/%s/' % sherlock_user_name
if cluster == 'comet':
cluster = '%[email protected]' % comet_user_name
cluster_dir = '/home/%s/' % comet_user_name
return (cluster,cluster_dir)
def strip_home_dirname( clusterdir ):
clusterdir = clusterdir.replace('/Users/%s/' % user_name,'')
clusterdir = clusterdir.replace('Dropbox/','')
clusterdir = clusterdir.replace('LocalDataAnalysis/','')
clusterdir = clusterdir.replace('Library/CloudStorage/GoogleDrive-%[email protected]/My Drive/' % user_name,'')
clusterdir = clusterdir.replace('Library/CloudStorage/','')
clusterdir = clusterdir.replace('/scratch/users/%s/' % user_name,'')
clusterdir = clusterdir.replace('/work/%s/' % user_name,'')
clusterdir = clusterdir.replace('/home/%s/' % user_name,'')
clusterdir = clusterdir.replace('/home1/%s/%s/' % ( xsede_dir_number, xsede_user_name ),'')
clusterdir = clusterdir.replace('/work/%s/%s/' % (xsede_dir_number, xsede_user_name ),'')
return clusterdir