Commit 64fba216 authored by prayagas's avatar prayagas
Browse files

created final plots for report in folder final_figures_report, adapted x axis,...

created final plots for report in folder final_figures_report, adapted x axis, modified the code to add datapoint coordinates to plots (in comments, decided to remove for final plots bcos not uebersichtlich)
parent 7b09208e
# Node: karim-System-Product-Name
# UTC date and time: Thu Dec 23 10:47:35 2021
# Local date and time: Thu Dec 23 10:47:35 2021
# Measurements are in microseconds
type run matrix_size id execution_time
GPU_Kokkos 0 512 0 26515.968000
GPU_Kokkos 1 512 1 27696.640000
GPU_Kokkos 2 512 2 27016.704000
GPU_Kokkos 3 512 3 27295.744000
GPU_Kokkos 4 512 4 21188.608000
GPU_Kokkos 5 512 5 21981.184000
GPU_Kokkos 6 512 6 21570.560000
GPU_Kokkos 7 512 7 21513.216000
GPU_Kokkos 8 512 8 20719.360000
GPU_Kokkos 9 512 9 21357.824000
GPU_Kokkos 10 512 10 21954.048000
GPU_Kokkos 11 512 11 21742.592000
GPU_Kokkos 12 512 12 20018.432000
GPU_Kokkos 13 512 13 20927.744000
GPU_Kokkos 14 512 14 21308.928000
GPU_Kokkos 15 512 15 21918.976000
GPU_Kokkos 16 512 16 21622.528000
GPU_Kokkos 17 512 17 19906.816000
GPU_Kokkos 18 512 18 21087.744000
GPU_Kokkos 19 512 19 21323.776000
GPU_Kokkos 0 1024 20 124157.440000
GPU_Kokkos 1 1024 21 123315.968000
GPU_Kokkos 2 1024 22 122346.496000
GPU_Kokkos 3 1024 23 123382.016000
GPU_Kokkos 4 1024 24 122657.280000
GPU_Kokkos 5 1024 25 122931.968000
GPU_Kokkos 6 1024 26 122963.968000
GPU_Kokkos 7 1024 27 123654.912000
GPU_Kokkos 8 1024 28 123560.704000
GPU_Kokkos 9 1024 29 126196.224000
GPU_Kokkos 10 1024 30 126064.640000
GPU_Kokkos 11 1024 31 123512.064000
GPU_Kokkos 12 1024 32 125294.336000
GPU_Kokkos 13 1024 33 123454.208000
GPU_Kokkos 14 1024 34 122553.088000
GPU_Kokkos 15 1024 35 123980.032000
GPU_Kokkos 16 1024 36 122219.008000
GPU_Kokkos 17 1024 37 123228.928000
GPU_Kokkos 18 1024 38 122706.944000
GPU_Kokkos 19 1024 39 123118.336000
GPU_Kokkos 0 2048 40 553269.504000
GPU_Kokkos 1 2048 41 551142.656000
GPU_Kokkos 2 2048 42 552811.008000
GPU_Kokkos 3 2048 43 551164.672000
GPU_Kokkos 4 2048 44 552062.720000
GPU_Kokkos 5 2048 45 552402.688000
GPU_Kokkos 6 2048 46 551868.928000
GPU_Kokkos 7 2048 47 552023.808000
GPU_Kokkos 8 2048 48 552028.928000
GPU_Kokkos 9 2048 49 552433.664000
GPU_Kokkos 10 2048 50 552578.816000
GPU_Kokkos 11 2048 51 550965.248000
GPU_Kokkos 12 2048 52 553518.336000
GPU_Kokkos 13 2048 53 551093.504000
GPU_Kokkos 14 2048 54 552593.152000
GPU_Kokkos 15 2048 55 553346.816000
GPU_Kokkos 16 2048 56 554440.960000
GPU_Kokkos 17 2048 57 554329.856000
GPU_Kokkos 18 2048 58 554860.032000
GPU_Kokkos 19 2048 59 554696.704000
GPU_Kokkos 0 4096 60 2496947.456000
GPU_Kokkos 1 4096 61 2499862.784000
GPU_Kokkos 2 4096 62 2493820.928000
GPU_Kokkos 3 4096 63 2498381.824000
GPU_Kokkos 4 4096 64 2494387.200000
GPU_Kokkos 5 4096 65 2494673.408000
GPU_Kokkos 6 4096 66 2500543.232000
GPU_Kokkos 7 4096 67 2510030.592000
GPU_Kokkos 8 4096 68 2502733.056000
GPU_Kokkos 9 4096 69 2507410.432000
GPU_Kokkos 10 4096 70 2505050.368000
GPU_Kokkos 11 4096 71 2505374.464000
GPU_Kokkos 12 4096 72 2503054.848000
GPU_Kokkos 13 4096 73 2510338.560000
GPU_Kokkos 14 4096 74 2506091.776000
GPU_Kokkos 15 4096 75 2507724.288000
GPU_Kokkos 16 4096 76 2502790.656000
GPU_Kokkos 17 4096 77 2511044.096000
GPU_Kokkos 18 4096 78 2504792.320000
GPU_Kokkos 19 4096 79 2505710.848000
# Node: karim-System-Product-Name
# UTC date and time: Thu Dec 23 10:47:50 2021
# Local date and time: Thu Dec 23 10:47:50 2021
# Measurements are in microseconds
type run matrix_size id execution_time
CUDA 0 512 0 109089.280000
CUDA 1 512 1 6350.592000
CUDA 2 512 2 4999.168000
CUDA 3 512 3 4339.968000
CUDA 4 512 4 3279.360000
CUDA 5 512 5 2836.224000
CUDA 6 512 6 2782.208000
CUDA 7 512 7 2865.152000
CUDA 8 512 8 3084.800000
CUDA 9 512 9 3272.704000
CUDA 10 512 10 3553.024000
CUDA 11 512 11 3214.848000
CUDA 12 512 12 3085.568000
CUDA 13 512 13 3084.800000
CUDA 14 512 14 3054.336000
CUDA 15 512 15 3684.096000
CUDA 16 512 16 3081.984000
CUDA 17 512 17 2945.024000
CUDA 18 512 18 3055.360000
CUDA 19 512 19 3099.392000
CUDA 0 1024 20 19790.592000
CUDA 1 1024 21 18706.688000
CUDA 2 1024 22 20468.480000
CUDA 3 1024 23 22644.480000
CUDA 4 1024 24 20789.760000
CUDA 5 1024 25 20819.968000
CUDA 6 1024 26 19899.136000
CUDA 7 1024 27 19925.504000
CUDA 8 1024 28 23503.616000
CUDA 9 1024 29 21276.416000
CUDA 10 1024 30 20332.288000
CUDA 11 1024 31 20904.960000
CUDA 12 1024 32 22030.848000
CUDA 13 1024 33 20324.864000
CUDA 14 1024 34 19805.696000
CUDA 15 1024 35 19712.256000
CUDA 16 1024 36 20812.800000
CUDA 17 1024 37 20640.000000
CUDA 18 1024 38 29102.848000
CUDA 19 1024 39 23834.880000
CUDA 0 2048 40 103647.744000
CUDA 1 2048 41 100470.528000
CUDA 2 2048 42 100770.304000
CUDA 3 2048 43 102636.032000
CUDA 4 2048 44 117466.880000
CUDA 5 2048 45 105467.648000
CUDA 6 2048 46 135898.880000
CUDA 7 2048 47 119165.440000
CUDA 8 2048 48 114978.304000
CUDA 9 2048 49 102383.616000
CUDA 10 2048 50 102063.360000
CUDA 11 2048 51 101471.232000
CUDA 12 2048 52 101383.168000
CUDA 13 2048 53 106080.512000
CUDA 14 2048 54 103068.928000
CUDA 15 2048 55 101213.184000
CUDA 16 2048 56 118488.320000
CUDA 17 2048 57 104392.192000
CUDA 18 2048 58 105839.104000
CUDA 19 2048 59 104246.528000
CUDA 0 4096 60 600614.656000
CUDA 1 4096 61 582457.856000
CUDA 2 4096 62 591685.632000
CUDA 3 4096 63 584352.256000
CUDA 4 4096 64 583844.608000
CUDA 5 4096 65 588819.200000
CUDA 6 4096 66 583927.040000
CUDA 7 4096 67 581686.016000
CUDA 8 4096 68 583331.840000
CUDA 9 4096 69 593907.200000
CUDA 10 4096 70 599530.752000
CUDA 11 4096 71 582878.464000
CUDA 12 4096 72 602914.304000
CUDA 13 4096 73 583299.584000
CUDA 14 4096 74 601964.288000
CUDA 15 4096 75 582338.304000
CUDA 16 4096 76 581960.192000
CUDA 17 4096 77 588377.600000
CUDA 18 4096 78 583119.360000
CUDA 19 4096 79 584276.480000
# Node: karim-System-Product-Name
# UTC date and time: Tue Dec 21 21:49:24 2021
# Local date and time: Tue Dec 21 21:49:24 2021
# Measurements are in microseconds
type run w h id execution_time
CUDA 0 1000 1000 0 138841.600000
CUDA 1 1000 1000 1 11858.432000
CUDA 2 1000 1000 2 10101.504000
CUDA 3 1000 1000 3 10213.632000
CUDA 4 1000 1000 4 9597.184000
CUDA 5 1000 1000 5 9698.816000
CUDA 6 1000 1000 6 9897.728000
CUDA 7 1000 1000 7 9978.112000
CUDA 8 1000 1000 8 10617.600000
CUDA 9 1000 1000 9 10126.336000
CUDA 0 5000 5000 10 187833.344000
CUDA 1 5000 5000 11 177232.640000
CUDA 2 5000 5000 12 179487.744000
CUDA 3 5000 5000 13 176667.392000
CUDA 4 5000 5000 14 175878.400000
CUDA 5 5000 5000 15 176020.480000
CUDA 6 5000 5000 16 175760.640000
CUDA 7 5000 5000 17 175934.464000
CUDA 8 5000 5000 18 176269.056000
CUDA 9 5000 5000 19 176770.048000
CUDA 0 10000 10000 20 854958.592000
CUDA 1 10000 10000 21 854482.688000
CUDA 2 10000 10000 22 849811.200000
CUDA 3 10000 10000 23 850546.176000
CUDA 4 10000 10000 24 849984.000000
CUDA 5 10000 10000 25 850098.176000
CUDA 6 10000 10000 26 850039.552000
CUDA 7 10000 10000 27 862969.856000
CUDA 8 10000 10000 28 853675.008000
CUDA 9 10000 10000 29 850582.528000
CUDA 0 15000 15000 30 2005328.128000
CUDA 1 15000 15000 31 2035969.792000
CUDA 2 15000 15000 32 2014517.248000
CUDA 3 15000 15000 33 2022051.840000
CUDA 4 15000 15000 34 2081615.872000
CUDA 5 15000 15000 35 2029124.096000
CUDA 6 15000 15000 36 2025856.000000
CUDA 7 15000 15000 37 2050134.016000
CUDA 8 15000 15000 38 2033458.688000
CUDA 9 15000 15000 39 2029212.160000
# Node: karim-System-Product-Name
# UTC date and time: Tue Dec 21 21:50:11 2021
# Local date and time: Tue Dec 21 21:50:11 2021
# Measurements are in microseconds
type run w h id execution_time
GPU_Kokkos 0 1000 1000 0 2611.456000
GPU_Kokkos 1 1000 1000 1 2767.616000
GPU_Kokkos 2 1000 1000 2 2350.592000
GPU_Kokkos 3 1000 1000 3 2293.504000
GPU_Kokkos 4 1000 1000 4 2610.176000
GPU_Kokkos 5 1000 1000 5 2591.488000
GPU_Kokkos 6 1000 1000 6 2464.000000
GPU_Kokkos 7 1000 1000 7 2407.424000
GPU_Kokkos 8 1000 1000 8 2605.824000
GPU_Kokkos 9 1000 1000 9 2224.640000
GPU_Kokkos 0 5000 5000 10 45213.952000
GPU_Kokkos 1 5000 5000 11 45533.440000
GPU_Kokkos 2 5000 5000 12 42895.616000
GPU_Kokkos 3 5000 5000 13 46778.368000
GPU_Kokkos 4 5000 5000 14 44977.920000
GPU_Kokkos 5 5000 5000 15 43111.936000
GPU_Kokkos 6 5000 5000 16 43269.888000
GPU_Kokkos 7 5000 5000 17 48299.776000
GPU_Kokkos 8 5000 5000 18 49480.960000
GPU_Kokkos 9 5000 5000 19 51074.304000
GPU_Kokkos 0 10000 10000 20 372712.448000
GPU_Kokkos 1 10000 10000 21 363154.176000
GPU_Kokkos 2 10000 10000 22 366655.744000
GPU_Kokkos 3 10000 10000 23 365448.448000
GPU_Kokkos 4 10000 10000 24 364228.096000
GPU_Kokkos 5 10000 10000 25 362124.544000
GPU_Kokkos 6 10000 10000 26 365872.896000
GPU_Kokkos 7 10000 10000 27 364616.960000
GPU_Kokkos 8 10000 10000 28 378042.368000
GPU_Kokkos 9 10000 10000 29 374828.032000
GPU_Kokkos 0 15000 15000 30 974496.000000
GPU_Kokkos 1 15000 15000 31 987127.296000
GPU_Kokkos 2 15000 15000 32 977046.784000
GPU_Kokkos 3 15000 15000 33 1042757.376000
GPU_Kokkos 4 15000 15000 34 1067790.592000
GPU_Kokkos 5 15000 15000 35 1025073.664000
GPU_Kokkos 6 15000 15000 36 1004066.816000
GPU_Kokkos 7 15000 15000 37 1026754.048000
GPU_Kokkos 8 15000 15000 38 1014362.368000
GPU_Kokkos 9 15000 15000 39 994728.704000
This diff is collapsed.
This diff is collapsed.
{
"cells": [
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Incorrect number of arguments: 3\n",
"example call: python3 plot path/to/resultzip plots.zip\n",
"expected command to be 'plot' got -f\n",
"Found old temporary plots directory, deleting...\n",
"Reading file lu_cuda-result-0.txt\n",
"Reading file GPU_kokkos-result-0.txt\n",
"\n",
"Generating plot for CUDA...\n",
"----- Processing for size 512 -----\n",
"Removed 1 outliers\n",
"Mean execution time: 67.04952888888889\n",
"confidence interval: (62.27970673645448, 71.8193510413233)\n",
"----- Processing for size 1024 -----\n",
"Removed 0 outliers\n",
"Mean execution time: 358.1018368\n",
"confidence interval: (353.51361497826866, 362.69005862173134)\n",
"----- Processing for size 2048 -----\n",
"Removed 1 outliers\n",
"Mean execution time: 2104.8772551111115\n",
"confidence interval: (2098.610740003129, 2111.1437702190938)\n",
"----- Processing for size 4096 -----\n",
"Removed 0 outliers\n",
"Mean execution time: 13877.260185600002\n",
"confidence interval: (13795.704850612135, 13958.815520587868)\n",
"--> Storing results to plots/CUDA.png\n",
"\n",
"Generating confidence interval plots...\n",
"--> Storing results to CI_CUDA.png\n",
"\n",
"Generating plot for GPU_Kokkos...\n",
"----- Processing for size 512 -----\n",
"Removed 0 outliers\n",
"Mean execution time: 22.558950400000004\n",
"confidence interval: (22.17339414972038, 22.944506650279628)\n",
"----- Processing for size 1024 -----\n",
"Removed 0 outliers\n",
"Mean execution time: 138.38456320000003\n",
"confidence interval: (137.41786425812884, 139.35126214187122)\n",
"----- Processing for size 2048 -----\n",
"Removed 0 outliers\n",
"Mean execution time: 616.1796095999998\n",
"confidence interval: (614.0501961335189, 618.3090230664808)\n",
"----- Processing for size 4096 -----\n",
"Removed 0 outliers\n",
"Mean execution time: 2767.0726144000005\n",
"confidence interval: (2752.763218767966, 2781.382010032035)\n",
"--> Storing results to plots/GPU_Kokkos.png\n",
"\n",
"Generating confidence interval plots...\n",
"--> Storing results to CI_GPU_Kokkos.png\n",
"\n",
"Generating execution time summary plots...\n",
"HELLO\n",
"HELLO\n",
"--> Storing results to plots/summary_execution_times.png\n"
]
},
{
"data": {
"text/plain": [
"<Figure size 432x288 with 0 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#!/usr/bin/env python\n",
"# coding: utf-8\n",
"\n",
"# In[ ]:\n",
"\n",
"\n",
"# importing the required module\n",
"import glob\n",
"import itertools\n",
"import math\n",
"import os\n",
"import re\n",
"import shutil\n",
"import sys\n",
"import zipfile\n",
"from typing import *\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import scipy.stats as st\n",
"from pandas.core.frame import DataFrame\n",
"from scipy.stats import t\n",
"\n",
"#################################################################################################################\n",
"# Seven summary graphs, either comparing the performance of MPI_Kokkos vs. MPI_OMP, or\n",
"# Kokkos(naive) vs. KokkosDAG vs. OMP.\n",
"# Summary graphs are initialized in the function 'plot_by_size' (after having created all individual graphs)\n",
"# and are plotted by the function 'plot_summary_graphs', which is called at the end of generate_statistics_by_type\n",
"##################################################################################################################\n",
"\n",
"PLOTS_DIR = 'plots'\n",
"EXEC_TIMES_DIR = 'execution_times'\n",
"SPEEDUP_DIR = 'speedups'\n",
"CI_DIR = 'confidence_intervals'\n",
"\n",
"graphs = {}\n",
"\n",
"\n",
"def generate_for_zip(zippath: str, outputzip: str):\n",
" \"\"\" convenience-wrapper around generate_statistics_by_type to deal with zipped results \"\"\"\n",
" with zipfile.ZipFile(zippath, 'r') as zip_ref:\n",
" dir_name = zippath.split('/')[-1].split('.')[0]\n",
" zip_ref.extractall(dir_name)\n",
" print(\"{} contains {} files\".format(\n",
" dir_name, len(os.listdir(dir_name))))\n",
" generate_statistics_by_type(dir_name, outputzip)\n",
" shutil.rmtree(dir_name)\n",
"\n",
"\n",
"def generate_statistics_by_type(path: str, outputzip: str):\n",
" \"\"\" Groups measurements by matrix-size and implementation-type, and plots the\n",
" mean execution times\n",
" \"\"\"\n",
" # setup temporary plots directory\n",
" if os.path.exists(PLOTS_DIR) and os.path.isdir(PLOTS_DIR):\n",
" print(\"Found old temporary plots directory, deleting...\")\n",
" shutil.rmtree(PLOTS_DIR)\n",
" os.mkdir(PLOTS_DIR)\n",
" # setup ConfidenceIntervals directory\n",
" os.mkdir(os.path.join(PLOTS_DIR, CI_DIR))\n",
"\n",
" df_list = []\n",
" \n",
"\n",
" for result_file in os.scandir(path):\n",
" if result_file.is_file():\n",
" print(\"Reading file\", result_file.name)\n",
" df_list.append(pd.read_csv(result_file, skiprows=4,\n",
" sep='\\s+', engine='python'))\n",
" \n",
" for df in df_list:\n",
" # split into problem size\n",
" if 'matrix_size' in df.columns:\n",
" size_col = 'matrix_size'\n",
" else:\n",
" size_col = 'size'\n",
" plot_by_size(df, size_col)\n",
"\n",
" # plot the summary graphs, result is saved in /dphpc_project/Plots/SummaryPlots\n",
" plot_execution_time_summary_graphs(size_col)\n",
"\n",
" # Zip plots dir (not overwriting any existing)\n",
" no_of_files = len(list(filter(lambda fn: outputzip in fn,\n",
" os.listdir('.')))) # add unique id at end of filename\n",
" shutil.make_archive(\"{}_{}\".format(\n",
" outputzip, no_of_files), 'zip', PLOTS_DIR)\n",
"\n",
" # Delete temporary plots dir\n",
" shutil.rmtree(PLOTS_DIR)\n",
"\n",
"\n",
"#####################################\n",
"# ******** Plot functions **********\n",
"#####################################\n",
"\n",
"def plot_by_size(df: DataFrame, size_col: str):\n",
" \"\"\" This function plots process-mean execution time graphs for each implementation\n",
" Datapoints are stored into the summary graphs, which are needed later\n",
" \"\"\"\n",
"\n",
" # type of current df\n",
" t = df['type'].iloc[0]\n",
"\n",
" print(\"\\nGenerating plot for {}...\".format(t))\n",
"\n",
" # list of coordinate points (x,y) where x = size and y = mean execution time\n",
" points = []\n",
" # split into size\n",
" grouped_df = df.groupby(size_col)\n",
" for size in df[size_col].unique():\n",
" df2 = grouped_df.get_group(size)\n",
" print(\"----- Processing for size {} -----\".format(size))\n",
" m, df2, ci, diff = preprocess(df2)\n",
" print(\"Mean execution time: {}\".format(m))\n",
" print(\"confidence interval: {}\".format(ci))\n",
" points.append(((size, m), diff))\n",
"\n",
" # split points into x and y coordinates\n",
" points.sort(key=lambda p: p[0])\n",
" pts, diffs = zip(*points)\n",
" x, y = zip(*pts)\n",
" # plotting the points\n",
" plt.plot(x, y, color='green', linestyle='dashed', linewidth=3,\n",
" marker='o', markerfacecolor='blue', markersize=10)\n",
"\n",
" # create an index for each tick position\n",
" x_ticks = x\n",
" x_labels = x\n",
" #add x-axis values to plot\n",
" plt.xticks(ticks=x_ticks, labels=x_labels)\n",
" # styling\n",
" plt.grid(True)\n",
" plt.tick_params(grid_alpha=0.5)\n",
" _, top_y = plt.ylim()\n",
" margin = 0.1\n",
" plt.ylim(bottom=0, top=(1 + margin)*top_y)\n",
"\n",
" # naming the x axis\n",
" plt.xlabel(size_col)\n",
"\n",
" # naming the y axis\n",
" plt.ylabel('arithmetic mean execution time (ms)')\n",
"\n",
" # giving a title to my graph\n",
" title = t + ' execution time'\n",
" plt.title(title)\n",
"\n",
" filename = '{}/{}.png'.format(PLOTS_DIR, t)\n",
" print(\"--> Storing results to {}\".format(filename))\n",
"\n",
" # function to save and show the plot\n",
" plt.savefig(\"./{}\".format(filename))\n",
" plt.clf()\n",
" \n",
" # generate CI plots\n",
" print(\"\\nGenerating confidence interval plots...\")\n",
" \n",
" diffs = np.array(diffs)\n",
" \n",
" plt.errorbar(x, y, yerr=diffs, fmt='o', markersize = 5, color='black',\n",
" ecolor='grey', elinewidth=3, capsize=5);\n",
" plt.title(\"95% confidence intervals of \" + title)\n",
" # styling\n",
" plt.grid(True)\n",
" plt.tick_params(grid_alpha=0.5)\n",
" # naming the x axis\n",
" plt.xlabel(size_col)\n",
" # naming the y axis\n",
" plt.ylabel('arithmetic mean execution time (ms)')\n",
" \n",
" # setup ConfidenceIntervals directory\n",
" filename2 = 'CI_{}.png'.format(t)\n",
" print(\"--> Storing results to {}\".format(filename2))\n",
" plt.savefig(\"./{}/{}/{}\".format(PLOTS_DIR, CI_DIR, filename2))\n",
" # function to save and show the plot\n",
" plt.close()\n",
" \n",
" # save list of points\n",
" fill_graphs(t, pts)\n",
"\n",
"\n",
"def plot_execution_time_summary_graphs(size_col: str):\n",
" \"\"\" generates execution time summary graphs to facilitate implementation comparisons \"\"\"\n",
"\n",
" print(\"\\nGenerating execution time summary plots...\")\n",
"\n",
" for t, points in graphs.items():\n",
" print('HELLO')\n",
" x, y = zip(*points)\n",
" plt.plot(x, y, label=t, marker='o', markerfacecolor='black', markersize=5)\n",
"\n",
" \n",
" #add x-axis values to plot\n",
" plt.xticks(ticks=x, labels=x)\n",
" # styling\n",
" plt.grid(True)\n",
" plt.tick_params(grid_alpha=0.5)\n",
" _, top_y = plt.ylim()\n",
" margin = 0.1\n",
" plt.ylim(bottom=0, top=(1 + margin)*top_y)\n",
"\n",
" # naming the x axis\n",
" plt.xlabel(size_col)\n",
" # naming the y axis\n",
" plt.ylabel('mean execution time (ms)')\n",
"\n",
" # giving a title to my graph\n",
" title = 'Execution times for GPU implementations'\n",
" plt.title(title)\n",
" plt.legend()\n",
"\n",
" # function to show the plot\n",
" filename = \"{}.png\".format(\"summary_execution_times\")\n",
" print(\"--> Storing results to {}/{}\".format(PLOTS_DIR, filename))\n",
" plt.savefig(\n",
" \"./{}/{}\".format(PLOTS_DIR, filename))\n",
" plt.clf()\n",
"\n",
"\n",
"#####################################\n",
"# ******** Helper functions **********\n",
"#####################################\n",
"def preprocess(df: DataFrame) -> Tuple[int, DataFrame, Tuple[int, int], float]:\n",
" \"\"\" uses Tukey's method for outlier detection and computes the mean \"\"\"\n",
"\n",
" q1 = df['execution_time'].quantile(0.25)\n",
" q3 = df['execution_time'].quantile(0.75)\n",
" iqr = q3-q1\n",
" inner_fence = 1.5*iqr\n",
" outer_fence = 3*iqr\n",
"\n",
" # inner fence lower and upper end\n",
" inner_fence_le = q1-inner_fence\n",