Advertisement
Danila_lipatov

Plot_results_mult_matrices

Oct 6th, 2024
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 9.29 KB | None | 0 0
  1.  
  2. dict_avar = {'1500': {1: [0.090046,0.086779,0.086878,0.086997,0.086931,0.086800,0.086884,0.086918,0.086858,0.089743,0.088727,0.086515,0.086465,0.086600,0.086484,0.086579,0.086592,0.086574,0.086506,0.086574,0.086506,0.086453,0.086514,0.086548,0.086537,0.086726,0.086488,0.086537,0.086542,0.086536,0.086503,0.086506,0.088360,0.086854,0.086566,0.086607,0.086582,0.086545,0.086413,0.086578,0.086478,0.086531,0.086497,0.086673,0.086495,0.086639,0.086684,0.086514,0.086497,0.086632],
  3.                       2: [0.081369,0.057834,0.048522,0.046938,0.047073,0.047067,0.047083,0.047040,0.047120,0.047117,0.047070,0.047006,0.046832,0.047002,0.046894,0.046913,0.046895,0.046991,0.046946,0.046864,0.046711,0.046526,0.046150,0.045912,0.045878,0.045948,0.045925,0.045797,0.045707,0.045714,0.045905,0.045825,0.045679,0.045808,0.045728,0.045743,0.045749,0.046711,0.046282,0.046108,0.046459,0.046547,0.046522,0.046539,0.046576,0.046553,0.046620,0.046592,0.046543,0.046682],
  4.                       4: [0.044784,0.034877,0.029926,0.026737,0.024391,0.023661,0.023711,0.023837,0.023623,0.023664,0.023671,0.023601,0.023557,0.023755,0.023757,0.023530,0.023746,0.023759,0.023591,0.023642,0.023582,0.023701,0.023824,0.023669,0.023690,0.023667,0.023790,0.023652,0.023755,0.023679,0.023732,0.023702,0.023718,0.023774,0.023672,0.023626,0.023717,0.023852,0.023661,0.023579,0.023647,0.023727,0.023734,0.023691,0.023935,0.023843,0.023766,0.023761,0.023738,0.023854],
  5.                       8: [0.025277,0.021492,0.019283,0.017317,0.016623,0.015247,0.014688,0.014271,0.013812,0.013707,0.013212,0.013411,0.013275,0.013362,0.013332,0.013396,0.013293,0.013340,0.013563,0.013253,0.013272,0.013538,0.013624,0.013562,0.013322,0.013455,0.013369,0.013363,0.013276,0.013532,0.013291,0.013409,0.013423,0.013205,0.013531,0.013213,0.013307,0.013546,0.013615,0.013249,0.013501,0.013528,0.013463,0.013402,0.013347,0.013680,0.013558,0.013580,0.013690,0.013704],
  6.                       16: [0.020047,0.012087,0.011459,0.010958,0.010344,0.010004,0.009808,0.009596,0.009199,0.008991,0.009001,0.008874,0.008796,0.008723,0.008740,0.008788,0.009042,0.008832,0.008729,0.008640,0.008758,0.008767,0.008862,0.008822,0.008733,0.008654,0.008780,0.008851,0.008760,0.008920,0.008778,0.008931,0.008763,0.008887,0.008789,0.008780,0.008773,0.008770,0.008905,0.008928,0.008783,0.008831,0.008957,0.008933,0.008874,0.008707,0.008924,0.008695,0.008648,0.008827]},
  7.                       # 18: [0.007672,0.007259,0.007596,0.007309,0.007143,0.007384,0.007504,0.007743,0.007563,0.007446,0.007228,0.007152,0.007402,0.008225,0.007132,0.007286,0.007634,0.007455,0.007186,0.007054,0.007989,0.007643,0.008871,0.011551,0.011855,0.011255,0.011087,0.011180,0.010483,0.009838,0.009174,0.009186,0.008396,0.008123,0.007983,0.008147,0.007709,0.007752,0.007621,0.007584,0.007367,0.008359,0.007213,0.007376,0.007548,0.007331,0.007191,0.007272,0.008093,0.007425],
  8.                       # 32: [0.016556,0.023354,0.018903,0.018759,0.023469,0.022167,0.020627,0.018591,0.023949,0.018442,0.025602,0.017227,0.022961,0.021451,0.018025,0.017869,0.023896,0.022669,0.018505,0.025161,0.020621,0.018597,0.022264,0.017604,0.024562,0.019213,0.023122,0.021470,0.017992,0.022384,0.018122,0.021392,0.017743,0.023154,0.018937,0.023311,0.022156,0.018155,0.021665,0.022681,0.018169,0.023650,0.018690,0.022812,0.017995,0.022573,0.018708,0.023231,0.017196,0.022636]}}
  9.              '1000': {1: [0.034043,0.028735,0.026517,0.026223,0.026197,0.026237,0.026207,0.026181,0.026239,0.026220,0.026203,0.026191,0.026161,0.026201,0.026164,0.026205,0.026191,0.026173,0.026186,0.026176,0.026484,0.026197,0.026227,0.026207,0.026181,0.026212,0.026182,0.026206,0.026179,0.026185,0.026207,0.026170,0.026169,0.026183,0.026176,0.026193,0.026192,0.026209,0.026211,0.026181,0.026206,0.026179,0.026206,0.026198,0.026170,0.026195,0.026220,0.026164,0.026185,0.026200],
  10.                       2: [0.028016,0.022962,0.020281,0.018492,0.017032,0.015958,0.015010,0.014279,0.013619,0.013244,0.013269,0.013254,0.013270,0.013227,0.013249,0.013267,0.013260,0.013252,0.013243,0.013305,0.013270,0.013274,0.013270,0.013264,0.013270,0.013267,0.013272,0.013261,0.013250,0.013283,0.013302,0.013263,0.013238,0.013249,0.013259,0.013248,0.013290,0.013275,0.013279,0.013262,0.014102,0.013457,0.013244,0.013254,0.013283,0.013240,0.013222,0.013283,0.013242,0.013237],
  11.                       4: [0.017864,0.014822,0.013777,0.012848,0.012290,0.011645,0.011405,0.010813,0.010524,0.009992,0.009943,0.009556,0.009460,0.008843,0.008759,0.008676,0.008696,0.008486,0.008869,0.008475,0.008796,0.008706,0.008693,0.008877,0.008779,0.008568,0.008810,0.008731,0.008717,0.008899,0.008680,0.008876,0.008760,0.008711,0.008720,0.008715,0.008792,0.008765,0.008838,0.008802,0.008722,0.008754,0.008835,0.008743,0.008722,0.008623,0.008788,0.008790,0.008824,0.008867],
  12.                       8: [0.009953,0.008364,0.007847,0.007856,0.007269,0.006909,0.006943,0.006622,0.006478,0.006314,0.006157,0.006107,0.005789,0.005685,0.005785,0.005575,0.005308,0.005555,0.005345,0.005221,0.005206,0.005126,0.005042,0.005025,0.005051,0.004878,0.004928,0.004976,0.004965,0.004972,0.004797,0.004949,0.004996,0.004942,0.004940,0.004910,0.004842,0.004934,0.004800,0.004907,0.004905,0.004861,0.004935,0.005017,0.004867,0.004990,0.004948,0.004907,0.004975,0.004793],
  13.                       16: [0.005405,0.004780,0.004587,0.004447,0.004437,0.004214,0.004223,0.004123,0.003953,0.003980,0.003850,0.003887,0.003845,0.003647,0.003733,0.003715,0.003563,0.003526,0.003565,0.003474,0.003462,0.003415,0.003332,0.003320,0.003328,0.003217,0.003210,0.003225,0.003199,0.003273,0.003180,0.003127,0.003126,0.003211,0.003130,0.003282,0.003308,0.003182,0.003123,0.003238,0.003176,0.003105,0.003149,0.003131,0.003136,0.003156,0.003141,0.003126,0.003025,0.003177]},
  14.              '500': {1: [0.006800,0.005744,0.005465,0.005395,0.005168,0.005099,0.004946,0.004839,0.004766,0.004595,0.004600,0.004402,0.004382,0.004292,0.004179,0.004171,0.004053,0.003993,0.003979,0.003828,0.003829,0.003809,0.003675,0.003682,0.003649,0.003539,0.003548,0.003525,0.003425,0.003421,0.003425,0.003420,0.003418,0.003424,0.003412,0.003415,0.003412,0.003410,0.003413,0.003412,0.003418,0.003414,0.003421,0.003419,0.003418,0.003424,0.003419,0.003423,0.003424,0.003419],
  15.                      2: [0.005352,0.004536,0.004298,0.004115,0.004093,0.003854,0.003838,0.003891,0.003673,0.003687,0.003642,0.003449,0.003415,0.003412,0.003328,0.003363,0.003347,0.003174,0.003092,0.003194,0.003168,0.003024,0.003008,0.003066,0.002943,0.002841,0.002918,0.002896,0.002730,0.002788,0.002813,0.002792,0.002729,0.002745,0.002665,0.002682,0.002625,0.002576,0.002633,0.002597,0.002510,0.002495,0.002542,0.002493,0.002465,0.002440,0.002402,0.002480,0.002427,0.002330],
  16.                      4: [0.003236,0.002155,0.002141,0.002141,0.002165,0.002037,0.001994,0.001998,0.001998,0.001982,0.001890,0.001851,0.001872,0.001839,0.001846,0.001859,0.001783,0.001744,0.001726,0.001718,0.001722,0.001735,0.001672,0.001646,0.001629,0.001631,0.001626,0.001639,0.001601,0.001564,0.001566,0.001555,0.001548,0.001539,0.001555,0.001491,0.001503,0.001471,0.001490,0.001472,0.001488,0.001477,0.001442,0.001419,0.001410,0.001429,0.001418,0.001410,0.001405,0.001424],
  17.                      8: [0.001842,0.001197,0.001187,0.001195,0.001186,0.001195,0.001188,0.001189,0.001194,0.001143,0.001108,0.001112,0.001112,0.001118,0.001103,0.001113,0.001116,0.001113,0.001088,0.001065,0.001071,0.001075,0.001053,0.001077,0.001065,0.001072,0.001062,0.001077,0.001023,0.001020,0.001023,0.001020,0.001015,0.001020,0.001028,0.001026,0.001024,0.001029,0.001014,0.000990,0.000987,0.000993,0.000987,0.000979,0.000987,0.000987,0.000989,0.000982,0.000985,0.000948],
  18.                      16: [0.001997,0.000828,0.000840,0.000843,0.000844,0.000843,0.000830,0.000848,0.000845,0.000836,0.000839,0.000795,0.000733,0.000753,0.000748,0.000734,0.000759,0.000751,0.000746,0.000749,0.000759,0.000758,0.000746,0.000760,0.000736,0.000743,0.000706,0.000696,0.000705,0.000710,0.000712,0.000697,0.000705,0.000710,0.000703,0.000708,0.000707,0.000700,0.000704,0.000702,0.000688,0.000686,0.000682,0.000677,0.000675,0.000692,0.000689,0.000670,0.000681,0.000692]
  19.                     }
  20.             }
  21.  
  22.  
  23.  
  24. result_dict_time = {}
  25. for key, vals in dict_avar.items():
  26.     if key not in result_dict_time:
  27.         result_dict_time[key] = {}
  28.     for k, v in vals.items():
  29.         if k not in result_dict_time[key]:
  30.             result_dict_time[key][k] = 0
  31.         result_dict_time[key][k] = sum(dict_avar[key][k]) / len(dict_avar[key][k])
  32. df_avat = pd.DataFrame().from_dict(result_dict_time).T
  33. for row in df_avat.iterrows():
  34.     print(row[1].index)
  35.     plt.plot(row[1].index, row[1])
  36. plt.legend(labels=df_avat.index)
  37. plt.title("Optimization O3")
  38. plt.xlabel("Num. of process")
  39. plt.ylabel("Time in seconds")
  40. plt.show()
  41.  
  42.  
  43.  
  44. result_dict_flops = {}
  45. for key, vals in dict_avar.items():
  46.     if key not in result_dict_flops:
  47.         result_dict_flops[key] = {}
  48.     for k, v in vals.items():
  49.         if k not in result_dict_flops[key]:
  50.             result_dict_flops[key][k] = 0
  51.         result_dict_flops[key][k] = (2 * int(key) ** 3 / (sum(dict_avar[key][k]) / len(dict_avar[key][k]))) / 10 ** 9
  52. df_flops = pd.DataFrame().from_dict(result_dict_flops).T
  53. for row in df_flops.iterrows():
  54.     print(row[1].index)
  55.     plt.plot(row[1].index, row[1])
  56. df_flops.to_excel('test_flops.xlsx')
  57. plt.legend(labels=df_flops.index)
  58. plt.title("Optimization O3")
  59. plt.xlabel("Num. of process")
  60. plt.ylabel("GFLOPS")
  61. plt.show()
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement