def METHOD_NAME(case, run_exe, overrides=None, extra_args=None):
    ###############################################################################
    """
    Given a case, construct and return the aprun command and optimized node count
    """
    models = case.get_values("COMP_CLASSES")
    ntasks, nthreads, rootpes, pstrids = [], [], [], []
    for model in models:
        model = "CPL" if model == "DRV" else model
        for the_list, item_name in zip(
            [ntasks, nthreads, rootpes, pstrids],
            ["NTASKS", "NTHRDS", "ROOTPE", "PSTRID"],
        ):
            the_list.append(case.get_value("_".join([item_name, model])))
    max_tasks_per_node = case.get_value("MAX_TASKS_PER_NODE")
    if overrides:
        overrides = {
            x: y if isinstance(y, int) or y is None else int(y)
            for x, y in overrides.items()
        }
        if "max_tasks_per_node" in overrides:
            max_tasks_per_node = overrides["max_tasks_per_node"]
        if "total_tasks" in overrides:
            ntasks = [overrides["total_tasks"] if x > 1 else x for x in ntasks]
        if "thread_count" in overrides:
            nthreads = [overrides["thread_count"] if x > 1 else x for x in nthreads]
    return _get_aprun_cmd_for_case_impl(
        ntasks,
        nthreads,
        rootpes,
        pstrids,
        max_tasks_per_node,
        case.get_value("MAX_MPITASKS_PER_NODE"),
        case.get_value("PIO_NUMTASKS"),
        case.get_value("PIO_ASYNC_INTERFACE"),
        case.get_value("COMPILER"),
        case.get_value("MACH"),
        run_exe,
        extra_args,
    )