Commit 10e34697 authored by S. Lackner's avatar S. Lackner

[code] Make csv code more readable

parent 287946b3
......@@ -340,22 +340,22 @@ class Scheduler(metaclass=ABCMeta):
id = job.id.split(Batsim.WORKLOAD_JOB_SEPARATOR)
msg = [
time,
job.id,
id[0],
id[1],
full_parent_job_id,
parent_workload_name,
parent_job_id,
job.submit_time,
job.requested_resources,
job.requested_time,
1 if job.success else 0,
job.start_time,
job.finish_time,
job.comment or "",
type_of_completion,
reason_for_completion
time, # time
job.id, # full_job_id
id[0], # workload_name
id[1], # job_id
full_parent_job_id, # full_parent_job_id
parent_workload_name, # parent_workload_name
parent_job_id, # parent_job_id
job.submit_time, # submission_time
job.requested_resources, # requested_number_of_processors
job.requested_time, # requested_time
1 if job.success else 0, # success
job.start_time, # starting_time
job.finish_time, # finish_time
job.comment or "", # comment
type_of_completion, # type
reason_for_completion # reason
]
msg = ["" if s is None else s for s in msg]
self._sched_jobs_logger.info(";".join([str(i) for i in msg]))
......
......@@ -36,20 +36,7 @@ def do_merge_jobs(in_jobs, in_sched_jobs, out_jobs, merge_subjobs=False):
for i1, r1 in in_jobs.iterrows():
job_id = r1["job_id"]
hacky_job_id = r1["hacky_job_id"]
workload_name = r1["workload_name"]
submission_time = r1["submission_time"]
requested_number_of_processors = r1["requested_number_of_processors"]
requested_time = r1["requested_time"]
success = r1["success"]
starting_time = r1["starting_time"]
execution_time = r1["execution_time"]
finish_time = r1["finish_time"]
waiting_time = r1["waiting_time"]
turnaround_time = r1["turnaround_time"]
stretch = r1["stretch"]
consumed_energy = r1["consumed_energy"]
allocated_processors = r1["allocated_processors"]
sched_job = in_sched_jobs.loc[in_sched_jobs['full_job_id'] == str(
workload_name) + Batsim.WORKLOAD_JOB_SEPARATOR + str(job_id)].iloc[0]
......@@ -70,20 +57,20 @@ def do_merge_jobs(in_jobs, in_sched_jobs, out_jobs, merge_subjobs=False):
add_job(
job_id,
hacky_job_id,
r1["hacky_job_id"],
workload_name,
submission_time,
requested_number_of_processors,
requested_time,
success,
starting_time,
execution_time,
finish_time,
waiting_time,
turnaround_time,
stretch,
consumed_energy,
allocated_processors)
r1["submission_time"],
r1["requested_number_of_processors"],
r1["requested_time"],
r1["success"],
r1["starting_time"],
r1["execution_time"],
r1["finish_time"],
r1["waiting_time"],
r1["turnaround_time"],
r1["stretch"],
r1["consumed_energy"],
r1["allocated_processors"])
@postprocess_jobs.command("merge-jobs", help="Merge jobs from the csv file")
......
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