<commit_before>import lib.collection as collection
from collections import OrderedDict


class iperf3m_veth_udp_packetsize(collection.Collection):
    constants = {
        'protocol': 'udp',
        'iperf_name': 'iperf3m',
        'topology': 'direct_veth',
        'zerocopy': False,
    }
    variables = OrderedDict([
        ('packet_size', tuple([2048 * (m + 1) - 29 for m in range(0, 32)])),

        ('disable_offloading', (False, True)),
        ('affinity', (False, True)),
        ('parallelism', (1, 3, 4, 5, 6, 8, 12, 24)),
    ])

    def generation_skip_fn(self, settings):
        return settings['affinity'] and settings['disable_offloading']

    x_axis = 'packet_size'
    y_axes = ['throughput', 'packetput', 'cpu']
    x_title = 'packet size (B)'

    filters = {
        'paper': lambda r: r['affinity'] or r['disable_offloading'] or r['parallelism'] not in (1, 4, 6, 8),
    }

    def analysis_row_label_fn(self, r):
        return "{iperf_name} ({parallelism} flows, {}offloading{}) {protocol}".format('no ' if r['disable_offloading'] else '', ', affinity' if r['affinity'] else '', **r)

    def analysis_grouping_fn(self, r):
        return (r['affinity'] + 2 * r['disable_offloading'],)
<commit_msg>label<commit_after>import lib.collection as collection
from collections import OrderedDict


class iperf3m_veth_udp_packetsize(collection.Collection):
    constants = {
        'protocol': 'udp',
        'iperf_name': 'iperf3m',
        'topology': 'direct_veth',
        'zerocopy': False,
    }
    variables = OrderedDict([
        ('packet_size', tuple([2048 * (m + 1) - 29 for m in range(0, 32)])),

        ('disable_offloading', (False, True)),
        ('affinity', (False, True)),
        ('parallelism', (1, 3, 4, 5, 6, 8, 12, 24)),
    ])

    def generation_skip_fn(self, settings):
        return settings['affinity'] and settings['disable_offloading']

    x_axis = 'packet_size'
    y_axes = ['throughput', 'packetput', 'cpu']
    x_title = 'packet size (B)'

    filters = {
        'paper': lambda r: r['affinity'] or r['disable_offloading'] or r['parallelism'] not in (1, 4, 6, 8),
    }

    def analysis_row_label_fn(self, r):
        return "{parallelism} {protocol} flows{}{}".format(', no offloading' if r['disable_offloading'] else '', ', affinity' if r['affinity'] else '', **r)

    def analysis_grouping_fn(self, r):
        return (r['affinity'] + 2 * r['disable_offloading'],)

{'fraction_non_alphanumeric': 0.166872174270448, 'fraction_numerical': 0.02219482120838471, 'mean_word_length': 3.3776978417266186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7196104', 'n_tokens_mistral': 849, 'n_tokens_neox': 782, 'n_words': 204}