Commit 77ba4736 authored by Joubert, Wayne's avatar Joubert, Wayne
Browse files

Minor adjustments.

parent 8fcb13c8
......@@ -71,9 +71,11 @@ def main():
# W - job is waiting for its execution time (-a option) to be reached.
# S - (Unicos only) job is suspend.
#
running_jobs_tag = 'R'
running_job_tag = 'R'
waiting_job_tag = 'Q'
job_counts = {}
job_counts.setdefault(running_jobs_tag, 0)
job_counts.setdefault(running_job_tag, 0)
job_counts.setdefault(waiting_job_tag, 0)
total_job_count = 0
process = Popen(['qstat'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = process.communicate()
......@@ -86,9 +88,24 @@ def main():
total_job_count += 1
if scheduler == 'lsf':
running_jobs_tag = 'RUN'
#
# PEND - The job is pending. That is, it has not yet been started.
# PROV
# PSUSP
# RUN - The job is currently running.
# USUSP
# SSUSP
# DONE - The job has terminated with status of 0.
# EXIT - The job has terminated with a non-zero status
# UNKWN
# WAIT
# ZOMBI
#
running_job_tag = 'RUN'
waiting_job_tag = 'PEND'
job_counts = {}
job_counts.setdefault(running_jobs_tag, 0)
job_counts.setdefault(running_job_tag, 0)
job_counts.setdefault(waiting_job_tag, 0)
total_job_count = 0
process = Popen(['bjobs', '-a'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = process.communicate()
......@@ -105,12 +122,17 @@ def main():
status_file_obj = StatusFile(test_id, StatusFile.MODE_OLD)
running_job_count = job_counts[running_jobs_tag]
running_job_count = job_counts[running_job_tag]
waiting_job_count = job_counts[waiting_job_tag]
status_file_obj.log_custom_event(event_type='system',
event_subtype='running_job_count',
event_value=str(running_job_count))
status_file_obj.log_custom_event(event_type='system',
event_subtype='waiting_job_count',
event_value=str(waiting_job_count))
status_file_obj.log_custom_event(event_type='system',
event_subtype='total_job_count',
event_value=str(total_job_count))
......@@ -119,8 +141,10 @@ def main():
file_path = os.path.join(path_to_results, 'out_system_job_counts.csv')
file_ = open(file_path, 'w')
file_.write('running_job_count' + '\t' + 'total_job_count' + '\n')
file_.write(str(job_counts[running_jobs_tag]) + '\t' +
file_.write('running_job_count' + '\t' + 'waiting_job_count' + '\t' +
'total_job_count' + '\n')
file_.write(str(running_job_count) + '\t' +
str(waiting_job_count) + '\t' +
str(total_job_count) + '\n')
file_.close()
......
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