33 |
else: |
else: |
34 |
cmdstr = 'qstat -f' |
cmdstr = 'qstat -f' |
35 |
(stat, qstatout) = commands.getstatusoutput(cmdstr) |
(stat, qstatout) = commands.getstatusoutput(cmdstr) |
36 |
|
if stat: |
37 |
|
print 'problem getting qstat output; cmd used was', cmdstr |
38 |
|
print 'returned status ', stat, ', text: ', qstatout |
39 |
from torque_utils import pbsnodes |
from torque_utils import pbsnodes |
40 |
cpucount = 0 |
cpucount = 0 |
41 |
jobcount = 0 |
jobcount = 0 |
52 |
|
|
53 |
keyvalpat = re.compile(r' (\S+) = (.*)') |
keyvalpat = re.compile(r' (\S+) = (.*)') |
54 |
|
|
55 |
verbose_job_info=string.split(qstatout,"\n\n") |
# guard against empty or nonconforming qstat output |
56 |
|
if len(qstatout) == 0: |
57 |
|
verbose_job_info = [] # assume valid output for system with no jobs running! |
58 |
|
elif qstatout.find('Job Id') != 0: |
59 |
|
print 'fatal error, qstat output starts with something other than a job id' |
60 |
|
print 'first few characters are:', qstatout[:min(32,len(qstatout))] |
61 |
|
sys.exit(4) |
62 |
|
else: |
63 |
|
verbose_job_info=string.split(qstatout,"\n\n") |
64 |
|
|
65 |
for j in verbose_job_info: |
for j in verbose_job_info: |
66 |
newj = Job() |
newj = Job() |
67 |
lines = string.split(j,'\n ') |
lines = string.split(j,'\n ') |