-
Notifications
You must be signed in to change notification settings - Fork 0
/
2022-09-29_ubench_v2_grouped.py
650 lines (511 loc) · 23.6 KB
/
2022-09-29_ubench_v2_grouped.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
#!/usr/bin/python
# Hello world python program
# Lancer le script : python3 ./2022-02-08_sparseccl.py
import matplotlib.pyplot as plt
import numpy as np
import statistics as stat
## ============ CHARGEMENT ============
#FLAT_ARRAYS = False
FLAT_ONLY = True
tableau_horizontal = True # vertical pas encore géré
VERSION_ATTENDUE = 2
# TODO affichage de la figure 4 et 3
# Il faut charger deux fichiers, un flatten et l'autre graphPtr.
# Tout charger dans une même liste (header_list) avec un flag pour indiquer
# s'il s'agit d'un graphe de pointeur ou d'une structure aplatie.
# flag IS_FLATTEN qui indique si c'est flatten ou graphe de ptr
# ============= Gestion de la taille
my_dpi = 96
output_image_name = "le nom de ma belle image"
output_image_name_ver = "6_br" # 3_dl
computer_name = "cassidi" # aussi utilisé pour le nom du fichier d'entrée
image_width = 1280
image_height = 1
image_scale_factor = image_width / 640
line_width = image_scale_factor * 1.5
if FLAT_ONLY:
image_height = (image_width / 640) * 220 # 160 #198
plt.figure(figsize=(image_width/my_dpi, image_height/my_dpi) , dpi=my_dpi)
output_image_name = "ubench2_" + computer_name + "_onlyFlat" + output_image_name_ver + ".png"
else:
image_height = (image_width / 640) * 258 # 273
plt.figure(figsize=(image_width/my_dpi, image_height/my_dpi), dpi=my_dpi)
output_image_name = "ubench2_" + computer_name + "_ptrAndFlat" + output_image_name_ver + ".png"
MY_SIZE = (10 * image_scale_factor)
TITLE_SIZE = (12 * image_scale_factor)
#plt.rc('font', size=MY_SIZE) # controls default text sizes
plt.rc('axes', titlesize=TITLE_SIZE) # fontsize of the axes title
plt.rc('axes', labelsize=MY_SIZE) # fontsize of the x and y labels
plt.rc('xtick', labelsize=MY_SIZE) # fontsize of the tick labels
plt.rc('ytick', labelsize=MY_SIZE) # fontsize of the tick labels
plt.rc('legend', fontsize=MY_SIZE) # legend fontsize
#plt.rc('figure', titlesize=MY_SIZE) # fontsize of the figure title
# plt.rcParams.update({'font.size': MY_SIZE})
# fin gestion de la taille =============
# Lecture du fichier d'entrée
# filepath = 'acts06_generalFlatten_sandor_AT_ld100_RUN1.t'
# filepath = 'acts06_generalFlatten_blopNvidia_AT_ld10_RUN1.t'
# filepath = 'acts06_generalGraphPtr_uniqueModules_sandor_AT_ld1_RUN1.t'
# filepath = 'acts06_generalGraphPtr_uniqueModules_blopNvidia_AT_ld10_RUN1.t'
# Bug manifeste sur le ld10 /!\
def usm_code_to_str(usm_code):
if (usm_code == 0): return "shared"
if (usm_code == 1): return "device"
if (usm_code == 2): return "host"
if (usm_code == 3): return "accessors"
if (usm_code == 20): return "CPU"
return "<unknown>"
# Tous les headers : a chaque header est associé une série de paramètres
header_list = []
import sys
global_kernel_count = 0
global_kernel_retain = 2
def load_file(filename, isFlatten, multiplyFactor):
global global_kernel_count
global global_kernel_retain
global VERSION_ATTENDUE
# absolute_filepath = "/home/data_sync/academique/These/SYCL_tests/mem_bench/output_bench/" + filename
absolute_filepath = "../output_bench/" + filename
with open(absolute_filepath) as fp:
version = fp.readline() # version du fichier actuel (doit être 106 et non plus 105)
print("Version du fichier : {}".format(version))
if (int(version) != VERSION_ATTENDUE):
#print("ERREUR, VERSION DU FICHIER NON COMPATIBLE : " + str(int(version)) + ". VERSION ATTENDUE = 106")
sys.exit("ERREUR, VERSION DU FICHIER NON COMPATIBLE : " + str(int(version)) + ". VERSION ATTENDUE = " + str(VERSION_ATTENDUE))
print("isFlatten = " + str(isFlatten))
header_line = fp.readline()
while header_line:
header_split_words = header_line.split(" ")
header_split_words.remove("\n")
print(header_split_words)
header = {} # dictionnaire vide
header["in_total_size"] = header_split_words[0]
header["out_total_size"] = header_split_words[1]
header["b_INPUT_OUTPUT_FACTOR"] = header_split_words[2]
header["REPEAT_COUNT_REALLOC"] = header_split_words[3]
header["sycl_mode"] = int(header_split_words[4])
header["explicit_copy"] = int(header_split_words[5]) # 1 pour oui, 0 pour non
print("---- SYCL mode = " + str(header["sycl_mode"]) + "----")
print("SYCL mode = " + usm_code_to_str(header["sycl_mode"]))
# if (header["sycl_mode"] == 0): print("SYCL mode = shared")
# if (header["sycl_mode"] == 1): print("SYCL mode = device")
# if (header["sycl_mode"] == 2): print("SYCL mode = host")
# if (header["sycl_mode"] == 3): print("SYCL mode = accessors")
# if (header["sycl_mode"] == 20): print("SYCL mode = CPU")
# 0 shared, 1 device, 2 host, 3 accessors, 20 glibc
# skip 5 champs
header["iterations"] = [] # liste d'itérations
# header["IS_FLATTEN"] = isFlatten # True or False
#print(header)
# print(" _____ REPEAT_COUNT_REALLOC = " + header["REPEAT_COUNT_REALLOC"])
for i in range(int(header["REPEAT_COUNT_REALLOC"])):
iter_line = fp.readline()
iter_list = iter_line.split(" ")
iter_list.remove("\n")
iteration = {}
iteration["t_alloc_native"] = int(iter_list[0]) * multiplyFactor
iteration["t_alloc_sycl"] = int(iter_list[1]) * multiplyFactor
iteration["t_fill"] = int(iter_list[2]) * multiplyFactor
iteration["t_copy"] = int(iter_list[3]) * multiplyFactor
iteration["t_read"] = int(iter_list[4]) * multiplyFactor
iteration["t_dealloc_sycl"] = int(iter_list[5]) * multiplyFactor
iteration["t_dealloc_native"] = int(iter_list[6]) * multiplyFactor
iteration["kernel_count"] = int(iter_list[7])
iteration["t_kernel"] = [] # liste de valeurs temps kernel
global_kernel_count = int(iteration["kernel_count"])
# print(" _____ kernel_count = " + iter_list[7])
# print(" _____ global_kernel_count = " + str(global_kernel_count))
for ik in range(global_kernel_retain):
v = int(iter_list[8 + ik]) * multiplyFactor
#if (ik <= 1):
iteration["t_kernel"].append(v)
# iteration["t_alloc_only"] = int(iter_list[0]) * multiplyFactor
# iteration["t_fill_only"] = int(iter_list[3]) * multiplyFactor
# iteration["t_alloc_fill"] = int(iter_list[8]) * multiplyFactor
# iteration["t_copy_kernel"] = int(iter_list[9]) * multiplyFactor
# iteration["t_read"] = int(iter_list[10]) * multiplyFactor
# iteration["t_free_mem"] = int(iter_list[11]) * multiplyFactor
#iteration["t_flatten_alloc"] = iter_list[12] osef, c'est la même chose que t_alloc_only
#iteration["t_flatten_fill"] = iter_list[13]
header["iterations"].append(iteration)
#print("Itération {}:".format(i))
#print(iteration)
header_list.append(header)
# print(" __ end header ___ global_kernel_count = " + str(global_kernel_count))
# Lecture de la prochaine ligne
header_line = fp.readline()
# while line fermé
# with file fermé
# print(" ________ FNALLY : global_kernel_count = " + str(global_kernel_count))
#print("header_list:")
#print(header_list)
# Chargement des résultats
# load_file('ubench2_2_sandor_6GiB_RUN1.t', True, 1)
load_file('ubench2_2_' + computer_name + '_6GiB_RUN1.t', True, 1)
print(" ________ AFTER LOAD : global_kernel_count = " + str(global_kernel_count))
global_drawn_x_variables_number = 6 + global_kernel_retain
# Chargement des résultats en graphe de pointeurs
# load_file('acts06_generalGraphPtr_uniqueModules_blopNvidia_AT_ld10_RUN1.t', False)
# load_file('acts06_generalGraphPtr_uniqueModules_sandor_AT_ld100_RUN1.t', False, 1)
## ============ DESSIN ============
# liste de valeurs en x et liste de valeurs en y
# x_list = []
# y_list = []
x_list_shared_direct = []
y_list_shared_direct = []
y_median_shared_direct = []
x_list_shared_copy = []
y_list_shared_copy = []
y_median_shared_copy = []
x_list_host_direct = []
y_list_host_direct = []
y_median_host_direct = []
x_list_host_copy = []
y_list_host_copy = []
y_median_host_copy = []
x_list_device = []
y_list_device = []
y_median_device = []
x_list_glibc = []
y_list_glibc = []
y_median_glibc = []
x_list_acc = []
y_list_acc = []
y_median_acc = []
x_list_curve_drawn = []
x_list_curve_drawn.append("alloc")
x_list_curve_drawn.append("fill")
x_list_curve_drawn.append("copy+ker1")
x_list_curve_drawn.append("ker2")
x_list_curve_drawn.append("dealloc")
divide_by = 1000 # div par 100 seulement pour "simuler" + de données
def nz(value):
# if (value < 0):
# return 0
return value
# 0 shared, 1 device, 2 host, 3 accessors, 20 glibc
# Préparation des données : sélection du run 5 uniquement
for header in header_list:
found = False
print("SYCL mode = " + usm_code_to_str(header["sycl_mode"]) + " explicit_copy = " + str(header["explicit_copy"]))
# print(header["sycl_mode"] + header["IS_FLATTEN"])
# accessors
if header["sycl_mode"] == 3:
x_list = x_list_acc
y_list = y_list_acc
y_median = y_median_acc
found = True
# glibc
if header["sycl_mode"] == 20:
x_list = x_list_glibc
y_list = y_list_glibc
y_median = y_median_glibc
found = True
# device
if header["sycl_mode"] == 1:
x_list = x_list_device
y_list = y_list_device
y_median = y_median_device
found = True
# Copie explicite
if (header["explicit_copy"] == 1) :
# shared copie explicite
if header["sycl_mode"] == 0:
x_list = x_list_shared_copy
y_list = y_list_shared_copy
y_median = y_median_shared_copy
found = True
# host copie explicite
if header["sycl_mode"] == 2:
x_list = x_list_host_copy
y_list = y_list_host_copy
y_median = y_median_host_copy
found = True
else: # copie implicite
# shared copie implicite
if header["sycl_mode"] == 0:
x_list = x_list_shared_direct
y_list = y_list_shared_direct
y_median = y_median_shared_direct
found = True
# host copie implicite
if header["sycl_mode"] == 2:
x_list = x_list_host_direct
y_list = y_list_host_direct
y_median = y_median_host_direct
found = True
# N'est trouvé qu'une seule fois (un seul header correspond)
if found:
x_list.append("native-a")
x_list.append("sycl-a")
x_list.append("fill")
x_list.append("copy")
for ik in range(global_kernel_retain):
x_list.append("ker" + str(ik + 1))
x_list.append("sycl-d")
x_list.append("native-d")
for ips in range(len(x_list)):
y_list.append([])
icount = 0
for iteration in header["iterations"]:
y_list[0].append(nz(iteration["t_alloc_native"]) / divide_by)
y_list[1].append(nz(iteration["t_alloc_sycl"]) / divide_by)
y_list[2].append(nz(iteration["t_fill"]) / divide_by)
y_list[3].append(nz(iteration["t_copy"]) / divide_by)
# read osef
# CONTINUER D'ICI
ker_list = iteration["t_kernel"]
# normalement len(ker_list) == global_kernel_retain
if (len(ker_list) != global_kernel_retain):
sys.exit("--- ERREUR, len(ker_list)(" + str(len(ker_list)) + ") != global_kernel_retain(" + str(global_kernel_retain) + ")")
# Ajout des temps de kernel
for ik in range(global_kernel_retain):
y_list[4 + ik].append(nz(ker_list[ik] / divide_by))
#y_list[4 + ik].append(nz(iteration["ker" + str(ik)] / divide_by))
ik = 4 + global_kernel_retain
y_list[ik].append(nz(iteration["t_dealloc_sycl"]) / divide_by)
y_list[ik + 1].append(nz(iteration["t_dealloc_native"]) / divide_by)
# y_list[0].append(iteration["t_alloc_only"] / divide_by)
# y_list[1].append(iteration["t_fill_only"] / divide_by)
# y_list[2].append(iteration["t_copy_kernel"] / divide_by)
# y_list[3].append(iteration["t_free_mem"] / divide_by)
icount += 1
# Calcul des médianes de chaque courbe
for ii in range(len(x_list)):
y_median.append(stat.median(y_list[ii]))
# y_median.append(stat.median(y_list[1]))
# y_median.append(stat.median(y_list[2]))
# y_median.append(stat.median(y_list[3]))
def draw_violin_plot(name, color, y_list, y_median, linestyle):
c = color
bp_ = plt.violinplot(y_list, showextrema=False)
for pc in bp_['bodies']:
pc.set_facecolor(c)
pc.set_edgecolor(c) # #D43F3A black
pc.set_alpha(1)
def draw_boxplot(name, color, y_list, y_median, linestyle):
c = color
bp_ = plt.boxplot(y_list,
notch=False, patch_artist=True,
boxprops=dict(facecolor=c, color=c),
capprops=dict(color=c),
whiskerprops=dict(color=c),
flierprops=dict(color=c, markeredgecolor=c),
medianprops=dict(color=c))
def merge_some_points(y_list):
y_list_cpy = []
ri = 0
print(y_list)
print("-----")
# Allocation de la liste contenant les listes des valeurs
while ri < len(y_list):
l_cpy = []
l1 = y_list[ri]
print("y_list[" + str(ri) + "] : ")
print(y_list[ri])
if ( (ri == 0) or (ri == 3) or (ri == 6) ):
l2 = y_list[ri + 1]
# somme des deux listes
for rii in range(len(l1)):
l_cpy.append(l1[rii] + l2[rii])
ri += 2
else:
for rii in range(len(l1)):
l_cpy.append(l1[rii])
ri += 1
y_list_cpy.append(l_cpy)
return y_list_cpy
def draw_curve(name, color, y_list, y_median, linestyle):
# Copie et fusion ici des valeurs de l'alloc, dealloc
# Liste de liste de valeurs (une liste de valeurs pour chaque position x)
y_list_cpy = merge_some_points(y_list)
# y_list_cpy.append(y_list[0])# + y_list[1]) # native-a + sycl-a
# y_list_cpy.append(y_list[2]) # fill
# y_list_cpy.append(y_list[3])# + y_list[4]) # copy + kernel1
# y_list_cpy.append(y_list[5]) # kernel 2
# y_list_cpy.append(y_list[6])# + y_list[7]) # sycl-d + native-d
# Liste de valeurs
y_median_cpy = []
y_median_cpy.append(y_median[0] + y_median[1]) # native-a + sycl-a
y_median_cpy.append(y_median[2]) # fill
y_median_cpy.append(y_median[3] + y_median[4]) # copy + kernel1
y_median_cpy.append(y_median[5]) # kernel 2
y_median_cpy.append(y_median[6] + y_median[7]) # sycl-d + native-d
draw_violin_plot(name, color, y_list_cpy, y_median_cpy, linestyle)
plt.plot(range(1, 6), y_median_cpy, color=color, label=name, linestyle=linestyle, linewidth=line_width)
plt.rcParams['grid.linestyle'] = "-"
plt.rcParams['grid.alpha'] = 0.15
plt.rcParams['grid.color'] = "black" ##cccccc
plt.grid(linewidth=line_width/2)
if FLAT_ONLY:
#plt.title("Microbenchmark - accessors & USM device & shared/host direct")
plt.title(computer_name + " - micro-benchmark - USM and accessors")
draw_curve("USM device", "green", y_list_device, y_median_device, "solid")
draw_curve("accessors", "maroon", y_list_acc, y_median_acc, "dashed")
# draw_curve("USM shared copy", "blue", y_list_shared_copy, y_median_shared_copy, "dotted")
# draw_curve("USM host copy", "red", y_list_host_copy, y_median_host_copy, "dashdot")
draw_curve("USM shared", "blue", y_list_shared_direct, y_median_shared_direct, "dotted")
draw_curve("USM host", "red", y_list_host_direct, y_median_host_direct, "dashdot")
# draw_curve("USM shared direct", "blue", y_list_shared_direct, y_median_shared_direct, "solid")
# draw_curve("USM host direct", "red", y_list_host_direct, y_median_host_direct, "solid")
else:
plt.title("SparseCCL - pointer graph vs flat arrays")
#draw_curve("USM device", "green", y_list_device, y_median_device, "solid")
draw_curve("shared flat", "blue", y_list_shared_flat, y_median_shared_flat, "solid")
print("len y_list_shared_flat = " + str(len(y_list_shared_flat)))
print("len y_median_shared_flat = " + str(len(y_median_shared_flat)))
print("len y_list_shared_ptr = " + str(len(y_list_shared_ptr)))
print("len y_median_shared_ptr = " + str(len(y_median_shared_ptr)))
print("len y_list_host_ptr = " + str(len(y_list_host_ptr)))
print("len y_median_host_ptr = " + str(len(y_median_host_ptr)))
draw_curve("shared ptr", "navy", y_list_shared_ptr, y_median_shared_ptr, "dashdot")
#draw_curve("host flat", "red", y_list_host_flat, y_median_host_flat, "solid")
draw_curve("host ptr", "maroon", y_list_host_ptr, y_median_host_ptr, "dashdot")
# ======== Dessin du tableau ========
def array_value_to_str(val):
if (val < 0):
return "-"
if (val < 0.01):
return str(round(val * 1000)/1000)
elif (val < 0.1):
return str(round(val * 100)/100)
elif (val < 1):
return str(round(val * 10)/10)
else:
return str(round(val))
# Ancienne version
# def draw_tab_item(y_median_g):
# st = ""
# su = 0
# for im in range(4): # de 0 à 3 compris
# st = st + array_value_to_str(y_median_g[im])
# su += round(y_median_g[im])
# if (im != 3):
# st = st + " & "
# else:
# st = st + " & " + array_value_to_str(su) + " \\\\"
# return st
def draw_tab_item(cname, short_name, y_median_g):
st = cname + " & "
ssum = 0
# Les premiers champs + 2 kernels
for im in range(global_drawn_x_variables_number): # de 0 à 5 compris
# prendre le kernel2 aussi if (im != 5):
ssum += round(y_median_g[im]) # ne pas prendre en compte ker2
st = st + array_value_to_str(y_median_g[im])
if (im != global_drawn_x_variables_number-1):
st = st + " & "
# skip de 6 et 7, deux kernels
# dealloc sycl + dealloc host
# for im in range(8, 10): # de 8 à 9 compris
# ssum += round(y_median_g[im])
# st = st + array_value_to_str(y_median_g[im])
# if (im != global_drawn_x_variables_number-1):
# st = st + " & "
#else: # affichage du total et fin de ligne
sum_str = array_value_to_str(ssum)
# st = st + " & " + sum_str + " & " + short_name + " \\\\"
st = st + " & " + sum_str + " \\\\"
return st
def draw_tab_item_vert(y_median_a, y_median_b, index):
return (
array_value_to_str(y_median_a[index]) + " & "
+ array_value_to_str(y_median_b[index]) + " \\\\")
def draw_tab_item_vert3(y_median_a, y_median_b, y_median_c, index):
return (
array_value_to_str(y_median_a[index]) + " & "
+ array_value_to_str(y_median_b[index]) + " & "
+ array_value_to_str(y_median_c[index]) + " \\\\" )
# TODO : stocker dans des listes distinctes les cas USM copie explicite et USM accès direct
# pour pouvoir les réutiliser ensuite dans le graphique.
# Affichage dans le terminal du tableau à mettre dans le LaTeX
def draw_tab():
print("\\def\\barr{\\begin{tabular}{c}}")
print("\\def\\earr{\\end{tabular}}")
print("")
print("\\begin{center}")
if tableau_horizontal:
print("\\resizebox{\\linewidth}{!}{%")
print("\\begin{tabular}{||l c c c c c c c c c||} ")
print("\\hline")
# tableau flat seulement
if (FLAT_ONLY):
print("\\barr \\textbf{" + computer_name + "} \\earr")
print("& \\barr alloc \\\\ native \\earr")
print("& \\barr alloc \\\\ sycl \\earr")
print("& \\barr fill \\earr")
print("& \\barr copy \\earr")
print("& \\barr ker\\textsubscript{1} \\earr")
print("& \\barr ker\\textsubscript{2} \\earr")
print("& \\barr dealloc \\\\ sycl \\earr")
print("& \\barr dealloc \\\\ native \\earr")
print("& \\barr total \\earr")
print("\\\\ [0.5ex]")
#print("& native-a & sycl-a & fill & copy & ker\\textsubscript{1} & ker\\textsubscript{2} & sycl-d & native-d & total & \\\\ [0.5ex]")
print("\\hline\\hline")
print(draw_tab_item("USM device", "dev", y_median_device))
print("\\hline")
print(draw_tab_item("accessors", "acc", y_median_acc))
print("\\hline")
print(draw_tab_item("USM shared", "sha", y_median_shared_direct))
print("\\hline")
print(draw_tab_item("USM host", "hos", y_median_host_direct))
# print("\\hline")
# print(draw_tab_item("shared\\_c", "s_c", y_median_shared_copy))
# print("\\hline")
# print(draw_tab_item("shared\\_d", "s_d", y_median_shared_direct))
# print("\\hline")
# print(draw_tab_item("host\\_c", "h_c", y_median_host_copy))
# print("\\hline")
# print(draw_tab_item("host\\_d", "h_d", y_median_host_direct))
else: # tableau flat vs graphe ptr
print("& alloc & fill & kernel & dealloc & total & \\\\ [0.5ex]")
print("\\hline\\hline")
# Bien penser à vérifier que les valeurs sont les mêmes partout dans la publi
print(draw_tab_item("shared flat", y_median_shared_flat))
print("\\hline")
print(draw_tab_item("shared ptr", y_median_shared_ptr))
print("\\hline")
print("TODO : mettre host flat ici")
print("\\hline")
# Host flat à remplacer par la valeur déjà dans le papier
#print(draw_tab_item("host flat", y_median_host_flat))
#print("\\hline")
print(draw_tab_item("host ptr", y_median_host_ptr))
print("\\hline")
print(draw_tab_item("cpu flat", y_median_glibc_flat))
print("\\hline")
print(draw_tab_item("cpu ptr", y_median_glibc_ptr))
# nothing yet
#else:
# Tableau vertical pas encore géré
print("\\hline")
print("\\end{tabular}}")
print("\\end{center}")
print("")
# TODO : relancer un bench sur Sandor (ou ls-cassidi si on y arrive)
# ls-cassidi :
# 2 CPU : Intel(R) Xeon(R) Gold 5218R CPU @ 2.10GHz
# GPU : Quadro RTX A6000
# 187 GiB RAM
# plt.title("SparseCCL - flat arrays")
# #draw_curve("USM device", "green", y_list_device, y_median_device, "solid")
# draw_curve("shared flat", "blue", y_list_shared_flat, y_median_shared_flat, "solid")
# draw_curve("shared ptr", "green", y_list_shared_ptr, y_median_shared_ptr, "dotted")
# #draw_curve("USM host", "maroon", y_list_acc, y_median_acc, "dashed")
# #draw_curve("USM host", "maroon", y_list_host, y_median_host, "dashed")
# Faire l'affichage du tableau de valeurs (x100) et voir ce que ça donne
# par rapport aux précédentes valeurs
# if FLAT_ONLY:
# plt.figure(figsize=(800/my_dpi, 800/my_dpi), dpi=my_dpi)
# else:
# plt.figure(figsize=(800/my_dpi, 800/my_dpi), dpi=my_dpi)
draw_tab()
plt.ylabel('Elapsed time (ms)')
#plt.ylim([-5, 100])
plt.legend()
# global_drawn_x_variables_number+1
plt.xticks(range(1, 6), x_list_curve_drawn) # = x_list_shared et x_list_acc
plt.savefig(output_image_name, format='png') #, dpi=my_dpi)
plt.show()
print ("Hello World!")