Created
May 11, 2016 07:57
-
-
Save mfoll/a0338614a1f399878e387b96bf767e09 to your computer and use it in GitHub Desktop.
Summary of jobs launched by all users for LSF cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env Rscript | |
data=read.table(pipe("bjobs -u all -w | grep RUN | awk '{print $2\" \"$6}'"),stringsAsFactors = F,col.names = c("username","cpus")) | |
data[,2]=gsub("^cn.+$",1,data[,2]) | |
data[,2]=as.numeric(gsub("^(.+)\\*cn.+$","\\1",data[,2])) | |
res=aggregate(cpus ~ username, data, sum) | |
print(res[order(res$cpus,decreasing = T),],row.names = FALSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output example: