Commit 5d01b229 authored by William Stonewall Monroe's avatar William Stonewall Monroe
Browse files

Initial commit

parents
This diff is collapsed.
#!/bin/sh
directoryToUse="/data/user/$USER/"
sacct -P -u $USER --starttime=2019-01-01 --format user,start,jobid,jobname,state,partition,maxrss,reqmem,reqcpus,node,nnodes,elapsed >> "$directoryToUse"userusage.txt
%% Cell type:code id: tags:
``` python
import numpy as np
import pandas as pd
import pandas_profiling
```
%% Cell type:code id: tags:
``` python
df = pd.read_csv('userusage.txt',delimiter='|')
```
%% Cell type:code id: tags:
``` python
df.head()
```
%%%% Output: execute_result
User Start JobID JobName State \
0 user 2019-01-06T22:00:21 2040834 _interactive COMPLETED
1 NaN 2019-01-06T22:00:21 2040834.batch batch COMPLETED
2 user 2019-01-07T16:15:21 2043373 Pipe_trim_galore COMPLETED
3 NaN 2019-01-07T16:15:21 2043373.batch batch COMPLETED
4 user 2019-01-07T16:15:21 2043374 Pipe_trim_galore COMPLETED
Partition MaxRSS ReqMem ReqCPUS NodeList NNodes Elapsed
0 medium NaN 10000Mc 1 c0088 1 16:04:23
1 NaN 1394528K 10000Mc 1 c0088 1 16:04:23
2 medium NaN 2000Mc 1 c0038 1 00:18:41
3 NaN 58592K 2000Mc 1 c0038 1 00:18:41
4 medium NaN 2000Mc 1 c0063 1 00:15:48
%% Cell type:code id: tags:
``` python
df[['jid','step']] = df.JobID.str.split(".",expand=True)
df.Partition.values
```
%%%% Output: execute_result
array(['medium', nan, 'medium', ..., 'medium', nan, nan], dtype=object)
%% Cell type:code id: tags:
``` python
batchDF=df.dropna(subset=["MaxRSS"])
userDF=df.dropna(subset=["User"])
for jid in df.jid.unique():
userDF['MaxRSS'][userDF['jid'] == jid]=batchDF['MaxRSS'][batchDF['jid'] == jid]
#print(userDF[userDF['jid'] == jid])
userDF.head()
```
%% Cell type:code id: tags:
``` python
```
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment