{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "import pandas as pd\n", "from pandas import DataFrame, Series\n", "import numpy as np\n", "import math\n", "import seaborn as sns\n", "import matplotlib.pyplot as plt\n", "import matplotlib.patches as mpatches\n", "import matplotlib.colors as colors\n", "from matplotlib.legend_handler import HandlerLine2D, HandlerTuple\n", "from matplotlib.colors import LinearSegmentedColormap\n", "from scipy import stats\n", "import scikit_posthocs as sp\n", "import sys\n", "\n", "from mpl_toolkits.mplot3d import axes3d" ] }, { "cell_type": "code", "execution_count": 130, "metadata": {}, "outputs": [], "source": [ "AllName=\"dataG.pkl\"\n", "ResizesName=\"dataM.pkl\"\n", "ItersName=\"dataL.pkl\"\n", "matrixIt_Total=\"data_L_Total.csv\"\n", "n_cores=20\n", "repet = 5 #CAMBIAR EL NUMERO SEGUN NUMERO DE EJECUCIONES POR CONFIG\n", "\n", "p_value = 0.05\n", "processes = [2,10,20,40,80,120,160]\n", "\n", "positions = [321, 322, 323, 324, 325]\n", "positions_small = [221, 222, 223, 224]\n", "\n", "labels = ['(1,10)', '(1,20)', '(1,40)', '(1,80)', '(1,120)','(1,160)',\n", " '(10,1)', '(10,20)', '(10,40)', '(10,80)', '(10,120)','(10,160)',\n", " '(20,1)', '(20,10)', '(20,40)', '(20,80)', '(20,120)','(20,160)',\n", " '(40,1)', '(40,10)', '(40,20)', '(40,80)', '(40,120)','(40,160)',\n", " '(80,1)', '(80,10)', '(80,20)', '(80,40)', '(80,120)','(80,160)',\n", " '(120,1)','(120,10)', '(120,20)','(120,40)','(120,80)','(120,160)',\n", " '(160,1)','(160,10)', '(160,20)','(160,40)','(160,80)','(160,120)']\n", "\n", "labelsExpand = ['(1,10)', '(1,20)', '(1,40)', '(1,80)', '(1,120)','(1,160)',\n", " '(10,20)', '(10,40)', '(10,80)', '(10,120)','(10,160)',\n", " '(20,40)', '(20,80)', '(20,120)','(20,160)',\n", " '(40,80)', '(40,120)','(40,160)',\n", " '(80,120)','(80,160)',\n", " '(120,160)']\n", "labelsShrink = ['(10,1)', \n", " '(20,1)', '(20,10)',\n", " '(40,1)', '(40,10)', '(40,20)',\n", " '(80,1)', '(80,10)', '(80,20)', '(80,40)',\n", " '(120,1)','(120,10)', '(120,20)','(120,40)','(120,80)',\n", " '(160,1)','(160,10)', '(160,20)','(160,40)','(160,80)','(160,120)']\n", "\n", "# WORST BEST\n", "labels_dist = ['null', 'SpreadFit', 'CompactFit']\n", " #0 #1 #2 #3\n", "labelsMethods = ['Baseline', 'Baseline single','Baseline - Asynchronous','Baseline single - Asynchronous',\n", " 'Merge','Merge single','Merge - Asynchronous','Merge single - Asynchronous']\n", " #4 #5 #6 #7\n", " \n", "colors_spawn = ['green','springgreen','blue','darkblue','red','darkred','darkgoldenrod','olive','violet']\n", "linestyle_spawn = ['-', '--', '-.', ':']\n", "markers_spawn = ['.','v','s','p', 'h','d','X','P','^']\n", "\n", "OrMult_patch = mpatches.Patch(hatch='', facecolor='green', label='Baseline')\n", "OrSing_patch = mpatches.Patch(hatch='', facecolor='springgreen', label='Baseline single')\n", "OrPthMult_patch = mpatches.Patch(hatch='//', facecolor='blue', label='Baseline - Asyncrhonous')\n", "OrPthSing_patch = mpatches.Patch(hatch='\\\\', facecolor='darkblue', label='Baseline single - Asyncrhonous')\n", "MergeMult_patch = mpatches.Patch(hatch='||', facecolor='red', label='Merge')\n", "MergeSing_patch = mpatches.Patch(hatch='...', facecolor='darkred', label='Merge single')\n", "MergePthMult_patch = mpatches.Patch(hatch='xx', facecolor='yellow', label='Merge - Asyncrhonous')\n", "MergePthSing_patch = mpatches.Patch(hatch='++', facecolor='olive', label='Merge single - Asyncrhonous')\n", "\n", "handles_spawn = [OrMult_patch,OrSing_patch,OrPthMult_patch,OrPthSing_patch,MergeMult_patch,MergeSing_patch,MergePthMult_patch,MergePthSing_patch]" ] }, { "cell_type": "code", "execution_count": 107, "metadata": {}, "outputs": [], "source": [ "dfG = pd.read_pickle( AllName )\n", "\n", "dfG['ADR'] = round((dfG['ADR'] / dfG['DR']) * 100,1)\n", "dfG['SDR'] = round((dfG['SDR'] / dfG['DR']) * 100,1)\n", " \n", "out_group = dfG.groupby(['Groups', 'ADR','Spawn_Method','Redistribution_Method', 'Redistribution_Strategy'])['T_total']\n", "group = dfG.groupby(['ADR','Spawn_Method','Redistribution_Method', 'Redistribution_Strategy','Groups'])['T_total']\n", "\n", "grouped_aggG = group.agg(['median'])\n", "grouped_aggG.rename(columns={'median':'T_total'}, inplace=True) \n", "\n", "out_grouped_G = out_group.agg(['median'])\n", "out_grouped_G.rename(columns={'median':'T_total'}, inplace=True) \n", "out_grouped_G.to_excel(\"resultG.xlsx\") " ] }, { "cell_type": "code", "execution_count": 108, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/tmp/ipykernel_4155/1340609544.py:7: FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be deprecated, use a list instead.\n", " out_group = dfM.groupby(['NP','NC','ADR','Spawn_Method','Redistribution_Method', 'Redistribution_Strategy'])['T_Malleability','T_spawn','T_spawn_real','T_SR','T_AR']\n", "/tmp/ipykernel_4155/1340609544.py:8: FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be deprecated, use a list instead.\n", " group = dfM.groupby(['ADR','Spawn_Method','Redistribution_Method', 'Redistribution_Strategy','NP','NC'])['T_Malleability','T_spawn','T_spawn_real','T_SR','T_AR']\n" ] } ], "source": [ "dfM = pd.read_pickle( ResizesName )\n", "\n", "dfM['ADR'] = round((dfM['ADR'] / dfM['DR']) * 100,1)\n", "dfM['SDR'] = round((dfM['SDR'] / dfM['DR']) * 100,1)\n", "dfM['T_Malleability'] = dfM['T_spawn'] + dfM['T_SR'] + dfM['T_AR']\n", " \n", "out_group = dfM.groupby(['NP','NC','ADR','Spawn_Method','Redistribution_Method', 'Redistribution_Strategy'])['T_Malleability','T_spawn','T_spawn_real','T_SR','T_AR']\n", "group = dfM.groupby(['ADR','Spawn_Method','Redistribution_Method', 'Redistribution_Strategy','NP','NC'])['T_Malleability','T_spawn','T_spawn_real','T_SR','T_AR']\n", "\n", "grouped_aggM = group.agg(['median'])\n", "grouped_aggM.columns = grouped_aggM.columns.get_level_values(0)\n", "\n", "out_grouped_M = out_group.agg(['median'])\n", "out_grouped_M.columns = out_grouped_M.columns.get_level_values(0)\n", "out_grouped_M.to_excel(\"resultM.xlsx\") " ] }, { "cell_type": "code", "execution_count": 133, "metadata": {}, "outputs": [], "source": [ "dfL = pd.read_pickle( ItersName )\n", "\n", "#dfM['ADR'] = round((dfM['ADR'] / dfM['DR']) * 100,1)\n", "#dfM['SDR'] = round((dfM['SDR'] / dfM['DR']) * 100,1)\n", "#dfM['T_Malleability'] = dfM['T_spawn'] + dfM['T_SR'] + dfM['T_AR']\n", " \n", "#out_group = dfM.groupby(['NP','NC','ADR','Spawn_Method','Redistribution_Method', 'Redistribution_Strategy'])['T_Malleability','T_spawn','T_spawn_real','T_SR','T_AR']\n", "#group = dfM.groupby(['ADR','Spawn_Method','Redistribution_Method', 'Redistribution_Strategy','NP','NC'])['T_Malleability','T_spawn','T_spawn_real','T_SR','T_AR']\n", "\n", "#grouped_aggM = group.agg(['median'])\n", "#grouped_aggM.columns = grouped_aggM.columns.get_level_values(0)\n", "\n", "#out_grouped_M = out_group.agg(['median'])\n", "#out_grouped_M.columns = out_grouped_M.columns.get_level_values(0)\n", "#out_grouped_M.to_excel(\"resultM.xlsx\") " ] }, { "cell_type": "code", "execution_count": 106, "metadata": {}, "outputs": [], "source": [ "out_data = dfG.loc[(dfG.Spawn_Method==(0,1)) & (dfG.ADR==0) & (dfG.Redistribution_Method==(0,0)) & (dfG.Redistribution_Strategy==(1,1)) & (dfG.Groups==(10,80))]\n", "out_data.to_excel(\"review2.xlsx\") " ] }, { "cell_type": "code", "execution_count": 138, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | NP | \n", "NC | \n", "Total_Stages | \n", "Granularity | \n", "SDR | \n", "ADR | \n", "DR | \n", "Redistribution_Method | \n", "Redistribution_Strategy | \n", "Spawn_Method | \n", "Spawn_Strategy | \n", "Is_Dynamic | \n", "FactorS | \n", "Dist | \n", "Stage_Types | \n", "Stage_Times | \n", "Stage_Bytes | \n", "Asynch_Iters | \n", "T_iter | \n", "T_stages | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
420500 | \n", "160 | \n", "40.0 | \n", "4 | \n", "100000 | \n", "134228039.0 | \n", "3.813655e+09 | \n", "3.947884e+09 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "False | \n", "0.016612 | \n", "[2, 2] | \n", "(0, 6, 6, 4) | \n", "(0.608531, 0, 0, 0) | \n", "(0, 8, 8, 33176880) | \n", "True | \n", "2.234976 | \n", "(0.037385, 0.118837, 0.086114, 1.792483) | \n", "
421500 | \n", "160 | \n", "40.0 | \n", "4 | \n", "100000 | \n", "134228039.0 | \n", "3.813655e+09 | \n", "3.947884e+09 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "False | \n", "0.016612 | \n", "[2, 2] | \n", "(0, 6, 6, 4) | \n", "(0.608531, 0, 0, 0) | \n", "(0, 8, 8, 33176880) | \n", "True | \n", "2.416995 | \n", "(0.02672, 0.125521, 0.081292, 1.784105) | \n", "
422500 | \n", "160 | \n", "40.0 | \n", "4 | \n", "100000 | \n", "134228039.0 | \n", "3.813655e+09 | \n", "3.947884e+09 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "False | \n", "0.016612 | \n", "[2, 2] | \n", "(0, 6, 6, 4) | \n", "(0.608531, 0, 0, 0) | \n", "(0, 8, 8, 33176880) | \n", "True | \n", "2.187999 | \n", "(0.131866, 0.032969, 0.051701, 1.742342) | \n", "
423500 | \n", "160 | \n", "40.0 | \n", "4 | \n", "100000 | \n", "134228039.0 | \n", "3.813655e+09 | \n", "3.947884e+09 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "False | \n", "0.016612 | \n", "[2, 2] | \n", "(0, 6, 6, 4) | \n", "(0.608531, 0, 0, 0) | \n", "(0, 8, 8, 33176880) | \n", "True | \n", "2.244867 | \n", "(0.010719, 0.119629, 0.07511, 1.789791) | \n", "
424500 | \n", "160 | \n", "40.0 | \n", "4 | \n", "100000 | \n", "134228039.0 | \n", "3.813655e+09 | \n", "3.947884e+09 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "1.0 | \n", "False | \n", "0.016612 | \n", "[2, 2] | \n", "(0, 6, 6, 4) | \n", "(0.608531, 0, 0, 0) | \n", "(0, 8, 8, 33176880) | \n", "True | \n", "2.259979 | \n", "(0.034214, 0.061322, 0.063906, 1.861178) | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2510500 | \n", "80 | \n", "160.0 | \n", "4 | \n", "100000 | \n", "134228039.0 | \n", "3.813655e+09 | \n", "3.947884e+09 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "False | \n", "0.030397 | \n", "[2, 2] | \n", "(0, 6, 6, 4) | \n", "(0.608531, 0, 0, 0) | \n", "(0, 8, 8, 33176880) | \n", "True | \n", "0.250689 | \n", "(0.01873, 0.084494, 0.001038, 0.143586) | \n", "
2511500 | \n", "80 | \n", "160.0 | \n", "4 | \n", "100000 | \n", "134228039.0 | \n", "3.813655e+09 | \n", "3.947884e+09 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "False | \n", "0.030397 | \n", "[2, 2] | \n", "(0, 6, 6, 4) | \n", "(0.608531, 0, 0, 0) | \n", "(0, 8, 8, 33176880) | \n", "True | \n", "0.281567 | \n", "(0.018751, 0.039149, 0.01087, 0.212796) | \n", "
2512500 | \n", "80 | \n", "160.0 | \n", "4 | \n", "100000 | \n", "134228039.0 | \n", "3.813655e+09 | \n", "3.947884e+09 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "False | \n", "0.030397 | \n", "[2, 2] | \n", "(0, 6, 6, 4) | \n", "(0.608531, 0, 0, 0) | \n", "(0, 8, 8, 33176880) | \n", "True | \n", "0.313766 | \n", "(0.018743, 0.080215, 0.018336, 0.191758) | \n", "
2513500 | \n", "80 | \n", "160.0 | \n", "4 | \n", "100000 | \n", "134228039.0 | \n", "3.813655e+09 | \n", "3.947884e+09 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "False | \n", "0.030397 | \n", "[2, 2] | \n", "(0, 6, 6, 4) | \n", "(0.608531, 0, 0, 0) | \n", "(0, 8, 8, 33176880) | \n", "True | \n", "0.398377 | \n", "(0.018734, 0.054583, 0.03555, 0.289509) | \n", "
2514500 | \n", "80 | \n", "160.0 | \n", "4 | \n", "100000 | \n", "134228039.0 | \n", "3.813655e+09 | \n", "3.947884e+09 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "1.0 | \n", "False | \n", "0.030397 | \n", "[2, 2] | \n", "(0, 6, 6, 4) | \n", "(0.608531, 0, 0, 0) | \n", "(0, 8, 8, 33176880) | \n", "True | \n", "0.509275 | \n", "(0.018742, 0.086675, 0.018152, 0.382491) | \n", "
1398 rows × 20 columns
\n", "