def ComputeTotals(localTimes, localFlops, localMessages, localMessageLens,
    localReductions):
    """Computes time spent by all processes"""
    time = 0
    flops = 0
    for t in localTimes:
        time += localTimes[t]
    flops = 0
    for t in localFlops:
        flops += localFlops[t]
    messages = 0
    for t in localMessages:
        messages += localMessages[t]
    messagelens = 0
    for t in localMessageLens:
        messagelens += localMessageLens[t]
    reductions = 0
    for t in localReductions:
        reductions += localReductions[t]
    return time, flops, messages, messagelens, reductions
