-
Notifications
You must be signed in to change notification settings - Fork 27
/
cluster.py
143 lines (112 loc) · 3.74 KB
/
cluster.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
133
134
135
136
137
138
139
140
141
142
143
from .deploy import JobHandler,Directives,ClusterSpecs
import astropy.units as u
########################################################
###########Job scheduler specs##########################
########################################################
_SLURMspecs = {
"directive_prefix" : "#SBATCH",
"job_name_switch" : "-J ",
"stdout_switch" : "-o ",
"stderr_switch" : "-e ",
"num_cores_switch" : "-n ",
"num_nodes_switch" : "-N ",
"tasks_per_node_switch" : None,
"queue_type_switch" : "-p ",
"wallclock_time_switch" : "-t ",
"user_email_switch" : "--mail-user=",
"user_email_type" : "--mail-type=all",
}
_PBSspecs = {
"directive_prefix" : "#PBS",
"job_name_switch" : "-N ",
"stdout_switch" : "-o ",
"stderr_switch" : "-e ",
"num_cores_switch" : "-l mppwidth=",
"num_nodes_switch" : None,
"tasks_per_node_switch" : "-lmppnppn=",
"queue_type_switch" : "-q ",
"wallclock_time_switch" : "-l walltime=",
"user_email_switch" : "-M ",
"user_email_type" : "-m abe",
}
########################################################
###########Cluster specs################################
########################################################
_StampedeClusterSpecs = {
"shell_prefix" : "#!/bin/bash",
"execution_preamble" : None,
"charge_account_switch" : "-A ",
"job_starter" : "ibrun",
"cores_per_node" : 16,
"memory_per_node" : 32.0*u.Gbyte,
"cores_at_execution_switch" : "-n ",
"offset_switch" : "-o ",
"wait_switch" : "wait",
"multiple_executables_on_node" : True
}
_EdisonClusterSpecs = {
"shell_prefix" : "#!/bin/bash -l",
"execution_preamble" : None,
"charge_account_switch" : None,
"job_starter" : "srun",
"cores_per_node" : 24,
"memory_per_node" : 64.0*u.Gbyte,
"cores_at_execution_switch" : "-n ",
"offset_switch" : "-N ",
"wait_switch" : "wait",
"multiple_executables_on_node" : False
}
_CoriClusterSpecs = {
"shell_prefix" : "#!/bin/bash -l",
"execution_preamble" : None,
"charge_account_switch" : None,
"job_starter" : "srun",
"cores_per_node" : 32,
"memory_per_node" : 128.0*u.Gbyte,
"cores_at_execution_switch" : "-n ",
"offset_switch" : "-N ",
"wait_switch" : "wait",
"multiple_executables_on_node" : False
}
########################################################
###########StampedeHandler class########################
########################################################
class StampedeHandler(JobHandler):
"""
Job handler for the TACC Stampede cluster
"""
#############################################
######Abstract method definitions############
#############################################
def setDirectives(self):
self._directives = Directives(**_SLURMspecs)
def setClusterSpecs(self):
self._cluster_specs = ClusterSpecs(**_StampedeClusterSpecs)
########################################################
###########EdisonHandler class##########################
########################################################
class EdisonHandler(JobHandler):
"""
Job handler for the NERSC Edison cluster
"""
#############################################
######Abstract method definitions############
#############################################
def setDirectives(self):
self._directives = Directives(**_SLURMspecs)
def setClusterSpecs(self):
self._cluster_specs = ClusterSpecs(**_EdisonClusterSpecs)
######################################################
###########CoriHandler class##########################
######################################################
class CoriHandler(JobHandler):
"""
Job handler for the NERSC Cori Phase 1 cluster
"""
#############################################
######Abstract method definitions############
#############################################
def setDirectives(self):
self._directives = Directives(**_SLURMspecs)
def setClusterSpecs(self):
self._cluster_specs = ClusterSpecs(**_CoriClusterSpecs)