def get_all_free_gpus(cluster, parallel=True):
    nodes = [cluster + str(node) for node in CLUSTER_NODES[cluster]]
    if parallel:
        free_gpus = joblib.Parallel(n_jobs=NUM_CPUS)(
            joblib.delayed(get_free_gpus)(node) for node in nodes)
    else:
        free_gpus = list()
        for node in nodes:
            free_gpus.append(get_free_gpus(node))
    free_gpus_map = dict()
    for fg, n in zip(free_gpus, nodes):
        if len(fg) > 0:
            free_gpus_map[n] = fg
    return free_gpus_map


# Good for when other jobs use multiple GPUs on the same machine
dataset/ETHPy150Open amaas/stanford-ctc/ctc_fast/cluster/utils.py/get_all_free_gpus/original