- Timestamp:
- Sep 11, 2015, 3:44:14 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py
r836 r1012 7 7 8 8 9 apps = [ 'filter', 'lu', 'fft_ga' ] 9 #apps = [ 'histo-opt', 'mandel', 'filt_ga', 'radix_ga', 'fft_ga', 'pca-opt', 'fft', 'radix', 'filter', 'kmeans-opt' ] 10 apps = [ 'fft_ga', 'filt_ga', 'lu', 'radix_ga', 'histo-opt', 'mandel', 'pca-opt', 'kmeans-opt' ] 10 11 #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 ] 14 nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ] 15 single_protocols = ['dhccp', 'hmesi'] 16 joint_protocols = ['dhccp', 'hmesi'] 15 17 #joint_protocols = [] 16 18 … … 75 77 exec_time = {} 76 78 metrics_val = {} 77 for prot in single_protocols:79 for prot in joint_protocols: 78 80 metrics_val[prot] = {} 79 81 exec_time[prot] = {} … … 111 113 112 114 # Completing unset metrics (i.e. they are not present in the data file) with 0 113 for prot in single_protocols:115 for prot in joint_protocols: 114 116 for app in apps: 115 117 for i in nb_procs: … … 119 121 120 122 # We make a 2nd pass to fill the derived fields, e.g. nb_total_updates 121 for prot in single_protocols:123 for prot in joint_protocols: 122 124 for app in apps: 123 125 for i in nb_procs: … … 137 139 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'] 138 140 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'] 140 143 if metrics_val[prot][app][i]['broadcast'] < metrics_val[prot][app][i]['write_broadcast']: 141 144 # test to patch a bug in mem_cache … … 414 417 app_labels = "" 415 418 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 417 420 if not first: 418 421 xtics_str += ", " 419 422 first = False 420 if i == nb_procs[ 0]:423 if i == nb_procs[1]: 421 424 xpos_first = xpos 422 425 xtics_str += "\"%d\" %d -1" % (i, xpos) … … 451 454 content += "%-15f" % 0.0 452 455 content += "\n" 453 for i in nb_procs :456 for i in nb_procs[1:len(nb_procs)]: 454 457 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 456 463 content += "\n" 457 464 … … 476 483 477 484 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'] 479 487 480 488 # Creating the gp file … … 533 541 if i > 4: 534 542 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']) 536 548 for cost_metric in coherence_cost_metrics: 537 549 content += "%-15f" % 0.0 … … 540 552 content += "%-15f" % 0.0 541 553 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']) 543 559 content += "\n" 544 560 if i != nb_procs[-1]: … … 680 696 if i > 4: 681 697 for prot in joint_protocols: 698 if metrics_val[joint_protocols[0]][app][i]['direct_cost'] == 0: 699 continue 682 700 for cost_metric in direct_cost_metrics: 683 701 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.