{ "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 seaborn as sns\n", "import matplotlib.pyplot as plt\n", "import matplotlib.patches as mpatches\n", "from matplotlib.legend_handler import HandlerLine2D, HandlerTuple\n", "from scipy import stats\n", "import sys" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "matrixMalEX=\"data_GG.csv\"\n", "matrixMal=\"data_GM.csv\"\n", "matrixIt=\"data_L.csv\"\n", "n_qty=2 #CAMBIAR SEGUN LA CANTIDAD DE NODOS USADOS\n", "n_groups= 2\n", "repet = 3 #CAMBIAR EL PRIMER NUMERO SEGUN NUMERO DE EJECUCIONES POR CONFIG\n", "\n", "p_value = 0.05\n", "values = [2, 10, 20, 40]\n", "dist_names = ['null', 'BestFit', 'WorstFit']\n", "\n", "labelsP = [['(2,2)', '(2,10)', '(2,20)', '(2,40)'],['(10,2)', '(10,10)', '(10,20)', '(10,40)'],\n", " ['(20,2)', '(20,10)', '(20,20)', '(20,40)'],['(40,2)', '(40,10)', '(40,20)', '(40,40)']]\n", "labelsP_J = ['(2,2)', '(2,10)', '(2,20)', '(2,40)','(10,2)', '(10,10)', '(10,20)', '(10,40)',\n", " '(20,2)', '(20,10)', '(20,20)', '(20,40)','(40,2)', '(40,10)', '(40,20)', '(40,40)']\n", "positions = [321, 322, 323, 324, 325]\n", "positions_small = [221, 222, 223, 224]" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "dfG = pd.read_csv( matrixMalEX )\n", "\n", "dfG = dfG.drop(columns=dfG.columns[0])\n", "dfG['S'] = dfG['N']\n", "dfG['N'] = dfG['S'] + dfG['%Async']\n", "dfG['%Async'] = (dfG['%Async'] / dfG['N']) * 100\n", "\n", "if(n_qty == 1):\n", " group = dfG.groupby(['%Async', 'Groups'])['TE']\n", "else: \n", " group = dfG.groupby(['Dist', '%Async', 'Groups'])['TE']\n", "\n", "#group\n", "grouped_aggG = group.agg(['mean'])\n", "grouped_aggG.rename(columns={'mean':'TE',}, inplace=True)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "dfM = pd.read_csv( matrixMal )\n", "dfM = dfM.drop(columns=dfM.columns[0])\n", "\n", "dfM['S'] = dfM['N']\n", "dfM['N'] = dfM['S'] + dfM['%Async']\n", "dfM[\"TR\"] = dfM[\"TC\"] + dfM[\"TS\"] + dfM[\"TA\"]\n", "dfM['%Async'] = (dfM['%Async'] / dfM['N']) * 100\n", "\n", "if(n_qty == 1):\n", " groupM = dfM.groupby(['%Async','NP', 'NS'])['TC', 'TS', 'TA', 'TR']\n", "else:\n", " groupM = dfM.groupby(['Dist', '%Async','NP', 'NS'])['TC', 'TS', 'TA', 'TR']\n", "\n", "#group\n", "grouped_aggM = groupM.agg(['mean'])\n", "grouped_aggM.columns = grouped_aggM.columns.get_level_values(0)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/usuario/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:12: FutureWarning: set_axis currently defaults to operating inplace.\n", "This will change in a future version of pandas, use inplace=True to avoid this warning.\n", " if sys.path[0] == '':\n" ] } ], "source": [ "dfL = pd.read_csv( matrixIt )\n", "dfL = dfL.drop(columns=dfL.columns[0])\n", "\n", "if(n_qty == 1):\n", " groupL = dfL[dfL['NS'] != 0].groupby(['Tt', '%Async', 'NP', 'NS'])['Ti', 'To']\n", "else:\n", " groupL = dfL[dfL['NS'] != 0].groupby(['Tt', 'Dist', '%Async', 'NP', 'NS'])['Ti', 'To']\n", "\n", "#group\n", "grouped_aggL = groupL.agg(['mean', 'count'])\n", "grouped_aggL.columns = grouped_aggL.columns.get_level_values(0)\n", "grouped_aggL.set_axis(['Ti', 'Iters', 'To', 'Iters2'], axis='columns')\n", "\n", "grouped_aggL['Iters'] = np.round(grouped_aggL['Iters']/repet)\n", "grouped_aggL['Iters2'] = np.round(grouped_aggL['Iters2']/repet)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "grouped_aggL.to_excel(\"resultL.xlsx\") \n", "grouped_aggM.to_excel(\"resultM.xlsx\") \n", "grouped_aggG.to_excel(\"resultG.xlsx\") " ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | N | \n", "%Async | \n", "Groups | \n", "Dist | \n", "Matrix | \n", "CommTam | \n", "Time | \n", "Iters | \n", "TE | \n", "S | \n", "
---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1000000000 | \n", "0.0 | \n", "20,40 | \n", "2,2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "24.655622 | \n", "1000000000 | \n", "
1 | \n", "1000000000 | \n", "0.0 | \n", "20,40 | \n", "2,2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "24.614192 | \n", "1000000000 | \n", "
2 | \n", "1000000000 | \n", "0.0 | \n", "20,40 | \n", "2,2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "24.561815 | \n", "1000000000 | \n", "
3 | \n", "1000000000 | \n", "75.0 | \n", "10,40 | \n", "1,1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "25.073783 | \n", "250000000 | \n", "
4 | \n", "1000000000 | \n", "75.0 | \n", "10,40 | \n", "1,1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "24.690559 | \n", "250000000 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
475 | \n", "1000000000 | \n", "50.0 | \n", "10,10 | \n", "2,2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "22.716362 | \n", "500000000 | \n", "
476 | \n", "1000000000 | \n", "50.0 | \n", "10,10 | \n", "2,2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "22.787608 | \n", "500000000 | \n", "
477 | \n", "1000000000 | \n", "50.0 | \n", "40,20 | \n", "1,1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "26.209435 | \n", "500000000 | \n", "
478 | \n", "1000000000 | \n", "50.0 | \n", "40,20 | \n", "1,1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "26.113280 | \n", "500000000 | \n", "
479 | \n", "1000000000 | \n", "50.0 | \n", "40,20 | \n", "1,1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "25.939109 | \n", "500000000 | \n", "
480 rows × 10 columns
\n", "\n", " | \n", " | \n", " | TE | \n", "
---|---|---|---|
Dist | \n", "%Async | \n", "Groups | \n", "\n", " |
1,1 | \n", "0.0 | \n", "10,10 | \n", "22.484111 | \n", "
10,2 | \n", "22.759883 | \n", "||
10,20 | \n", "22.714897 | \n", "||
10,40 | \n", "23.945593 | \n", "||
2,10 | \n", "22.787837 | \n", "||
... | \n", "... | \n", "... | \n", "... | \n", "
2,2 | \n", "100.0 | \n", "20,40 | \n", "26.541437 | \n", "
40,10 | \n", "25.792615 | \n", "||
40,2 | \n", "24.536055 | \n", "||
40,20 | \n", "27.124025 | \n", "||
40,40 | \n", "27.393826 | \n", "
160 rows × 1 columns
\n", "\n", " | N | \n", "%Async | \n", "NP | \n", "NS | \n", "Dist | \n", "Matrix | \n", "CommTam | \n", "Time | \n", "Iters | \n", "TC | \n", "TS | \n", "TA | \n", "S | \n", "TR | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1000000000 | \n", "0.0 | \n", "20 | \n", "40 | \n", "2,2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "1.380795 | \n", "1.179880 | \n", "0.000000 | \n", "1000000000 | \n", "2.560675 | \n", "
1 | \n", "1000000000 | \n", "0.0 | \n", "20 | \n", "40 | \n", "2,2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "1.444811 | \n", "1.031978 | \n", "0.000000 | \n", "1000000000 | \n", "2.476789 | \n", "
2 | \n", "1000000000 | \n", "0.0 | \n", "20 | \n", "40 | \n", "2,2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "1.429329 | \n", "1.019891 | \n", "0.000000 | \n", "1000000000 | \n", "2.449220 | \n", "
3 | \n", "1000000000 | \n", "75.0 | \n", "10 | \n", "40 | \n", "1,1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "1.275007 | \n", "0.159546 | \n", "3.739863 | \n", "250000000 | \n", "5.174416 | \n", "
4 | \n", "1000000000 | \n", "75.0 | \n", "10 | \n", "40 | \n", "1,1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "1.218877 | \n", "0.136006 | \n", "3.434968 | \n", "250000000 | \n", "4.789851 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
475 | \n", "1000000000 | \n", "50.0 | \n", "10 | \n", "10 | \n", "2,2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "0.550302 | \n", "0.039950 | \n", "2.183129 | \n", "500000000 | \n", "2.773381 | \n", "
476 | \n", "1000000000 | \n", "50.0 | \n", "10 | \n", "10 | \n", "2,2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "0.565259 | \n", "0.041073 | \n", "2.220328 | \n", "500000000 | \n", "2.826660 | \n", "
477 | \n", "1000000000 | \n", "50.0 | \n", "40 | \n", "20 | \n", "1,1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "1.126832 | \n", "0.377649 | \n", "4.985516 | \n", "500000000 | \n", "6.489997 | \n", "
478 | \n", "1000000000 | \n", "50.0 | \n", "40 | \n", "20 | \n", "1,1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "1.136094 | \n", "0.399998 | \n", "4.883929 | \n", "500000000 | \n", "6.420021 | \n", "
479 | \n", "1000000000 | \n", "50.0 | \n", "40 | \n", "20 | \n", "1,1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "1,10 | \n", "1.100109 | \n", "0.345791 | \n", "4.765733 | \n", "500000000 | \n", "6.211633 | \n", "
480 rows × 14 columns
\n", "\n", " | \n", " | \n", " | \n", " | TC | \n", "TS | \n", "TA | \n", "TR | \n", "
---|---|---|---|---|---|---|---|
Dist | \n", "%Async | \n", "NP | \n", "NS | \n", "\n", " | \n", " | \n", " | \n", " |
1,1 | \n", "0.0 | \n", "2 | \n", "2 | \n", "0.241944 | \n", "0.327792 | \n", "0.000000 | \n", "0.569736 | \n", "
10 | \n", "0.303633 | \n", "0.438643 | \n", "0.000000 | \n", "0.742276 | \n", "|||
20 | \n", "0.440566 | \n", "0.502550 | \n", "0.000000 | \n", "0.943115 | \n", "|||
40 | \n", "0.973248 | \n", "0.625712 | \n", "0.000000 | \n", "1.598960 | \n", "|||
10 | \n", "2 | \n", "0.266382 | \n", "0.420096 | \n", "0.000000 | \n", "0.686478 | \n", "||
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2,2 | \n", "100.0 | \n", "20 | \n", "40 | \n", "1.398970 | \n", "0.000000 | \n", "5.048009 | \n", "6.446979 | \n", "
40 | \n", "2 | \n", "0.614688 | \n", "0.000000 | \n", "3.868392 | \n", "4.483079 | \n", "||
10 | \n", "1.019837 | \n", "0.000000 | \n", "4.705335 | \n", "5.725172 | \n", "|||
20 | \n", "1.385920 | \n", "0.000000 | \n", "5.640753 | \n", "7.026673 | \n", "|||
40 | \n", "1.477186 | \n", "0.000000 | \n", "5.811504 | \n", "7.288690 | \n", "
160 rows × 4 columns
\n", "\n", " | N | \n", "%Async | \n", "NP | \n", "N_par | \n", "NS | \n", "Dist | \n", "Compute_tam | \n", "Comm_tam | \n", "Time | \n", "Iters | \n", "Ti | \n", "Tt | \n", "To | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1000000000 | \n", "0.0 | \n", "40 | \n", "20 | \n", "0 | \n", "2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "10 | \n", "2.039676 | \n", "0.0 | \n", "2242.0 | \n", "
1 | \n", "1000000000 | \n", "0.0 | \n", "40 | \n", "20 | \n", "0 | \n", "2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "10 | \n", "2.002848 | \n", "0.0 | \n", "2242.0 | \n", "
2 | \n", "1000000000 | \n", "0.0 | \n", "40 | \n", "20 | \n", "0 | \n", "2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "10 | \n", "2.002108 | \n", "0.0 | \n", "2242.0 | \n", "
3 | \n", "1000000000 | \n", "0.0 | \n", "40 | \n", "20 | \n", "0 | \n", "2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "10 | \n", "2.002966 | \n", "0.0 | \n", "2242.0 | \n", "
4 | \n", "1000000000 | \n", "0.0 | \n", "40 | \n", "20 | \n", "0 | \n", "2 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "10 | \n", "2.003438 | \n", "0.0 | \n", "2242.0 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
5275 | \n", "1000000000 | \n", "50.0 | \n", "20 | \n", "40 | \n", "0 | \n", "1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "10 | \n", "2.000410 | \n", "0.0 | \n", "2241.0 | \n", "
5276 | \n", "1000000000 | \n", "50.0 | \n", "20 | \n", "40 | \n", "0 | \n", "1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "10 | \n", "2.000693 | \n", "0.0 | \n", "2241.0 | \n", "
5277 | \n", "1000000000 | \n", "50.0 | \n", "20 | \n", "40 | \n", "0 | \n", "1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "10 | \n", "2.000654 | \n", "0.0 | \n", "2241.0 | \n", "
5278 | \n", "1000000000 | \n", "50.0 | \n", "20 | \n", "40 | \n", "0 | \n", "1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "10 | \n", "2.000830 | \n", "0.0 | \n", "2241.0 | \n", "
5279 | \n", "1000000000 | \n", "50.0 | \n", "20 | \n", "40 | \n", "0 | \n", "1 | \n", "100000 | \n", "1000000 | \n", "2.0 | \n", "10 | \n", "2.000683 | \n", "0.0 | \n", "2241.0 | \n", "
5280 rows × 13 columns
\n", "\n", " | \n", " | \n", " | \n", " | \n", " | Ti | \n", "Iters | \n", "To | \n", "Iters2 | \n", "
---|---|---|---|---|---|---|---|---|
Tt | \n", "Dist | \n", "%Async | \n", "NP | \n", "NS | \n", "\n", " | \n", " | \n", " | \n", " |
0.0 | \n", "1 | \n", "0.0 | \n", "2 | \n", "2 | \n", "1.999980 | \n", "1.0 | \n", "2241.666667 | \n", "1.0 | \n", "
10 | \n", "2.000285 | \n", "1.0 | \n", "2241.666667 | \n", "1.0 | \n", "||||
20 | \n", "1.999927 | \n", "1.0 | \n", "2241.666667 | \n", "1.0 | \n", "||||
40 | \n", "2.000288 | \n", "1.0 | \n", "2242.000000 | \n", "1.0 | \n", "||||
10 | \n", "2 | \n", "2.001407 | \n", "1.0 | \n", "2241.333333 | \n", "1.0 | \n", "|||
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
1.0 | \n", "2 | \n", "100.0 | \n", "20 | \n", "40 | \n", "4.980324 | \n", "1.0 | \n", "2242.000000 | \n", "1.0 | \n", "
40 | \n", "2 | \n", "3.862025 | \n", "1.0 | \n", "2242.000000 | \n", "1.0 | \n", "|||
10 | \n", "4.664625 | \n", "1.0 | \n", "2241.333333 | \n", "1.0 | \n", "||||
20 | \n", "5.541510 | \n", "1.0 | \n", "2241.666667 | \n", "1.0 | \n", "||||
40 | \n", "5.728025 | \n", "1.0 | \n", "2241.666667 | \n", "1.0 | \n", "
288 rows × 4 columns
\n", "