Permalink
Browse files

fixed R+Q/all: all now includes jobs flagged with W

  • Loading branch information...
1 parent b79945a commit 39af410eb2639feacb5ddf1655b41153f372fbdf @sfranky sfranky committed Jun 17, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 readstates.py
View
11 readstates.py
@@ -531,7 +531,7 @@ def MakeQstat(fin,fout):
#solution for counting R,Q,C attached to each user
-UserRunningDic, UserQueuedDic, UserCancelledDic = {}, {}, {}
+UserRunningDic, UserQueuedDic, UserCancelledDic, UserWaitingDic = {}, {}, {}, {}
for user,status in zip(UnixAccounts,Ss):
if status=='R':
@@ -540,10 +540,13 @@ def MakeQstat(fin,fout):
UserQueuedDic[user] = UserQueuedDic.get(user, 0) + 1
elif status=='C':
UserCancelledDic[user] = UserCancelledDic.get(user, 0) + 1
+ elif status=='W':
+ UserWaitingDic[user] = UserWaitingDic.get(user, 0) + 1
for account in UserRunningDic:
UserQueuedDic.setdefault(account, 0)
UserCancelledDic.setdefault(account, 0)
+ UserWaitingDic.setdefault(account, 0)
occurencedic={}
for user in UnixAccounts:
@@ -584,7 +587,7 @@ def MakeQstat(fin,fout):
MaxcorelstTmp=Maxcorelst[:] # ( ???? )
if wnpropertieslst == '?':
for cpuline in CpucoreDic:
- CpucoreDic[cpuline]+='?'
+ CpucoreDic[cpuline]+='_'
elif len(wnpropertieslst)==1:
for cpuline in CpucoreDic:
CpucoreDic[cpuline]+='_'
@@ -678,10 +681,12 @@ def MakeQstat(fin,fout):
UserQueuedDic[id]=0
if id not in UserCancelledDic:
UserCancelledDic[id]=0
+ if id not in UserWaitingDic:
+ UserWaitingDic[id]=0
for id in Usersortedlst:#IdOfUnixAccount:
- output.append([IdOfUnixAccount[id[0]], UserRunningDic[id[0]], UserQueuedDic[id[0]], UserCancelledDic[id[0]]+ UserRunningDic[id[0]]+ UserQueuedDic[id[0]], id])
+ output.append([IdOfUnixAccount[id[0]], UserRunningDic[id[0]], UserQueuedDic[id[0]], UserCancelledDic[id[0]]+ UserRunningDic[id[0]]+ UserQueuedDic[id[0]]+ UserWaitingDic[id[0]], id])
####### workaround, na brw veltistopoiisi
output.sort(key=itemgetter(3), reverse=True)
for line in output:

0 comments on commit 39af410

Please sign in to comment.