def METHOD_NAME(f):
    """
    Compute the sum of all Function data.
    Parameters
    ----------
    f : Function
        Input Function.
    """
    kwargs = {}
    if f.is_TimeFunction and f._time_buffering:
        kwargs[f.time_dim.max_name] = f._time_size - 1
    # Protect SparseFunctions from accessing duplicated (out-of-domain) data,
    # otherwise we would eventually be summing more than expected
    p, eqns = f.guard() if f.is_SparseFunction else (f, [])
    dtype = accumulator_mapper[f.dtype]
    s = dv.types.Symbol(name='sum', dtype=dtype)
    with MPIReduction(f, dtype=dtype) as mr:
        op = dv.Operator([dv.Eq(s, 0.0)] + eqns +
                         [dv.Inc(s, p), dv.Eq(mr.n[0], s)],
                         name='sum')
        op.apply(**kwargs)
    return f.dtype(mr.v)