slurm-2sql.ipynb 73.8 KB
Newer Older
1
2
3
4
{
 "cells": [
  {
   "cell_type": "code",
5
   "execution_count": 163,
6
7
8
9
10
11
12
13
14
15
   "metadata": {},
   "outputs": [],
   "source": [
    "import sqlite3\n",
    "import slurm2sql\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
16
17
18
19
20
21
22
23
24
25
   "execution_count": 164,
   "metadata": {},
   "outputs": [],
   "source": [
    "db = sqlite3.connect('test.db')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 165,
26
27
28
29
30
31
32
33
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
34
     "execution_count": 165,
35
36
37
38
39
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
40
    "slurm2sql.slurm2sql(db, ['-S', '2020-03-23', '-a', '--allocations'])"
41
42
43
44
   ]
  },
  {
   "cell_type": "code",
45
   "execution_count": 166,
46
47
48
49
   "metadata": {},
   "outputs": [],
   "source": [
    "# For example, you can then convert to a dataframe:\n",
50
    "df = pd.read_sql('SELECT * FROM slurm', db)"
51
52
53
54
   ]
  },
  {
   "cell_type": "code",
55
   "execution_count": 191,
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
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>JobID</th>\n",
       "      <th>ArrayJobID</th>\n",
       "      <th>ArrayTaskID</th>\n",
       "      <th>JobStep</th>\n",
       "      <th>JobIDSlurm</th>\n",
       "      <th>JobName</th>\n",
       "      <th>User</th>\n",
       "      <th>Group</th>\n",
       "      <th>Account</th>\n",
       "      <th>State</th>\n",
       "      <th>...</th>\n",
       "      <th>MaxDiskReadTask</th>\n",
       "      <th>MaxDiskWrite</th>\n",
       "      <th>MaxDiskWriteNode</th>\n",
       "      <th>MaxDiskWriteTask</th>\n",
       "      <th>ReqGPUS</th>\n",
       "      <th>Comment</th>\n",
       "      <th>GPUMem</th>\n",
       "      <th>GPUEff</th>\n",
       "      <th>NGPU</th>\n",
99
       "      <th>Waiting</th>\n",
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3319116</td>\n",
       "      <td>3319116</td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>3319116_[43-45,47%5]</td>\n",
       "      <td>1mUD1MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>PENDING</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
117
       "      <td>None</td>\n",
118
119
120
121
122
123
124
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
125
       "      <td>NaN</td>\n",
126
127
128
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
129
       "      <td>3927208</td>\n",
130
       "      <td>3887451</td>\n",
131
       "      <td>40.0</td>\n",
132
       "      <td>None</td>\n",
133
       "      <td>3887451_40</td>\n",
134
135
136
137
138
139
140
       "      <td>100kCrC20MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>COMPLETED</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
141
       "      <td>None</td>\n",
142
143
144
145
146
147
148
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
149
       "      <td>1637537.0</td>\n",
150
151
152
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
153
       "      <td>3927209</td>\n",
154
       "      <td>3887451</td>\n",
155
156
157
158
       "      <td>41.0</td>\n",
       "      <td>None</td>\n",
       "      <td>3887451_41</td>\n",
       "      <td>100kCrC20MPa</td>\n",
159
       "      <td>gpekmezi</td>\n",
160
161
162
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>RUNNING</td>\n",
163
       "      <td>...</td>\n",
164
165
166
167
       "      <td></td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
168
169
170
171
172
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
173
       "      <td>1640894.0</td>\n",
174
175
176
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
       "      <td>4001705</td>\n",
       "      <td>4001705</td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>4001705</td>\n",
       "      <td>Tet4</td>\n",
       "      <td>akarimi</td>\n",
       "      <td>akarimi</td>\n",
       "      <td>akarimi</td>\n",
       "      <td>PENDING</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4010013</td>\n",
       "      <td>4010013</td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>4010013</td>\n",
       "      <td>rstudio</td>\n",
       "      <td>hb5924</td>\n",
       "      <td>hb5924</td>\n",
       "      <td>hb5924</td>\n",
       "      <td>PENDING</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 64 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     JobID  ArrayJobID  ArrayTaskID JobStep            JobIDSlurm  \\\n",
       "0  3319116     3319116          NaN    None  3319116_[43-45,47%5]   \n",
       "1  3927208     3887451         40.0    None            3887451_40   \n",
       "2  3927209     3887451         41.0    None            3887451_41   \n",
       "3  4001705     4001705          NaN    None               4001705   \n",
       "4  4010013     4010013          NaN    None               4010013   \n",
       "\n",
       "        JobName      User     Group   Account      State  ...  \\\n",
       "0      1mUD1MPa  gpekmezi  gpekmezi  gpekmezi    PENDING  ...   \n",
       "1  100kCrC20MPa  gpekmezi  gpekmezi  gpekmezi  COMPLETED  ...   \n",
       "2  100kCrC20MPa  gpekmezi  gpekmezi  gpekmezi    RUNNING  ...   \n",
       "3          Tet4   akarimi   akarimi   akarimi    PENDING  ...   \n",
       "4       rstudio    hb5924    hb5924    hb5924    PENDING  ...   \n",
       "\n",
       "   MaxDiskReadTask  MaxDiskWrite  MaxDiskWriteNode  MaxDiskWriteTask  ReqGPUS  \\\n",
       "0                           None                                          NaN   \n",
       "1                           None                                          NaN   \n",
       "2                           None                                          NaN   \n",
       "3                           None                                          NaN   \n",
       "4                           None                                          NaN   \n",
       "\n",
       "   Comment GPUMem GPUEff  NGPU    Waiting  \n",
       "0     None   None   None  None        NaN  \n",
       "1     None   None   None  None  1637537.0  \n",
       "2     None   None   None  None  1640894.0  \n",
       "3     None   None   None  None        NaN  \n",
       "4     None   None   None  None        NaN  \n",
       "\n",
       "[5 rows x 64 columns]"
      ]
     },
     "execution_count": 191,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dtype('float64')"
      ]
     },
     "execution_count": 168,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['Start'].dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['JobID', 'ArrayJobID', 'ArrayTaskID', 'JobStep', 'JobIDSlurm',\n",
       "       'JobName', 'User', 'Group', 'Account', 'State', 'Timelimit', 'Elapsed',\n",
       "       'Time', 'Submit', 'Start', 'End', 'Partition', 'ExitCodeRaw',\n",
       "       'ExitCode', 'ExitSignal', 'NodeList', 'Priority', 'ConsumedEnergy',\n",
       "       'ReqNodes', 'NNodes', 'AllocNodes', 'ReqGRES', 'NTasks', 'NCPUS',\n",
       "       'ReqCPUS', 'AllocCPUS', 'CPUTime', 'TotalCPU', 'UserCPU', 'SystemCPU',\n",
       "       'CPUEff', 'MinCPU', 'MinCPUNode', 'MinCPUTask', 'ReqMem', 'ReqMemType',\n",
       "       'ReqMemNode', 'ReqMemCPU', 'AveRSS', 'MaxRSS', 'MaxRSSNode',\n",
       "       'MaxRSSTask', 'MaxPages', 'MaxVMSize', 'MemEff', 'AveDiskRead',\n",
       "       'AveDiskWrite', 'MaxDiskRead', 'MaxDiskReadNode', 'MaxDiskReadTask',\n",
       "       'MaxDiskWrite', 'MaxDiskWriteNode', 'MaxDiskWriteTask', 'ReqGPUS',\n",
       "       'Comment', 'GPUMem', 'GPUEff', 'NGPU'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 169,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>JobID</th>\n",
       "      <th>ArrayJobID</th>\n",
       "      <th>ArrayTaskID</th>\n",
       "      <th>JobStep</th>\n",
       "      <th>JobIDSlurm</th>\n",
       "      <th>JobName</th>\n",
       "      <th>User</th>\n",
       "      <th>Group</th>\n",
       "      <th>Account</th>\n",
       "      <th>State</th>\n",
       "      <th>...</th>\n",
       "      <th>MaxDiskReadTask</th>\n",
       "      <th>MaxDiskWrite</th>\n",
       "      <th>MaxDiskWriteNode</th>\n",
       "      <th>MaxDiskWriteTask</th>\n",
       "      <th>ReqGPUS</th>\n",
       "      <th>Comment</th>\n",
       "      <th>GPUMem</th>\n",
       "      <th>GPUEff</th>\n",
       "      <th>NGPU</th>\n",
       "      <th>Waiting</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3319116</td>\n",
       "      <td>3319116</td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>3319116_[43-45,47%5]</td>\n",
       "      <td>1mUD1MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>PENDING</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
       "      <td>None</td>\n",
386
387
       "      <td></td>\n",
       "      <td></td>\n",
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3927208</td>\n",
       "      <td>3887451</td>\n",
       "      <td>40.0</td>\n",
       "      <td>None</td>\n",
       "      <td>3887451_40</td>\n",
       "      <td>100kCrC20MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
405
406
407
       "      <td>gpekmezi</td>\n",
       "      <td>COMPLETED</td>\n",
       "      <td>...</td>\n",
408
409
410
411
       "      <td></td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
412
413
414
415
416
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
417
       "      <td>1637537.0</td>\n",
418
419
       "    </tr>\n",
       "    <tr>\n",
420
421
       "      <th>2</th>\n",
       "      <td>3927209</td>\n",
422
       "      <td>3887451</td>\n",
423
       "      <td>41.0</td>\n",
424
       "      <td>None</td>\n",
425
       "      <td>3887451_41</td>\n",
426
427
428
429
       "      <td>100kCrC20MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
       "      <td>RUNNING</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>1640894.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4001705</td>\n",
       "      <td>4001705</td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>4001705</td>\n",
       "      <td>Tet4</td>\n",
       "      <td>akarimi</td>\n",
       "      <td>akarimi</td>\n",
       "      <td>akarimi</td>\n",
       "      <td>PENDING</td>\n",
455
456
       "      <td>...</td>\n",
       "      <td></td>\n",
457
458
       "      <td>None</td>\n",
       "      <td></td>\n",
459
460
       "      <td></td>\n",
       "      <td>NaN</td>\n",
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4010013</td>\n",
       "      <td>4010013</td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>4010013</td>\n",
       "      <td>rstudio</td>\n",
       "      <td>hb5924</td>\n",
       "      <td>hb5924</td>\n",
       "      <td>hb5924</td>\n",
       "      <td>PENDING</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
       "      <td>None</td>\n",
482
483
484
485
486
487
488
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
489
       "      <td>NaN</td>\n",
490
491
492
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
493
       "<p>5 rows × 64 columns</p>\n",
494
495
496
497
498
       "</div>"
      ],
      "text/plain": [
       "     JobID  ArrayJobID  ArrayTaskID JobStep            JobIDSlurm  \\\n",
       "0  3319116     3319116          NaN    None  3319116_[43-45,47%5]   \n",
499
500
501
502
       "1  3927208     3887451         40.0    None            3887451_40   \n",
       "2  3927209     3887451         41.0    None            3887451_41   \n",
       "3  4001705     4001705          NaN    None               4001705   \n",
       "4  4010013     4010013          NaN    None               4010013   \n",
503
504
505
506
       "\n",
       "        JobName      User     Group   Account      State  ...  \\\n",
       "0      1mUD1MPa  gpekmezi  gpekmezi  gpekmezi    PENDING  ...   \n",
       "1  100kCrC20MPa  gpekmezi  gpekmezi  gpekmezi  COMPLETED  ...   \n",
507
508
509
       "2  100kCrC20MPa  gpekmezi  gpekmezi  gpekmezi    RUNNING  ...   \n",
       "3          Tet4   akarimi   akarimi   akarimi    PENDING  ...   \n",
       "4       rstudio    hb5924    hb5924    hb5924    PENDING  ...   \n",
510
       "\n",
511
512
513
514
515
516
       "   MaxDiskReadTask  MaxDiskWrite  MaxDiskWriteNode  MaxDiskWriteTask  ReqGPUS  \\\n",
       "0                           None                                          NaN   \n",
       "1                           None                                          NaN   \n",
       "2                           None                                          NaN   \n",
       "3                           None                                          NaN   \n",
       "4                           None                                          NaN   \n",
517
       "\n",
518
519
520
521
522
523
       "   Comment GPUMem GPUEff  NGPU    Waiting  \n",
       "0     None   None   None  None        NaN  \n",
       "1     None   None   None  None  1637537.0  \n",
       "2     None   None   None  None  1640894.0  \n",
       "3     None   None   None  None        NaN  \n",
       "4     None   None   None  None        NaN  \n",
524
       "\n",
525
       "[5 rows x 64 columns]"
526
527
      ]
     },
