Skip to content
Snippets Groups Projects
Commit 875ec2f5 authored by Patrick Lavoisier Wapet's avatar Patrick Lavoisier Wapet
Browse files

writing the puplication: motivation based on graph completed, some code has...

writing the puplication: motivation based on graph completed, some code has been added to generate plots
parent 84ea82db
No related branches found
No related tags found
No related merge requests found
......@@ -179,3 +179,84 @@ plt.clf()
plt.cla()
plt.close()
######################################################## plotting graphs for the paper.
# Showing that there are complex interaction between energy efficiency variables:
# Dans l'expérimentation illustrée par la figure \ref{fig:complexInteractionBetweenVariables}
# Nous avons exécuté une tâche CPU intensive sur le google pixel
# Nous avons d'une part fait variérié de 1 à 3 le nombre de threads parallélisé sur le little socket (1T to 3T).
# D'autre part pour chaque nombre de threads nous avons fixé deux niveaux de fréquence différents , la fréquence moyenne (MidFreq = 1.36 GHz) et la fréquence maximale (MaxFreq = 1.8 GHz).
# Nous pouvons par exemple noter que le nombre de threads et la fréquence interagissent entre elles.
# Par exemple:
# Lorsque la fréquence est moyenne, augmenter le parallélisme de 1 à trois threads augmente l'efficacité de ratio 1
# alors que lorsque la fréquence est élevée cette augmentation est de ratio 2
# De plus lorsqu'un seul thread est démarrer, augmenter la fréquence du socket augmente l'efficacité énergétique.
# Mais l'efficacité énergétique diminue lorsque 3 thread sont démarrés que que l'on effectue la même opération d'aumentation de fréquence.
# Par ces illustrations respectives nous voyons qu'il est crutial de considérer l'interaction entre les facteurs de l'efficacité énergétique,
# C'est non seulement, pour augmenter exploiter les meilleures opportunités de gain mais aussi éviter des contres productivités.
number_of_cpus = ["mse", "idle" , "1m-0", "1h-0", "1-0", "2m-0", "2h-0" , "2-0", "3m-0", "3h-0" , "3-0", "1-1m" , "1-1h", "1m-1m", "1h-1h", "1-1", "0-1m", "0-1h", "0-1-0" , "0-0-1", "0-2m", "0-2h" , "0-11m", "0-11h", "0-2" ]
phone_energy= [ 1308, 11047.73, 22554.99, 24785.02, 29197.24, 24277.3, 28502.31 , 38598.14, 26060.77, 32111.43, 46077.78, 35087.51, 47102.84, 28158.18 , 42742.2, 73048.75, 30052.34 , 47133.62, 66877.5, 77632.30 , 35683.20, 67647.63, 80676.10 , 98665.02 , 115136.69 ]
phone_power = [ 40.16, 336.07, 679.99, 746.01, 876.80, 729.67, 854.14 , 1066.77, 783.20, 960.98, 1272.45, 1045.80, 1389.07, 845.63, 1265.01, 2106.08, 899.02, 1390.60, 1938.45, 2214.51 , 1062.76, 1958.13 , 2298.82, 2758.98 , 3179.93 ]
workload = [ 0.1, 0.9, 0.6206, 1.267, 1.60362534, 1.41737, 2.61014 , 3.368042, 2.291607, 4.07984, 4.9563, 3.810539, 6.249128, 2.790242, 6.12180, 8.47040, 2.5540681, 5.53843, 6.7442, 7.645522240 , 4.5668, 10.317, 9.392402, 12.280638, 13.21045181 ]
frequency = ["1T,MidFreq", "1T,MaxFreq", "2T,MidFreq", "2T,MaxFreq", "3T,MidFreq", "3T,MaxFreq" ]
phone_energy= [ 24785.02, 29197.24, 28502.31 , 38598.14, 32111.43, 46077.78 ]
workload = [ 1.267, 1.60362534, 2.61014 , 3.368042, 4.07984, 4.9563, ]
fontsize_in_paper = 20
bar_width = 0.4
label_format = '{:,.1f}'
fig, ((energy_efficiency_fig)) = plt.subplots(nrows= 1, ncols = 1, figsize=(15, 7), sharex=True)
ratio_1 = (workload[4]/phone_energy[4] - workload[0]/phone_energy[0]) / (workload[0]/phone_energy[0])
ratio_2 = (workload[5]/phone_energy[5] - workload[0]/phone_energy[0]) / (workload[0]/phone_energy[0])
print(" ratio 1 ", ratio_1*100)
print(" ratio 2 ", ratio_2*100)
#frequency[:] = [round(x / 1E+6, 2) for x in frequency]
phone_energy[:] = [round(x / 1000, 2) for x in phone_energy]
energy_efficiency = np.divide(workload, phone_energy)
energy_efficiency[:] = [round(x*10, 2) for x in energy_efficiency]
energy_efficiency_fig.bar(frequency, energy_efficiency, width=bar_width, color = "black")
energy_efficiency_fig.set_title('Energy efficiency\n ' + r'($\times 10e11$)', fontsize = fontsize_in_paper)
energy_efficiency_fig.set_xticklabels(frequency, fontsize = fontsize_in_paper)
energy_efficiency_fig.set_yticklabels([label_format.format(x) for x in energy_efficiency_fig.get_yticks().tolist()] , fontsize = fontsize_in_paper)
"""
label_format = '{:,.0f}'
workload[:] = [round(x, 2 ) for x in workload]
workload_fig.bar(frequency, workload, width= bar_width, color = "black")
workload_fig.set_title('Number of operations\n' + r'($\times 10e11$)', fontsize = fontsize_in_paper)
workload_fig.set_xticklabels(frequency, fontsize = fontsize_in_paper)
workload_fig.set_yticklabels([label_format.format(x) for x in workload_fig.get_yticks().tolist()] , fontsize = fontsize_in_paper)
#plt.xticks(fontsize=8)
phone_energy[:] = [round(x , 2 ) for x in phone_energy] # I alrady divided by 1000
phone_energy_fig.bar(frequency, phone_energy, width=bar_width, color = "black") # I divided the energy by 1000 because Moonson made a mistakes in the output, they gives energy in mAh 1000 times.
phone_energy_fig.set_title('Energy consumed\n' + r'(mAh)', fontsize = fontsize_in_paper)
phone_energy_fig.set_xticklabels(frequency, fontsize = fontsize_in_paper)
phone_energy_fig.set_yticklabels([label_format.format(x) for x in phone_energy_fig.get_yticks().tolist()] , fontsize = fontsize_in_paper)
"""
#fig.suptitle("Workload, Energy and Energy efficiency according to the core frequency")
fig.supxlabel("Big core frequency (GHz)", fontsize = fontsize_in_paper)
plt.gcf().autofmt_xdate()
plt.savefig("Complexity_Between_Vars_influence_energy_efficiency.png")
plt.clf()
plt.cla()
plt.close()
google_pixel_varying_the_number_of_thread/Phone_model_influence_energy_efficiency.png

