stat
QueueStatus
Bases: BaseModel
QueueStatus class based on Pydantic BaseModel.
Attributes:
Name | Type | Description |
---|---|---|
user |
str
|
User name. |
queue |
str
|
Queue name. |
watch |
bool
|
Whether to watch the queue. |
slurm |
bool
|
Check slurm queues |
sge |
bool
|
Check sge queues |
sgejoblist |
Dict[str, List[JobInfo]]
|
List of jobs. Keys are 'running' and 'pending'. |
table |
Table
|
rich.Table with job information. |
Source code in hpcman/queue/stat.py
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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
|
generate_table_view()
Generates a table view of the qstat output in one function.
Source code in hpcman/queue/stat.py
get_job_status_table()
Gets job status table from qstat -xml output.
Sets the table attribute.
Attributes:
Name | Type | Description |
---|---|---|
sgejoblist |
A sgejoblist returned by get_sge_job_list. |
|
table |
self.table is set in this method. |
Source code in hpcman/queue/stat.py
get_sge_job_list()
Get the list of job info from the qstat output.
Attributes:
Name | Type | Description |
---|---|---|
sgejoblist |
self.sgejoblist is a dictionary of job info and is set in this method. |
Source code in hpcman/queue/stat.py
get_sge_job_rows(types)
Generates rows of SGE jobs for table output printing.
Attributes:
Name | Type | Description |
---|---|---|
sgejoblist |
A sgejoblist returned by get_sge_job_list. |
Returns:
Name | Type | Description |
---|---|---|
jobs |
List[Dict[str, str]]
|
list of job outputs |
Source code in hpcman/queue/stat.py
get_slurm_job_list()
Get the list of job info from the squeue output.
Attributes:
Name | Type | Description |
---|---|---|
slurmjoblist |
self.slurmjoblist is a dictionary of job info and is set in this method. |
Source code in hpcman/queue/stat.py
get_slurm_job_rows(types)
Generates rows of SGE jobs for table output printing.
Attributes:
Name | Type | Description |
---|---|---|
sgejoblist |
A sgejoblist returned by get_sge_job_list. |
Returns:
Name | Type | Description |
---|---|---|
jobs |
List[Dict[str, str]]
|
list of job outputs |
Source code in hpcman/queue/stat.py
print_table(refresh=2)
Prints a rich.Table view of the qstat output.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
refresh |
int
|
Refresh rate for the rich.Table. Defaults to 2. |
2
|
Source code in hpcman/queue/stat.py
get_queue_list(user=environ['USER'])
Gets list of available queue names and returns the list
Source code in hpcman/queue/stat.py
run_qstat(cmd, queue=None, debug=False)
Runs qstat and returns a JobInfo result of parsed XML data
Source code in hpcman/queue/stat.py
run_queue_status(user, queue, debug, watch, slurm, sge, queuefilt=None)
Generates a QueueStatus object and prints a rich.Table view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user |
str
|
Username to search the queue status for. |
required |
queue |
Optional[str]
|
Queue to limit the search to. |
required |
debug |
bool
|
Useful for development. |
required |
watch |
bool
|
Refreshes the queue status every 2 seconds. |
required |
queuefilt |
Optional[List[str]]
|
Unused currently. Could be used to restrict the output. Defaults to None. |
None
|
Source code in hpcman/queue/stat.py
run_squeue(cmd, queue=None, debug=False)
Runs qstat and returns a list of job dicts