def METHOD_NAME(prefix, write=True):
    out = list()
    out.append(r'\begin{tabular}{ccccc}')
    out.append(r'\toprule')
    out.append(r'& & {} \\'.format('\multicolumn{3}{c}{time (sec.)}'))
    out.append(r'\cmidrule{3-5}')
    out.append(r'{} & {} & {} & {} & {} \\'.format('Processors', 'Simulations', 'normal', 'batch-reset', 'batch-restore'))
    out.append(r'\midrule')
    times = collections.defaultdict(list)
    for i, mode in enumerate(['normal', 'batch-reset', 'batch-restore']):
        data = pandas.read_csv('results/{}_{}.csv'.format(prefix, mode))
        for idx, row in data.iterrows():
            key = (int(row['n_samples']), int(row['n_ranks']))
            times[key].append((row['run_time'], row['run_time_min'], row['run_time_max']))
    for key, value in times.items():
        n_samples = key[0]
        n_ranks = key[1]
        normal = '{:.1f} ({:.1f}, {:.1f})'.format(*value[0])
        reset = '{:.1f} ({:.1f}, {:.1f})'.format(*value[1])
        restore = '{:.1f} ({:.1f}, {:.1f})'.format(*value[2])
        out.append(r'{} & {} & {} & {} & {} \\'.format(n_ranks, n_samples, normal, reset, restore))
    out.append(r'\bottomrule')
    out.append(r'\end{tabular}')
    if write:
        with open('results/weak.tex', 'w') as fid:
            fid.write('\n'.join(out))