81.4 KiB

......@@ -191,7 +191,7 @@ plt.close()
################################################
'''
######################################################## plotting graphs for the paper.
# Showing that the number of threads deployed on cores influence the energy efficiency:
# Dans l'expérimentation illustrée par la figure \ref{fig:numberOfThreadsInfluenceEnergyEfficiency}
......@@ -258,3 +258,129 @@ plt.clf()
plt.cla()
plt.close()
'''
# Showing that the phone model influence the energy efficiency:
# Pour observer son influence sur l'efficacité nous avons mené une expérimentation. Et la figure \ref{fig:phoneModelInfluenceEnergyEfficiency} illustre les résultat obtenus.
# En effet, Nous avons considéré deux téléphone le google pixel (en black) et le Samsung galaxay (en gray hatched)
# Sur chacun d'eux nous avons démarré un puis deux threads parallèles : ce sont les configuration 1-0 et 2-0.
# Nous avons ensuite démarré un thread sur son big core. c'est la configuration 0-1.
# Nous pouvons noter au moins deux comportement différents d'un téléphone à l'autre:
# le fait de paralléliser sur le google pixel a augmenter l'efficacité de ratio_1 % sur le google alors que cette augmentation a seulement été de % sur le samsung.
# Le fait d'utiliser le Big core est beaucoup plus efficace que de paralléliser sur le samsung alors que ce n'est pas le cas sur le google pixel.
#
#
##### Google Pixel datas.
number_of_cpus = ["mouse", "idle" ,"1-0", "2-0", "3-0", "4-0", "5-0", "6-0", "6-1", "6-2" ,"0-1-0", "0-0-1" ,"0-2", "1-1", "2-1", "3-1", "1-2" ]
phone_energy= [ 1308, 11047.73, 29197.24, 38598.14, 46077.78, 53629.51, 58756.40, 66053.62, 106210.78 , 123823.21, 66877.5, 77632.30, 115136.69, 73048.75, 79000.24 , 92143.93 , 96571.58 ]
phone_power = [ 40.16, 336.07, 879.245 , 1146.12, 1357.74 , 1572.76, 1718.15, 1918.21, 2970.56 , 3397.90, 1938.45, 2214.51, 3179.93, 2106.08, 2267.14 , 2614.01 , 2717.37]
workload = [ 0.1, 0.9, 1.60362, 3.368, 4.9563 , 6.906, 7.3213, 10.85176, 17.08829 , 21.384681, 6.7442, 7.64552224, 13.210451922, 8.47040, 10.3032, 12.38267 , 12.72335]
# paper data extracted
configuration = ["1-0", "2-0", "0-1"]
google_phone_energy= [29197.24, 38598.14, 77632.30 ]
google_workload = [1.60362, 3.368, 7.64552224 ]
fontsize_in_paper = 20
bar_width = 0.4
label_format = '{:,.1f}'
ratio_1 = (google_workload[1]/google_phone_energy[1] - google_workload[0]/google_phone_energy[0] ) / (google_workload[0]/google_phone_energy[0])
print(" ratio 1 ", ratio_1)
##### Samsung datas
number_of_cpus = ["mouse", "idle" , "1-0", "2-0", "3-0", "4-0", "4-1", "4-2", "4-3", "4-4", "0-1", "0-2", "0-3" , "0-4", "2-1", "3-1" , "1-1", "1-2", "1-3" ]
phone_energy= [ 1308, 15437.75 , 51208.79 , 54347.47, 57513.95 , 74701.21, 98200.09 , 124222.42, 128746.44 , 145726.86, 94219.85 , 100720.96, 141336.4, 122949.4 , 98711.42, 101212.13 , 90216.11, 110737, 111186.62 ]
phone_power = [ 40.16, 1047.42 , 2617.20, 2532.40 , 1950.01 , 2618.09, 2620.45 , 2616.48, 38.35, 2620.32, 2620.1 , 2622.43, 2231.52 , 2623.83, 2619.02, 2620.84 , 2620.50, 2621.93, 2618.84 ]
workload = [ 0.1, 1 , 1.25068, 2.688753, 4.02600 , 5.25640 , 8.44232736, 11.73684641, 13.9001248561 , 16.270943, 3.61959474 , 6.09298, 10.06644613, 11.9685747498 , 6.14819, 7.27350446993, 4.550717, 7.632924365, 10.042245486 ]
# paper data extracted
configuration = ["1-0", "2-0", "0-1"]
samsung_phone_energy= [ 51208.79, 54347.47, 100720.96]
samsung_workload = [ 1.25068, 2.688753, 3.61959474]
fontsize_in_paper = 20
bar_width = 0.4
label_format = '{:,.1f}'
ratio_2 = (samsung_workload[1]/samsung_phone_energy[1] - samsung_workload[0]/samsung_phone_energy[0] ) / (samsung_workload[0]/samsung_phone_energy[0])
print(" ratio 2 ", ratio_2)
y = np.arange(len(configuration))
'''
fig, ax = plt.subplots()
google_pixel_bars = ax.bar(y - bar_width/2, TO_PLOT_1 , width, label='Google Pixel 4A 5G')
samsung_bars = ax.bar(y + bar_width/2, TO_PLOT_1, width, label='Samsung Galaxy S8')
ax.legend()
ax.bar_label(google_pixel_bars, padding=3)
ax.bar_label(samsung_bars, padding=3)
fig.tight_layout()
'''
fig, ((workload_fig, phone_energy_fig, energy_efficiency_fig)) = plt.subplots(nrows= 1, ncols = 3, figsize=(15, 7), sharex=True)
################ energy efficiency subplot
## google pixel bars
google_phone_energy[:] = [round(x / 1000, 2) for x in google_phone_energy]
google_energy_efficiency = np.divide(google_workload, google_phone_energy)
google_energy_efficiency[:] = [round(x*10, 2) for x in google_energy_efficiency]
google_pixel_ef_bars = energy_efficiency_fig.bar(y - bar_width/2, google_energy_efficiency , bar_width, label='Google Pixel 4A 5G', color = "black") # in google_pixel_ef_bars, "ef" is for energy efficiency
## samsung bars
samsung_phone_energy[:] = [round(x / 1000, 2) for x in samsung_phone_energy]
samsung_energy_efficiency = np.divide(samsung_workload, samsung_phone_energy)
samsung_energy_efficiency[:] = [round(x*10, 2) for x in samsung_energy_efficiency]
samsung_ef_bars = energy_efficiency_fig.bar(y + bar_width/2, samsung_energy_efficiency, bar_width, label='Samsung Galaxy S8', color='gray', edgecolor='black', hatch='//')
# setting the subplot
energy_efficiency_fig.set_title('Energy efficiency_\n ' + r'($\times 10e11$)', fontsize = fontsize_in_paper)
energy_efficiency_fig.set_xticks(y, configuration)
energy_efficiency_fig.set_xticklabels(configuration, fontsize = fontsize_in_paper)
energy_efficiency_fig.set_yticklabels([label_format.format(x) for x in energy_efficiency_fig.get_yticks().tolist()] , fontsize = fontsize_in_paper)
################ workload subplot
## google pixel bars
label_format = '{:,.0f}'
google_workload[:] = [round(x, 2 ) for x in google_workload]
google_pixel_w_bars = workload_fig.bar(y - bar_width/2, google_workload , bar_width, label='Google Pixel 4A 5G', color = "black" ) # in google_pixel_w_bars, "w" is for workload
## samsung bars
label_format = '{:,.0f}'
samsung_workload[:] = [round(x, 2 ) for x in samsung_workload]
samsung_w_bars = workload_fig.bar(y + bar_width/2, samsung_workload , bar_width, label='Samsung Galaxy S8' , color='gray', edgecolor='black', hatch='//')
# setting the subplot
workload_fig.set_title('Number of operations\n' + r'($\times 10e11$)', fontsize = fontsize_in_paper)
workload_fig.set_yticklabels([label_format.format(x) for x in workload_fig.get_yticks().tolist()] , fontsize = fontsize_in_paper)
################ phone energy subplot
## google pixel bars
google_phone_energy[:] = [round(x , 2 ) for x in google_phone_energy] # I alrady divided by 1000
google_pixel_e_bar = phone_energy_fig.bar(y - bar_width/2, google_phone_energy , bar_width, label='Google Pixel 4A 5G', color = 'black') # in google_pixel_e_bars, "e" is for energy
## samsung bars
samsung_phone_energy[:] = [round(x , 2 ) for x in samsung_phone_energy] # I alrady divided by 1000
samsung_e_bars = phone_energy_fig.bar(y + bar_width/2, samsung_phone_energy , bar_width, label='Samsung Galaxy S8', color='gray', edgecolor='black', hatch='//')
## setting the subplot
phone_energy_fig.set_title('Energy consumed\n' + r'(mAh)', fontsize = fontsize_in_paper)
phone_energy_fig.set_yticklabels([label_format.format(x) for x in phone_energy_fig.get_yticks().tolist()] , fontsize = fontsize_in_paper)
phone_energy_fig.legend(loc = 'upper right', prop={'size': 18})
#fig.suptitle("Workload, Energy and Energy efficiency according to the number of threads")
fig.supxlabel("Thread configurations on cores and sockets", fontsize = fontsize_in_paper)
#fig.tight_layout()
#plt.gcf().autofmt_xdate()
plt.savefig("Phone_model_influence_energy_efficiency.png")
plt.clf()
plt.cla()
plt.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment