import matplotlib.pyplot as plt import numpy as np dim3_physically_contigous = np.array([1944100892, 1929198745, 2147407618, 2361683504, 2229290045, 1936107919, 1950196981, 2316564611, 2415777784, 2251930639, 1917048962, 2122919883, 2305445935, 2216085132, 2061970506, 2077573288, 2415427574]) dmin_3_physically_contigous = sum(dim3_physically_contigous) dim3_regular = np.array([2001205195, 2037350408, 2077998800, 2064361816, 2370004326, 2366505116, 2433485997, 2388982491, 2622710065, 2231849577, 2213896383, 1971144730, 2279336623, 2384236727, 2159066740, 1872922315, 2046840068]) dmin_3_regular = sum(dim3_regular) dim6_contigous = np.array([2472219435, 3473628174, 3146805964, 2747609863, 3624063096, 2299770299, 2731333935, 2500798504, 2279879638, 3989040226, 2595662999, 3715651239, 3293638078, 2723808934, 4183888040, 2437497235, 3262957061, 3260647309, 2145129129, 3874909746, 2471935689, 3143457211, 3450920659, 2570835020, 4197209649, 3325832132, 3041911087, 3848617519, 1973739208, 3773139796, 2737410930, 2907858299, 3813970823, 2856501924, 3505228599, 2432178891, 2854895470, 3602152695, 2576232334 ]) dim_6_contigous = sum(dim6_contigous) dim6_regular = np.array([3512147188, 2931698338, 3130637973, 2799013235, 3256184323, 2992132432, 3041359022, 3094813437, 3028071885, 3380696386, 3018331410, 2899603552, 3264907899, 3002822837, 3045671887, 3119204499, 2953573342, 2963606839, 2855193865, 3043260399, 2972252469, 2503069946, 2958386657, 3033810534, 3007362327, 3026500873, 3159826130, 2504328570, 4058464445, 3218889301, 3597912212, 4181723542, 3749432601, 3654586898, 3557679884, 3322970044, 3630597266, 3130958213, 1019981557]) dim_6_regular = sum(dim6_regular) dim40_contigous = np.array([5271750211, 5947977060, 6406575235, 5511255729, 6423429240, 5094278723, 6242776302, 6297848739, 4590445845, 6764711612, 4610372742, 5903997396, 5747140551, 6300303767, 6640645385, 4818280514, 7823467298, 5828843492, 7619923263, 7891459023, 7387222066, 7941541977, 5433577677, 7362215737, 7053988636, 7387626023, 6945895832, 4915107460, 6745811484, 7802741433, 6808767570, 7717542941, 5557441777, 6274197189, 6839290749, 6583819269, 8175619486, 7374930361, 7496545906, 5787152431, 6970388902, 7150342762, 6374515148, 7086240550, 6014911926, 6805497356, 6787839300, 6029236409, 7045329429, 5463327288, 7023215119, 6305754943, 6040079901, 7642513816, 5399217904, 7615536076, 6947227611, 6886438575, 6525913645, 5704035737, 6001096710, 4595121294, 3891698114, 5754907462, 5581736391, 8438909738, 7281420759, 9120364283, 8975142455, 6194068545, 7645451782, 6244703959, 8436588830, 8530553210, 7617848374, 8172082546, 6812387244, 8703432529, 8613319990, 7501293173, 8216594940, 5673006642, 7168602771, 7846317702, 7094119540, 8854752613, 5455608081, 8407641178, 8338729110, 8119635911, 8981010962, 7495479592, 8554574662, 8404630428, 7519304345, 7136761544, 6528504686, 8236643504, 6831632676, 8347118009, 7641263754, 5707359038, 6748898177, 6066310601, 6943861727, 7098959658, 5212148705, 6824640874, 5583585529, 8003156647, 6415970122, 6830508723, 7041516118, 6892969782, 7126446374, 8238572592, 6702708346, 6612046729, 6731145590, 7182643495, 6166401716, 6391553234, 6638759846, 5539008636, 8406967616, 7660149216, 8431551979, 8269144799, 7734313131, 8403891519, 7258535328, 7776937659, 6064178686, 5770876015, 6982161319, 5235604055, 8101527192, 6046956898, 6827456214, 7874652143, 5025716700, 7506539290, 6196558003, 6656436732, 5956327575, 4626891040, 6350370528, 5249154115, 7566366652, 7035152421, 5894510533, 7071341874, 6305872895, 7188950553, 6518432441, 5956890819, 7441553601, 6285032471, 6776691911, 5916079446, 2984166525 ]) dim_40_contigous = sum(dim40_contigous) dim40_regular = np.array([int(x) for x in """7320333725 8041544574 6359081713 7676718410 7408541973 8549261018 6455940864 7638044083 7852961154 8105713414 8099296359 8588846829 9264198897 7866569227 8241210929 8266772980 9025896341 8543734536 8436388827 8593700407 7449440289 8297109440 8213614706 9250000125 7852953217 8789498566 7365356677 7663656239 7930037512 7141236610 7737423168 8306296388 8693384934 7433924991 7878827892 7671595716 7150009037 8591898274 8167375582 8355489369 7173398288 8066437344 6594406377 7699310879 7502720090 7940562130 6738407130 7831934111 7551421487 8597892604 7251882911 7497411167 7623185317 6601524684 8174240923 7425424118 7689177096 5496078729 5695648325 7096458210 4812243000 8265423889 7406646505 8401794675 8029187256 8262191583 8410556911 8215142659 7977382227 8090414614 8943953292 7822463926 7959987169 7730265183 8736349787 8143049809 6640249510 7530281166 6842877170 7512789107 7638804649 7995198730 7496218179 7181518949 8254413848 8022381985 7361988882 7810130859 7417215012 7872443581 7732389294 7814055171 7463971008 8433179161 7010361542 8758722649 7834208169 7467025814 7909486359 7462899259 8890074348 8072645870 7422221759 8907995744 6612293480 7843416231 8411079708 9525606221 6937922478 7845436454 7864992534 7427672637 8619142087 8731377069 8885281498 7559808728 7173215681 7652102219 6717276768 8244303885 7151149289 7102114957 6526600396 7151648008 7526924470 8040860568 8175611289 7459798487 7145058572 6890657989 7345908520 8924306436 8931634035 8324005045 8599147593 8880835677 8165157302 7460488360 8628914421 8583302346 7934022758 7056421549 8275846606 7009386280 7495129707 7773552723 7645908705 8608406256 8712832214 7664452295 8321095578 8643168243 7250479737 7556324607 7738815689 6796106269 7213420720 7365304658 7297146598""".replace(' ',',').replace('\n','').split(",")]) dim_40_regular = sum(dim40_regular) # dimentions = ("3-dementions", "6-dementions", "40-dementions") # comparitors = { # 'FAT-Pointer based range address': (dmin_3_physically_contigous, dim_6_contigous, dim_40_contigous), # 'System Allocator': (dmin_3_regular, dim_6_regular, dim_40_regular), # } # x = np.arange(len(dimentions)) # the label locations # width = 0.25 # the width of the bars # multiplier = 0 # fig, ax = plt.subplots(layout='constrained') # for attribute, measurement in comparitors.items(): # offset = width * multiplier # rects = ax.bar(x + offset, measurement, width, label=attribute) # ax.bar_label(rects, padding=3) # multiplier += 1 # # Add some text for labels, title and custom x-axis tick labels, etc. # ax.set_ylabel('DTLB L1 reads') # ax.set_title('L1D_TLB') # ax.set_xticks(x + width, dimentions) # ax.legend(loc='upper left', ncols=2) # ax.set_ylim(0, 250) # plt.show() # Sample data categories = ['3 dimentions', '6 dimentions', '40 dimentions'] group_1 = [dmin_3_physically_contigous, dim_6_contigous, dim_40_contigous] group_2 = [dmin_3_regular, dim_6_regular, dim_40_regular] # Number of categories n = len(categories) # Create a bar width bar_width = 0.25 # Create an array with the positions of the bars on the x-axis r1 = np.arange(n) r2 = [x + bar_width for x in r1] # r3 = [x + bar_width for x in r2] # Create the grouped bar graph plt.bar(r1, group_1, color='b', width=bar_width, edgecolor='grey', label='FAT-Pointer based range based addresses') plt.bar(r2, group_2, color='g', width=bar_width, edgecolor='grey', label='System memory allocator') # plt.bar(r3, group_3, color='r', width=bar_width, edgecolor='grey', label='Group 3') # Add xticks on the middle of the grouped bars plt.xlabel('Number of dimentions COZ kmeans', fontweight='bold') plt.xticks([r + bar_width for r in range(n)], categories) # Add labels and title plt.ylabel('DTLB L1 hits', fontweight='bold') plt.title('Sum of DTLB L1 hits') # Add a legend plt.legend() # Show the plot plt.show()