def METHOD_NAME(report, mod, ax=None):
    """
    Generates a bar chart summary for operation counts.
    Parameters
    ----------
    report (DarshanReport): darshan report object to plot
    mod: the module to plot operation counts for (i.e. "POSIX",
    "MPI-IO", "STDIO", "H5F", "H5D"). If "H5D" is input the returned
    figure will contain both "H5F" and "H5D" module data.
    """
    if ax is None:
        fig, ax = plt.subplots()
    else:
        fig = None
    labels, counts = gather_count_data(report=report, mod=mod)
    x = np.arange(len(labels))  # the label locations
    rects = ax.bar(x, counts)
    # Add some text for labels, title and custom x-axis tick labels, etc.
    ax.set_ylabel('Count')
    ax.set_xticks(x)
    ax.set_xticklabels(labels, rotation=90)
    ax.set_ylim(ymin = 0)
    ax.spines[['right', 'top']].set_visible(False)
    autolabel(ax=ax, rects=rects)
    plt.tight_layout()
    if fig is not None:
        plt.close()
        return fig