示例#1
0
def plot_link_load_vs_topology(resultset, alpha, cache_size, topology_range,
                               strategies, plotdir):
    """
    Plot bar graphs of link load for specific values of alpha and cache
    size for various topologies.
    
    The objective here is to show that our algorithms works well on all
    topologies considered
    """
    desc = {}
    desc['title'] = 'Internal link load: A=%s C=%s' % (alpha, cache_size)
    desc['ylabel'] = 'Internal link load'
    desc['xparam'] = ('topology', 'name')
    desc['xvals'] = topology_range
    desc['filter'] = {
        'cache_placement': {
            'network_cache': cache_size
        },
        'workload': {
            'name': 'STATIONARY',
            'alpha': alpha
        }
    }
    desc['ymetrics'] = [('LINK_LOAD', 'MEAN_INTERNAL')] * len(strategies)
    desc['ycondnames'] = [('strategy', 'name')] * len(strategies)
    desc['ycondvals'] = strategies
    desc['errorbar'] = True
    desc['legend_loc'] = 'lower right'
    desc['bar_color'] = STRATEGY_BAR_COLOR
    desc['bar_hatch'] = STRATEGY_BAR_HATCH
    desc['legend'] = STRATEGY_LEGEND
    desc['plotempty'] = PLOT_EMPTY_GRAPHS
    plot_bar_chart(resultset, desc,
                   'LINK_LOAD_INTERNAL_A=%s_C=%s.pdf' % (alpha, cache_size),
                   plotdir)
示例#2
0
def plot_cache_diversity(resultset, topologies, strategies, cache_size, alpha,
                         plotdir):
    desc = {}
    desc['title'] = 'Cache Diversity vs Strategy'
    desc['ylabel'] = 'Cache Diversity'
    desc['xparam'] = ('topology', 'name')
    desc['xvals'] = topologies
    desc['filter'] = {
        'cache_placement': {
            'network_cache': cache_size
        },
        'workload': {
            'name': 'STATIONARY',
            'alpha': alpha
        }
    }
    desc['ymetrics'] = [('DIVERSITY', 'MEAN')] * len(strategies)
    desc['ycondnames'] = [('strategy', 'name')] * len(strategies)
    desc['ycondvals'] = strategies
    desc['errorbar'] = True
    desc['legend_loc'] = 'lower right'
    desc['bar_color'] = STRATEGY_BAR_COLOR
    desc['bar_hatch'] = STRATEGY_BAR_HATCH
    desc['legend'] = STRATEGY_LEGEND
    desc['plotempty'] = PLOT_EMPTY_GRAPHS
    plot_bar_chart(resultset, desc, 'Cache_Diversity_Strategy.png', plotdir)
def plot_path_strech_vs_topology(resultset, alpha, cache_size, topology_range, strategies, plotdir):
    """
    Plot bar graphs of link load for specific values of alpha and cache
    size for various topologies.
    
    The objective here is to show that our algorithms works well on all
    topologies considered
    """
    desc = {}
    desc['title'] = 'Path Strech: A=%s C=%s' % (alpha, cache_size)
    desc['ylabel'] = 'Path Strech'
    desc['xparam'] = ('topology', 'name')
    desc['xvals'] = topology_range
    desc['filter'] = {'cache_placement': {'network_cache': cache_size},
                      'workload': {'name': 'STATIONARY', 'alpha': alpha}}
    desc['ymetrics'] = [('PATH_STRETCH', 'MEAN_CONTENT')]*len(strategies)
    desc['ycondnames'] = [('strategy', 'name')]*len(strategies)
    desc['ycondvals'] = strategies
    desc['errorbar'] = True
    desc['legend_loc'] = 'lower right'
    desc['bar_color'] = STRATEGY_BAR_COLOR
    desc['bar_hatch'] = STRATEGY_BAR_HATCH
    desc['legend'] = STRATEGY_LEGEND
    desc['plotempty'] = PLOT_EMPTY_GRAPHS
    plot_bar_chart(resultset, desc, 'PATH_STRETCH_A=%s_C=%s.pdf'
                   % (alpha, cache_size), plotdir)
