Ignore:
Timestamp:
Sep 11, 2015, 3:44:14 PM (9 years ago)
Author:
meunier
Message:
  • Update of simulation scripts for tsar_generic_xbar
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py

    r836 r1012  
    77
    88
    9 apps = [ 'filter', 'lu', 'fft_ga' ]
     9#apps = [ 'histo-opt', 'mandel', 'filt_ga', 'radix_ga', 'fft_ga', 'pca-opt', 'fft', 'radix', 'filter', 'kmeans-opt' ]
     10apps = [ 'fft_ga', 'filt_ga', 'lu', 'radix_ga', 'histo-opt', 'mandel', 'pca-opt', 'kmeans-opt' ]
    1011#apps = [ 'histogram', 'mandel', 'filter', 'fft', 'fft_ga', 'filt_ga', 'pca', 'lu' ]  # radix radix_ga kmeans
    11 #apps = [ 'filt_ga' ]
    12 nb_procs = [ 1, 4, 8, 16, 32, 64 ]
    13 single_protocols = ['dhccp', 'rwt' ]
    14 joint_protocols = ['dhccp', 'rwt' ]
     12#apps = [ 'histo-opt', 'histogram2', 'histo-opt2' ]
     13#nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
     14nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
     15single_protocols = ['dhccp', 'hmesi']
     16joint_protocols = ['dhccp', 'hmesi']
    1517#joint_protocols = []
    1618
     
    7577exec_time = {}
    7678metrics_val = {}
    77 for prot in single_protocols:
     79for prot in joint_protocols:
    7880   metrics_val[prot] = {}
    7981   exec_time[prot] = {}
     
    111113   
    112114# Completing unset metrics (i.e. they are not present in the data file) with 0
    113 for prot in single_protocols:
     115for prot in joint_protocols:
    114116   for app in apps:
    115117      for i in nb_procs:
     
    119121
    120122# We make a 2nd pass to fill the derived fields, e.g. nb_total_updates
    121 for prot in single_protocols:
     123for prot in joint_protocols:
    122124   for app in apps:
    123125      for i in nb_procs:
     
    137139         metrics_val[prot][app][i]['total_ncc_to_cc'] = metrics_val[prot][app][i]['ncc_to_cc_read']  + metrics_val[prot][app][i]['ncc_to_cc_write']
    138140         metrics_val[prot][app][i]['direct_cost']     = metrics_val[prot][app][i]['read_cost']       + metrics_val[prot][app][i]['write_cost']
    139          metrics_val[prot][app][i]['broadcast_cost']  = metrics_val[prot][app][i]['broadcast'] * (x * y - 1)
     141         metrics_val[prot][app][i]['broadcast_cost']  = metrics_val[prot][app][i]['broadcast'] * 2 * (x * y - 1)
     142         metrics_val[prot][app][i]['coherence_cost']  = metrics_val[prot][app][i]['broadcast_cost']  + metrics_val[prot][app][i]['m_inv_cost'] + metrics_val[prot][app][i]['update_cost']
    140143         if metrics_val[prot][app][i]['broadcast'] < metrics_val[prot][app][i]['write_broadcast']:
    141144            # test to patch a bug in mem_cache
     
    414417   app_labels = ""
    415418   for num_appli in range(0, len(apps)):
    416       for i in nb_procs:
     419      for i in nb_procs[1:len(nb_procs)]: # skipping values for 1 proc
    417420         if not first:
    418421            xtics_str += ", "
    419422         first = False
    420          if i == nb_procs[0]:
     423         if i == nb_procs[1]:
    421424            xpos_first = xpos
    422425         xtics_str += "\"%d\" %d -1" % (i, xpos)
     
    451454            content += "%-15f" % 0.0
    452455         content += "\n"
    453       for i in nb_procs:
     456      for i in nb_procs[1:len(nb_procs)]:
    454457         for stacked_metric in stacked_metrics:
    455             content += "%-15f" % (float(metrics_val[prot][app][i][stacked_metric]) / metrics_val[prot][app][norm_factor_value]['total_stacked'])
     458            metric_val = metrics_val[prot][app][norm_factor_value]['total_stacked'] # Normalisation
     459            if metric_val != 0:
     460               content += "%-15f" % (float(metrics_val[prot][app][i][stacked_metric]) / metric_val)
     461            else:
     462               content += "%-15f" % 0
    456463         content += "\n"
    457464   
     
    476483   
    477484   direct_cost_metrics = [ 'read_cost', 'write_cost' ]
    478    coherence_cost_metrics = ['update_cost', 'm_inv_cost', 'broadcast_cost' ]
     485   #coherence_cost_metrics = ['update_cost', 'm_inv_cost', 'broadcast_cost' ]
     486   coherence_cost_metrics = ['coherence_cost']
    479487   
    480488   # Creating the gp file
     
    533541         if i > 4:
    534542            for cost_metric in direct_cost_metrics:
    535                content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[prot][app][i]['direct_cost'])
     543               if metrics_val[prot][app][i]['direct_cost'] == 0:
     544                  print "Error: prot : ", prot, " - app : ", app, " - i : ", i
     545                  content += "%-15f" % 0
     546               else:
     547                  content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[prot][app][i]['direct_cost'])
    536548            for cost_metric in coherence_cost_metrics:
    537549               content += "%-15f" % 0.0
     
    540552               content += "%-15f" % 0.0
    541553            for cost_metric in coherence_cost_metrics:
    542                content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[prot][app][i]['direct_cost'])
     554               if metrics_val[prot][app][i]['direct_cost'] == 0:
     555                  print "Error: prot : ", prot, " - app : ", app, " - i : ", i
     556                  content += "%-15f" % 0
     557               else:
     558                  content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[prot][app][i]['direct_cost'])
    543559            content += "\n"
    544560            if i != nb_procs[-1]:
     
    680696      if i > 4:
    681697         for prot in joint_protocols:
     698            if metrics_val[joint_protocols[0]][app][i]['direct_cost'] == 0:
     699               continue
    682700            for cost_metric in direct_cost_metrics:
    683701               content += "%-15f" % (float(metrics_val[prot][app][i][cost_metric]) / metrics_val[joint_protocols[0]][app][i]['direct_cost'])
Note: See TracChangeset for help on using the changeset viewer.