{ "cells": [ { "cell_type": "code", "execution_count": 42, "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", "from scipy import stats\n", "import sys" ] }, { "cell_type": "code", "execution_count": 43, "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", "repet = 3 * 2 #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']" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [], "source": [ "def speedUp(arr, seq, df):\n", " numP = df.loc[arr.index[0]].NP\n", " return seq[( seq.NP == numP )]['EX'] / arr.mean()" ] }, { "cell_type": "code", "execution_count": 61, "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": 62, "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": 63, "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.ceil(grouped_aggL['Iters']/6) # TODO Cambiar a repeticiones realizadas\n", "grouped_aggL['Iters2'] = np.ceil(grouped_aggL['Iters2']/6)" ] }, { "cell_type": "code", "execution_count": 64, "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": 65, "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", "2000000000 | \n", "0.0 | \n", "20,40 | \n", "2,2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "3.325915 | \n", "2000000000 | \n", "
1 | \n", "2000000000 | \n", "0.0 | \n", "20,40 | \n", "2,2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "3.661673 | \n", "2000000000 | \n", "
2 | \n", "2000000000 | \n", "0.0 | \n", "20,40 | \n", "2,2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "3.647241 | \n", "2000000000 | \n", "
3 | \n", "2000000000 | \n", "75.0 | \n", "10,40 | \n", "1,1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "2.710496 | \n", "500000000 | \n", "
4 | \n", "2000000000 | \n", "75.0 | \n", "10,40 | \n", "1,1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "2.785736 | \n", "500000000 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
475 | \n", "2000000000 | \n", "50.0 | \n", "10,10 | \n", "2,2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "1.292079 | \n", "1000000000 | \n", "
476 | \n", "2000000000 | \n", "50.0 | \n", "10,10 | \n", "2,2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "1.683571 | \n", "1000000000 | \n", "
477 | \n", "2000000000 | \n", "50.0 | \n", "40,20 | \n", "1,1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "3.107688 | \n", "1000000000 | \n", "
478 | \n", "2000000000 | \n", "50.0 | \n", "40,20 | \n", "1,1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "3.169551 | \n", "1000000000 | \n", "
479 | \n", "2000000000 | \n", "50.0 | \n", "40,20 | \n", "1,1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "3.442101 | \n", "1000000000 | \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", "7.238413 | \n", "
10,2 | \n", "7.495134 | \n", "||
10,20 | \n", "1.052943 | \n", "||
10,40 | \n", "2.412291 | \n", "||
2,10 | \n", "1.812608 | \n", "||
... | \n", "... | \n", "... | \n", "... | \n", "
2,2 | \n", "100.0 | \n", "20,40 | \n", "3.978562 | \n", "
40,10 | \n", "3.869905 | \n", "||
40,2 | \n", "4.056287 | \n", "||
40,20 | \n", "4.384910 | \n", "||
40,40 | \n", "3.143114 | \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", "2000000000 | \n", "0.0 | \n", "20 | \n", "40 | \n", "2,2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "1.523284 | \n", "1.571982 | \n", "0.000000 | \n", "2000000000 | \n", "3.095266 | \n", "
1 | \n", "2000000000 | \n", "0.0 | \n", "20 | \n", "40 | \n", "2,2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "1.395780 | \n", "2.067917 | \n", "0.000000 | \n", "2000000000 | \n", "3.463697 | \n", "
2 | \n", "2000000000 | \n", "0.0 | \n", "20 | \n", "40 | \n", "2,2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "1.515433 | \n", "1.939858 | \n", "0.000000 | \n", "2000000000 | \n", "3.455291 | \n", "
3 | \n", "2000000000 | \n", "75.0 | \n", "10 | \n", "40 | \n", "1,1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "1.331821 | \n", "0.217988 | \n", "1.279915 | \n", "500000000 | \n", "2.829724 | \n", "
4 | \n", "2000000000 | \n", "75.0 | \n", "10 | \n", "40 | \n", "1,1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "1.338515 | \n", "0.268872 | \n", "1.359864 | \n", "500000000 | \n", "2.967251 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
475 | \n", "2000000000 | \n", "50.0 | \n", "10 | \n", "10 | \n", "2,2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "0.573135 | \n", "0.091322 | \n", "0.679278 | \n", "1000000000 | \n", "1.343735 | \n", "
476 | \n", "2000000000 | \n", "50.0 | \n", "10 | \n", "10 | \n", "2,2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "0.568495 | \n", "0.096622 | \n", "1.075340 | \n", "1000000000 | \n", "1.740457 | \n", "
477 | \n", "2000000000 | \n", "50.0 | \n", "40 | \n", "20 | \n", "1,1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "1.171373 | \n", "0.557700 | \n", "1.843437 | \n", "1000000000 | \n", "3.572510 | \n", "
478 | \n", "2000000000 | \n", "50.0 | \n", "40 | \n", "20 | \n", "1,1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "1.227744 | \n", "0.634888 | \n", "1.881406 | \n", "1000000000 | \n", "3.744038 | \n", "
479 | \n", "2000000000 | \n", "50.0 | \n", "40 | \n", "20 | \n", "1,1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1,10 | \n", "1.101387 | \n", "0.695218 | \n", "2.296932 | \n", "1000000000 | \n", "4.093537 | \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.246172 | \n", "0.658124 | \n", "0.000000 | \n", "0.904296 | \n", "
10 | \n", "0.372526 | \n", "0.846183 | \n", "0.000000 | \n", "1.218709 | \n", "|||
20 | \n", "0.463237 | \n", "0.975418 | \n", "0.000000 | \n", "1.438655 | \n", "|||
40 | \n", "5.897614 | \n", "1.306502 | \n", "0.000000 | \n", "7.204116 | \n", "|||
10 | \n", "2 | \n", "4.623390 | \n", "0.823443 | \n", "0.000000 | \n", "5.446832 | \n", "||
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2,2 | \n", "100.0 | \n", "20 | \n", "40 | \n", "1.464316 | \n", "0.000000 | \n", "2.380671 | \n", "3.844987 | \n", "
40 | \n", "2 | \n", "0.482502 | \n", "0.000000 | \n", "3.510194 | \n", "3.992695 | \n", "||
10 | \n", "1.026574 | \n", "0.000000 | \n", "2.781301 | \n", "3.807875 | \n", "|||
20 | \n", "1.397894 | \n", "0.000000 | \n", "2.814464 | \n", "4.212358 | \n", "|||
40 | \n", "1.445946 | \n", "0.000000 | \n", "1.597486 | \n", "3.043431 | \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", "2000000000 | \n", "0.0 | \n", "40 | \n", "20 | \n", "0 | \n", "2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "10 | \n", "0.009826 | \n", "0.0 | \n", "11.0 | \n", "
1 | \n", "2000000000 | \n", "0.0 | \n", "40 | \n", "20 | \n", "0 | \n", "2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "10 | \n", "0.025812 | \n", "0.0 | \n", "11.0 | \n", "
2 | \n", "2000000000 | \n", "0.0 | \n", "40 | \n", "20 | \n", "0 | \n", "2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "10 | \n", "0.009819 | \n", "0.0 | \n", "11.0 | \n", "
3 | \n", "2000000000 | \n", "0.0 | \n", "40 | \n", "20 | \n", "0 | \n", "2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "10 | \n", "0.011071 | \n", "0.0 | \n", "11.0 | \n", "
4 | \n", "2000000000 | \n", "0.0 | \n", "40 | \n", "20 | \n", "0 | \n", "2 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "10 | \n", "0.009815 | \n", "0.0 | \n", "11.0 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
14951 | \n", "2000000000 | \n", "50.0 | \n", "40 | \n", "0 | \n", "20 | \n", "1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1 | \n", "0.025818 | \n", "1.0 | \n", "11.0 | \n", "
14952 | \n", "2000000000 | \n", "50.0 | \n", "40 | \n", "0 | \n", "20 | \n", "1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1 | \n", "0.009812 | \n", "1.0 | \n", "11.0 | \n", "
14953 | \n", "2000000000 | \n", "50.0 | \n", "40 | \n", "0 | \n", "20 | \n", "1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1 | \n", "0.025813 | \n", "1.0 | \n", "11.0 | \n", "
14954 | \n", "2000000000 | \n", "50.0 | \n", "40 | \n", "0 | \n", "20 | \n", "1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1 | \n", "0.025810 | \n", "1.0 | \n", "11.0 | \n", "
14955 | \n", "2000000000 | \n", "50.0 | \n", "40 | \n", "0 | \n", "20 | \n", "1 | \n", "100000 | \n", "0 | \n", "0.2 | \n", "1 | \n", "0.009820 | \n", "1.0 | \n", "11.0 | \n", "
14956 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", "0.199702 | \n", "1.0 | \n", "224.0 | \n", "1.0 | \n", "
10 | \n", "0.199709 | \n", "1.0 | \n", "224.0 | \n", "1.0 | \n", "||||
20 | \n", "0.199704 | \n", "1.0 | \n", "224.0 | \n", "1.0 | \n", "||||
40 | \n", "0.199695 | \n", "1.0 | \n", "224.0 | \n", "1.0 | \n", "||||
10 | \n", "2 | \n", "0.039240 | \n", "1.0 | \n", "44.0 | \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", "0.057025 | \n", "21.0 | \n", "22.0 | \n", "21.0 | \n", "
40 | \n", "2 | \n", "0.021417 | \n", "81.0 | \n", "11.0 | \n", "81.0 | \n", "|||
10 | \n", "0.021047 | \n", "66.0 | \n", "11.0 | \n", "66.0 | \n", "||||
20 | \n", "0.024609 | \n", "54.0 | \n", "11.0 | \n", "54.0 | \n", "||||
40 | \n", "0.030871 | \n", "26.0 | \n", "11.0 | \n", "26.0 | \n", "
288 rows × 4 columns
\n", "