示例#4
0
def plot_cache_hits_vs_topology(resultset, alpha, cache_size, topology_range, strategies, plotdir):
    """
    Plot bar graphs of cache hit ratio for specific values of alpha and cache
    size for various topologies.
    
    The objective here is to show that our algorithms works well on all
    topologies considered
    """
    if "NO_CACHE" in strategies:
        strategies.remove("NO_CACHE")
    desc = {}
    desc["title"] = "Cache hit ratio: A=%s C=%s" % (alpha, cache_size)
    desc["ylabel"] = "Cache hit ratio"
    desc["xparam"] = ["topology_name"]
    desc["xvals"] = topology_range
    desc["filter"] = {"network_cache": cache_size, "alpha": alpha}
    desc["ymetrics"] = [("CACHE_HIT_RATIO", "MEAN")] * len(strategies)
    desc["ycondnames"] = [["strategy_name"]] * len(strategies)
    desc["ycondvals"] = strategies
    desc["errorbar"] = True
    desc["legend_loc"] = "lower right"
    desc["bar_color"] = STRATEGY_BAR_COLOR
    desc["bar_hatch"] = STRATEGY_BAR_HATCH
    desc["legend"] = STRATEGY_LEGEND
    desc["plotempty"] = PLOT_EMPTY_GRAPHS
    plot_bar_chart(resultset, desc, "CACHE_HIT_RATIO_A=%s_C=%s.pdf" % (alpha, cache_size), plotdir)
示例#5
0
def plot_cache_evictions(resultset, topologies, strategies, cache_size, alpha,
                         plotdir):
    #print(resultset.prettyprint())
    desc = {}
    desc['title'] = 'Cache Evictions vs Strategy'
    desc['ylabel'] = 'Cache Evictions'
    desc['xparam'] = ('topology', 'name')
    desc['xvals'] = topologies
    desc['filter'] = {
        'cache_placement': {
            'network_cache': cache_size
        },
        'workload': {
            'name': 'STATIONARY',
            'alpha': alpha
        }
    }
    desc['ymetrics'] = [('EVICTIONS', 'NUMBER')] * len(strategies)
    desc['ycondnames'] = [('strategy', 'name')] * len(strategies)
    desc['ycondvals'] = strategies
    desc['errorbar'] = True
    desc['legend_loc'] = 'lower right'
    desc['bar_color'] = STRATEGY_BAR_COLOR
    desc['bar_hatch'] = STRATEGY_BAR_HATCH
    desc['legend'] = STRATEGY_LEGEND
    desc['plotempty'] = PLOT_EMPTY_GRAPHS
    plot_bar_chart(resultset, desc, 'Cache_Evictions_Strategy.png', plotdir)
示例#6
0
def plot_cache_hits_vs_topology(resultset, alpha, cache_size, topology_range,
                                strategies, plotdir):
    """
    Plot bar graphs of cache hit ratio for specific values of alpha and cache
    size for various topologies.
    
    The objective here is to show that our algorithms works well on all
    topologies considered
    """
    if 'NO_CACHE' in strategies:
        strategies.remove('NO_CACHE')
    desc = {}
    desc['title'] = 'Cache hit ratio: A=%s C=%s' % (alpha, cache_size)
    desc['ylabel'] = 'Cache hit ratio'
    desc['xparam'] = ['topology_name']
    desc['xvals'] = topology_range
    desc['filter'] = {'network_cache': cache_size, 'alpha': alpha}
    desc['ymetrics'] = [('CACHE_HIT_RATIO', 'MEAN')] * len(strategies)
    desc['ycondnames'] = [['strategy_name']] * len(strategies)
    desc['ycondvals'] = strategies
    desc['errorbar'] = True
    desc['legend_loc'] = 'lower right'
    desc['bar_color'] = STRATEGY_BAR_COLOR
    desc['bar_hatch'] = STRATEGY_BAR_HATCH
    desc['legend'] = STRATEGY_LEGEND
    desc['plotempty'] = PLOT_EMPTY_GRAPHS
    plot_bar_chart(resultset, desc,
                   'CACHE_HIT_RATIO_A=%s_C=%s.pdf' % (alpha, cache_size),
                   plotdir)
示例#7
0
def plot_link_load_vs_topology(resultset, alpha, cache_size, topology_range, strategies, plotdir):
    """
    Plot bar graphs of link load for specific values of alpha and cache
    size for various topologies.
    
    The objective here is to show that our algorithms works well on all
    topologies considered
    """
    desc = {}
    desc['title'] = 'Internal link load: A=%s C=%s' % (alpha, cache_size)
    desc['ylabel'] = 'Internal link load'
    desc['xparam'] = ['topology_name']
    desc['xvals'] = topology_range
    desc['filter'] = {'network_cache': cache_size,
                      'alpha': alpha}
    desc['ymetrics'] = [('LINK_LOAD', 'MEAN_INTERNAL')]*len(strategies)
    desc['ycondnames'] = [['strategy_name']]*len(strategies)
    desc['ycondvals'] = strategies
    desc['errorbar'] = True
    desc['legend_loc'] = 'lower right'
    desc['bar_color'] = STRATEGY_BAR_COLOR
    desc['bar_hatch'] = STRATEGY_BAR_HATCH
    desc['legend'] = STRATEGY_LEGEND
    desc['plotempty'] = PLOT_EMPTY_GRAPHS
    plot_bar_chart(resultset, desc, 'LINK_LOAD_INTERNAL_A=%s_C=%s.pdf'
                   % (alpha, cache_size), plotdir)