528
     "execution_count": 170,
529
530
531
532
533
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
534
535
    "df['Waiting'] = df['Start']-df['Submit']\n",
    "df.head()"
536
537
538
539
   ]
  },
  {
   "cell_type": "code",
540
   "execution_count": 171,
541
542
   "metadata": {},
   "outputs": [],
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
   "source": [
    "waiting = df.dropna(subset=['Waiting'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "<ipython-input-172-41270eb2a9f8>:1: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  waiting['Waiting'] = waiting['Waiting']/60\n"
     ]
    }
   ],
   "source": [
    "waiting['Waiting'] = waiting['Waiting']/60"
   ]
568
  },
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
  {
   "cell_type": "code",
   "execution_count": 173,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>JobID</th>\n",
       "      <th>ArrayJobID</th>\n",
       "      <th>ArrayTaskID</th>\n",
       "      <th>JobStep</th>\n",
       "      <th>JobIDSlurm</th>\n",
       "      <th>JobName</th>\n",
       "      <th>User</th>\n",
       "      <th>Group</th>\n",
       "      <th>Account</th>\n",
       "      <th>State</th>\n",
       "      <th>...</th>\n",
       "      <th>MaxDiskReadTask</th>\n",
       "      <th>MaxDiskWrite</th>\n",
       "      <th>MaxDiskWriteNode</th>\n",
       "      <th>MaxDiskWriteTask</th>\n",
       "      <th>ReqGPUS</th>\n",
       "      <th>Comment</th>\n",
       "      <th>GPUMem</th>\n",
       "      <th>GPUEff</th>\n",
       "      <th>NGPU</th>\n",
       "      <th>Waiting</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3927208</td>\n",
       "      <td>3887451</td>\n",
       "      <td>40.0</td>\n",
       "      <td>None</td>\n",
       "      <td>3887451_40</td>\n",
       "      <td>100kCrC20MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>COMPLETED</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>27292.283333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3927209</td>\n",
       "      <td>3887451</td>\n",
       "      <td>41.0</td>\n",
       "      <td>None</td>\n",
       "      <td>3887451_41</td>\n",
       "      <td>100kCrC20MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>RUNNING</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>27348.233333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>4163556</td>\n",
       "      <td>4011732</td>\n",
       "      <td>50.0</td>\n",
       "      <td>None</td>\n",
       "      <td>4011732_50</td>\n",
       "      <td>1kDP200MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>TIMEOUT</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>5067.066667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4163609</td>\n",
       "      <td>4011732</td>\n",
       "      <td>52.0</td>\n",
       "      <td>None</td>\n",
       "      <td>4011732_52</td>\n",
       "      <td>1kDP200MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>TIMEOUT</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>5116.216667</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>4165565</td>\n",
       "      <td>4165565</td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>4165565</td>\n",
       "      <td>rora4001</td>\n",
       "      <td>songyw</td>\n",
       "      <td>songyw</td>\n",
       "      <td>songyw</td>\n",
       "      <td>TIMEOUT</td>\n",
       "      <td>...</td>\n",
       "      <td></td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>0.433333</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 64 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     JobID  ArrayJobID  ArrayTaskID JobStep  JobIDSlurm       JobName  \\\n",
       "1  3927208     3887451         40.0    None  3887451_40  100kCrC20MPa   \n",
       "2  3927209     3887451         41.0    None  3887451_41  100kCrC20MPa   \n",
       "5  4163556     4011732         50.0    None  4011732_50    1kDP200MPa   \n",
       "6  4163609     4011732         52.0    None  4011732_52    1kDP200MPa   \n",
       "7  4165565     4165565          NaN    None     4165565      rora4001   \n",
       "\n",
       "       User     Group   Account      State  ...  MaxDiskReadTask  \\\n",
       "1  gpekmezi  gpekmezi  gpekmezi  COMPLETED  ...                    \n",
       "2  gpekmezi  gpekmezi  gpekmezi    RUNNING  ...                    \n",
       "5  gpekmezi  gpekmezi  gpekmezi    TIMEOUT  ...                    \n",
       "6  gpekmezi  gpekmezi  gpekmezi    TIMEOUT  ...                    \n",
       "7    songyw    songyw    songyw    TIMEOUT  ...                    \n",
       "\n",
       "   MaxDiskWrite  MaxDiskWriteNode  MaxDiskWriteTask  ReqGPUS  Comment GPUMem  \\\n",
       "1          None                                          NaN     None   None   \n",
       "2          None                                          NaN     None   None   \n",
       "5          None                                          NaN     None   None   \n",
       "6          None                                          NaN     None   None   \n",
       "7          None                                          NaN     None   None   \n",
       "\n",
       "  GPUEff  NGPU       Waiting  \n",
       "1   None  None  27292.283333  \n",
       "2   None  None  27348.233333  \n",
       "5   None  None   5067.066667  \n",
       "6   None  None   5116.216667  \n",
       "7   None  None      0.433333  \n",
       "\n",
       "[5 rows x 64 columns]"
      ]
     },
     "execution_count": 173,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "waiting.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 174,
   "metadata": {},
   "outputs": [],
   "source": [
    "category = pd.cut(waiting['Waiting'],bins=[-1,1,5,15,60,120,200,500,1000,2000,12000000],labels=['<1min','<5min','<15min','<60min','<120min','<200min','<500min','<1000min','<2000min','>2000min'])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "metadata": {},
   "outputs": [],
   "source": [
    "waiting.insert(64,'wait_period_cat',category)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 176,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>JobID</th>\n",
       "      <th>ArrayJobID</th>\n",
       "      <th>ArrayTaskID</th>\n",
       "      <th>JobStep</th>\n",
       "      <th>JobIDSlurm</th>\n",
       "      <th>JobName</th>\n",
       "      <th>User</th>\n",
       "      <th>Group</th>\n",
       "      <th>Account</th>\n",
       "      <th>State</th>\n",
       "      <th>...</th>\n",
       "      <th>MaxDiskWrite</th>\n",
       "      <th>MaxDiskWriteNode</th>\n",
       "      <th>MaxDiskWriteTask</th>\n",
       "      <th>ReqGPUS</th>\n",
       "      <th>Comment</th>\n",
       "      <th>GPUMem</th>\n",
       "      <th>GPUEff</th>\n",
       "      <th>NGPU</th>\n",
       "      <th>Waiting</th>\n",
       "      <th>wait_period_cat</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3927208</td>\n",
       "      <td>3887451</td>\n",
       "      <td>40.0</td>\n",
       "      <td>None</td>\n",
       "      <td>3887451_40</td>\n",
       "      <td>100kCrC20MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>COMPLETED</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>27292.283333</td>\n",
       "      <td>&gt;2000min</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3927209</td>\n",
       "      <td>3887451</td>\n",
       "      <td>41.0</td>\n",
       "      <td>None</td>\n",
       "      <td>3887451_41</td>\n",
       "      <td>100kCrC20MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>RUNNING</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>27348.233333</td>\n",
       "      <td>&gt;2000min</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>4163556</td>\n",
       "      <td>4011732</td>\n",
       "      <td>50.0</td>\n",
       "      <td>None</td>\n",
       "      <td>4011732_50</td>\n",
       "      <td>1kDP200MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>TIMEOUT</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>5067.066667</td>\n",
       "      <td>&gt;2000min</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4163609</td>\n",
       "      <td>4011732</td>\n",
       "      <td>52.0</td>\n",
       "      <td>None</td>\n",
       "      <td>4011732_52</td>\n",
       "      <td>1kDP200MPa</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>gpekmezi</td>\n",
       "      <td>TIMEOUT</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>5116.216667</td>\n",
       "      <td>&gt;2000min</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>4165565</td>\n",
       "      <td>4165565</td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>4165565</td>\n",
       "      <td>rora4001</td>\n",
       "      <td>songyw</td>\n",
       "      <td>songyw</td>\n",
       "      <td>songyw</td>\n",
       "      <td>TIMEOUT</td>\n",
       "      <td>...</td>\n",
       "      <td>None</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>0.433333</td>\n",
       "      <td>&lt;1min</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 65 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     JobID  ArrayJobID  ArrayTaskID JobStep  JobIDSlurm       JobName  \\\n",
       "1  3927208     3887451         40.0    None  3887451_40  100kCrC20MPa   \n",
       "2  3927209     3887451         41.0    None  3887451_41  100kCrC20MPa   \n",
       "5  4163556     4011732         50.0    None  4011732_50    1kDP200MPa   \n",
       "6  4163609     4011732         52.0    None  4011732_52    1kDP200MPa   \n",
       "7  4165565     4165565          NaN    None     4165565      rora4001   \n",
       "\n",
       "       User     Group   Account      State  ...  MaxDiskWrite  \\\n",
       "1  gpekmezi  gpekmezi  gpekmezi  COMPLETED  ...          None   \n",
       "2  gpekmezi  gpekmezi  gpekmezi    RUNNING  ...          None   \n",
       "5  gpekmezi  gpekmezi  gpekmezi    TIMEOUT  ...          None   \n",
       "6  gpekmezi  gpekmezi  gpekmezi    TIMEOUT  ...          None   \n",
       "7    songyw    songyw    songyw    TIMEOUT  ...          None   \n",
       "\n",
       "   MaxDiskWriteNode  MaxDiskWriteTask  ReqGPUS  Comment  GPUMem GPUEff  NGPU  \\\n",
       "1                                          NaN     None    None   None  None   \n",
       "2                                          NaN     None    None   None  None   \n",
       "5                                          NaN     None    None   None  None   \n",
       "6                                          NaN     None    None   None  None   \n",
       "7                                          NaN     None    None   None  None   \n",
       "\n",
       "        Waiting  wait_period_cat  \n",
For faster browsing, not all history is shown. View entire blame