def add_job(graph, job_id, gpu: int):
    global global_graphs
    assert ((job_id == len(global_graphs)) or (global_graphs[job_id] is None))
    if (job_id == len(global_graphs)):
        global_graphs.append(graph)
    else:
        global_graphs[job_id] = graph
    init([[] for _ in range(job_num)], gpu)
def add_job(graph, job_id, gpu: int):
    global global_graphs
    assert ((job_id == len(global_graphs)) or (global_graphs[job_id] is None))
    if (job_id == len(global_graphs)):
        global_graphs.append(graph)
    else:
        global_graphs[job_id] = graph
    init([[] for _ in range(job_num)], gpu)