@@ -76,9 +76,12 @@ def set_smts(self, smts: int) -> None:
76
76
77
77
:param smts: SMT (e.g on Summit: 1, 2, or 4)
78
78
:raises TypeError: if not an int
79
+ :raises ValueError: if not positive int
79
80
"""
80
81
if not isinstance (smts , int ):
81
82
raise TypeError ("smts argument was not of type int" )
83
+ if smts <= 0 :
84
+ raise ValueError ("smts must be a positive value" )
82
85
self .set ("alloc_flags" , str (smts ))
83
86
84
87
def set_project (self , project : str ) -> None :
@@ -112,9 +115,12 @@ def set_nodes(self, num_nodes: int) -> None:
112
115
113
116
:param nodes: number of nodes
114
117
:raises TypeError: if not an int
118
+ :raises ValueError: if not positive int
115
119
"""
116
120
if not isinstance (num_nodes , int ):
117
121
raise TypeError ("num_nodes argument was not of type int" )
122
+ if num_nodes <= 0 :
123
+ raise ValueError ("Number of nodes must be a positive value" )
118
124
self .set ("nnodes" , str (num_nodes ))
119
125
120
126
def set_hostlist (self , host_list : t .Union [str , t .List [str ]]) -> None :
@@ -139,9 +145,12 @@ def set_tasks(self, tasks: int) -> None:
139
145
140
146
:param tasks: number of tasks
141
147
:raises TypeError: if not an int
148
+ :raises ValueError: if not positive int
142
149
"""
143
150
if not isinstance (tasks , int ):
144
151
raise TypeError ("tasks argument was not of type int" )
152
+ if tasks <= 0 :
153
+ raise ValueError ("Number of tasks must be a positive value" )
145
154
self .set ("n" , str (tasks ))
146
155
147
156
def set_queue (self , queue : str ) -> None :
0 commit comments