示例#8
0
def plot_cache_hits_vs_topology(resultset, alpha, cache_size, topology_range, strategies, plotdir):
    """
    Plot bar graphs of cache hit ratio for specific values of alpha and cache
    size for various topologies.
    
    The objective here is to show that our algorithms works well on all
    topologies considered
    """
    if 'NO_CACHE' in strategies:
        strategies.remove('NO_CACHE')
    desc = {}
    desc['title'] = 'Cache hit ratio: A=%s C=%s' % (alpha, cache_size)
    desc['ylabel'] = 'Cache hit ratio'
    desc['xparam'] = ['topology_name']
    desc['xvals'] = topology_range
    desc['filter'] = {'network_cache': cache_size,
                      'alpha': alpha}
    desc['ymetrics'] = [('CACHE_HIT_RATIO', 'MEAN')]*len(strategies)
    desc['ycondnames'] = [['strategy_name']]*len(strategies)
    desc['ycondvals'] = strategies
    desc['errorbar'] = True
    desc['legend_loc'] = 'lower right'
    desc['bar_color'] = STRATEGY_BAR_COLOR
    desc['bar_hatch'] = STRATEGY_BAR_HATCH
    desc['legend'] = STRATEGY_LEGEND
    desc['plotempty'] = PLOT_EMPTY_GRAPHS
    plot_bar_chart(resultset, desc, 'CACHE_HIT_RATIO_A=%s_C=%s.pdf'
                   % (alpha, cache_size), plotdir)
示例#9
0
def plot_cache_hits_vs_topology(resultset, alpha, cache_size, topology_range,
                                strategies, plotdir):
    """
    Plot bar graphs of cache hit ratio for specific values of alpha and cache
    size for various topologies.

    The objective here is to show that our algorithms works well on all
    topologies considered
    """
    if "NO_CACHE" in strategies:
        strategies.remove("NO_CACHE")
    desc = {}
    desc["title"] = "Cache hit ratio: A={} C={}".format(alpha, cache_size)
    desc["ylabel"] = "Cache hit ratio"
    desc["xparam"] = ("topology", "name")
    desc["xvals"] = topology_range
    desc["filter"] = {
        "cache_placement": {
            "network_cache": cache_size
        },
        "workload": {
            "name": "STATIONARY",
            "alpha": alpha
        },
    }
    desc["ymetrics"] = [("CACHE_HIT_RATIO", "MEAN")] * len(strategies)
    desc["ycondnames"] = [("strategy", "name")] * len(strategies)
    desc["ycondvals"] = strategies
    desc["errorbar"] = True
    desc["legend_loc"] = "lower right"
    desc["bar_color"] = STRATEGY_BAR_COLOR
    desc["bar_hatch"] = STRATEGY_BAR_HATCH
    desc["legend"] = STRATEGY_LEGEND
    desc["plotempty"] = PLOT_EMPTY_GRAPHS
    plot_bar_chart(
        resultset,
        desc,
        "CACHE_HIT_RATIO_A={}_C={}.pdf".format(alpha, cache_size),
        plotdir,
    )
示例#10
0
def plot_link_load_vs_topology(resultset, alpha, cache_size, topology_range, strategies, plotdir):
    """
    Plot bar graphs of link load for specific values of alpha and cache
    size for various topologies.
    
    The objective here is to show that our algorithms works well on all
    topologies considered
    """
    desc = {}
    desc["title"] = "Internal link load: A=%s C=%s" % (alpha, cache_size)
    desc["ylabel"] = "Internal link load"
    desc["xparam"] = ["topology_name"]
    desc["xvals"] = topology_range
    desc["filter"] = {"network_cache": cache_size, "alpha": alpha}
    desc["ymetrics"] = [("LINK_LOAD", "MEAN_INTERNAL")] * len(strategies)
    desc["ycondnames"] = [["strategy_name"]] * len(strategies)
    desc["ycondvals"] = strategies
    desc["errorbar"] = True
    desc["legend_loc"] = "lower right"
    desc["bar_color"] = STRATEGY_BAR_COLOR
    desc["bar_hatch"] = STRATEGY_BAR_HATCH
    desc["legend"] = STRATEGY_LEGEND
    desc["plotempty"] = PLOT_EMPTY_GRAPHS
    plot_bar_chart(resultset, desc, "LINK_LOAD_INTERNAL_A=%s_C=%s.pdf" % (alpha, cache_size), plotdir)