Exemple #1
0
def get_cmd_log(task):
    cmd_lines = []
    if getattr(task, "get_launch_cmd", None):
        launch_cmd = task.get_launch_cmd()
        tm_s, tm_e = read_time_file(task.time_file)
        cmd_lines.append([task.jobid, sec2time(tm_e - tm_s), task.jobname, launch_cmd])
    if getattr(task, "jobs", None):
        for subtask in task.jobs:
            cmd_lines.extend(get_cmd_log(subtask))
    return cmd_lines
Exemple #2
0
def update_job_status(j):
    start = None
    end = None
    if j.status == "D":
        try:
            start, end = read_time_file(j.time_file)
        except Exception as e:
            log.warning("Execution time could not be loaded into DB: %s", j.jobid[:6])
            log.warning(e)
    db.update_task(j.jobid, status=j.status, tm_start=start, tm_end=end)
    return start, end
Exemple #3
0
def update_job_status(j):
    start = None
    end = None
    if j.status == "D":
        try:
            start, end = read_time_file(j.time_file)
        except Exception as e:
            log.warning("Execution time could not be loaded into DB: %s",
                        j.jobid[:6])
            log.warning(e)
    db.update_task(j.jobid, status=j.status, tm_start=start, tm_end=end)
    return start, end
Exemple #4
0
def get_cmd_log(task):
    cmd_lines = []
    if getattr(task, 'get_launch_cmd', None):
        launch_cmd = task.get_launch_cmd()
        tm_s, tm_e = read_time_file(task.time_file)
        cmd_lines.append(
            [task.jobid,
             sec2time(tm_e - tm_s), task.jobname, launch_cmd])
    if getattr(task, 'jobs', None):
        for subtask in task.jobs:
            cmd_lines.extend(get_cmd_log(subtask))
    return cmd_lines