{ "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", "from scipy import stats\n", "import sys" ] }, { "cell_type": "code", "execution_count": 29, "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, 4, 8, 16, 32]\n", "dist_names = ['null', 'BestFit', 'WorstFit']" ] }, { "cell_type": "code", "execution_count": 3, "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": 4, "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": null, "metadata": {}, "outputs": [], "source": [ "from natsort import index_natsorted\n", "grouped_aggG.sort_values(\n", " by=\"Groups\",\n", " key=lambda x: np.argsort(index_natsorted(df[\"Groups\"]))\n", ")\n", "grouped_aggG" ] }, { "cell_type": "code", "execution_count": 5, "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": 6, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/usuario/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:16: 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", " app.launch_new_instance()\n" ] } ], "source": [ "dfL = pd.read_csv( matrixIt )\n", "dfL = dfL.drop(columns=dfL.columns[0])\n", "\n", "dfL['S'] = dfL['N']\n", "dfL['N'] = dfL['S'] + dfL['%Async']\n", "dfL['%Async'] = (dfL['%Async'] / dfL['N']) * 100\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": 7, "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": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | N | \n", "%Async | \n", "Groups | \n", "Dist | \n", "Matrix | \n", "Time | \n", "Iters | \n", "TE | \n", "S | \n", "
---|---|---|---|---|---|---|---|---|---|
0 | \n", "1000000000 | \n", "0.0 | \n", "8,32 | \n", "2,2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "31.525710 | \n", "1000000000 | \n", "
1 | \n", "1000000000 | \n", "0.0 | \n", "8,32 | \n", "2,2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "33.315857 | \n", "1000000000 | \n", "
2 | \n", "1000000000 | \n", "0.0 | \n", "8,32 | \n", "2,2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "33.347537 | \n", "1000000000 | \n", "
3 | \n", "1000000000 | \n", "75.0 | \n", "4,32 | \n", "1,1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "57.219027 | \n", "250000000 | \n", "
4 | \n", "1000000000 | \n", "75.0 | \n", "4,32 | \n", "1,1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "55.469166 | \n", "250000000 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
595 | \n", "1000000000 | \n", "50.0 | \n", "4,8 | \n", "2,2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "73.771357 | \n", "500000000 | \n", "
596 | \n", "1000000000 | \n", "50.0 | \n", "4,8 | \n", "2,2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "75.557508 | \n", "500000000 | \n", "
597 | \n", "1000000000 | \n", "50.0 | \n", "16,8 | \n", "1,1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "35.949913 | \n", "500000000 | \n", "
598 | \n", "1000000000 | \n", "50.0 | \n", "16,8 | \n", "1,1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "37.900348 | \n", "500000000 | \n", "
599 | \n", "1000000000 | \n", "50.0 | \n", "16,8 | \n", "1,1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "36.012772 | \n", "500000000 | \n", "
600 rows × 9 columns
\n", "\n", " | \n", " | \n", " | TE | \n", "
---|---|---|---|
Dist | \n", "%Async | \n", "Groups | \n", "\n", " |
1,1 | \n", "0.0 | \n", "16,2 | \n", "112.087769 | \n", "
16,32 | \n", "18.394706 | \n", "||
16,4 | \n", "61.887052 | \n", "||
16,8 | \n", "37.986463 | \n", "||
2,16 | \n", "113.187865 | \n", "||
... | \n", "... | \n", "... | \n", "... | \n", "
2,2 | \n", "100.0 | \n", "4,8 | \n", "74.864688 | \n", "
8,16 | \n", "37.999586 | \n", "||
8,2 | \n", "123.584176 | \n", "||
8,32 | \n", "31.730297 | \n", "||
8,4 | \n", "74.052463 | \n", "
200 rows × 1 columns
\n", "\n", " | N | \n", "%Async | \n", "NP | \n", "NS | \n", "Dist | \n", "Matrix | \n", "Time | \n", "Iters | \n", "TC | \n", "TS | \n", "TA | \n", "S | \n", "TR | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1000000000 | \n", "0.0 | \n", "8 | \n", "32 | \n", "2,2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "1.341434 | \n", "0.695848 | \n", "0.000000 | \n", "1000000000 | \n", "2.037282 | \n", "
1 | \n", "1000000000 | \n", "0.0 | \n", "8 | \n", "32 | \n", "2,2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "1.405911 | \n", "0.639849 | \n", "0.000000 | \n", "1000000000 | \n", "2.045760 | \n", "
2 | \n", "1000000000 | \n", "0.0 | \n", "8 | \n", "32 | \n", "2,2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "1.346017 | \n", "0.747863 | \n", "0.000000 | \n", "1000000000 | \n", "2.093880 | \n", "
3 | \n", "1000000000 | \n", "75.0 | \n", "4 | \n", "32 | \n", "1,1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.688062 | \n", "0.064900 | \n", "0.364941 | \n", "250000000 | \n", "1.117903 | \n", "
4 | \n", "1000000000 | \n", "75.0 | \n", "4 | \n", "32 | \n", "1,1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.702200 | \n", "0.068039 | \n", "0.412072 | \n", "250000000 | \n", "1.182311 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
595 | \n", "1000000000 | \n", "50.0 | \n", "4 | \n", "8 | \n", "2,2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.390444 | \n", "0.142287 | \n", "0.338576 | \n", "500000000 | \n", "0.871307 | \n", "
596 | \n", "1000000000 | \n", "50.0 | \n", "4 | \n", "8 | \n", "2,2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.351690 | \n", "0.154699 | \n", "0.354917 | \n", "500000000 | \n", "0.861306 | \n", "
597 | \n", "1000000000 | \n", "50.0 | \n", "16 | \n", "8 | \n", "1,1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.337472 | \n", "0.081077 | \n", "0.243481 | \n", "500000000 | \n", "0.662030 | \n", "
598 | \n", "1000000000 | \n", "50.0 | \n", "16 | \n", "8 | \n", "1,1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.351262 | \n", "0.103176 | \n", "0.261565 | \n", "500000000 | \n", "0.716003 | \n", "
599 | \n", "1000000000 | \n", "50.0 | \n", "16 | \n", "8 | \n", "1,1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.349151 | \n", "0.094121 | \n", "0.221750 | \n", "500000000 | \n", "0.665022 | \n", "
600 rows × 13 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", "4 | \n", "0.220380 | \n", "0.314893 | \n", "0.000000 | \n", "0.535273 | \n", "
8 | \n", "0.248143 | \n", "0.375003 | \n", "0.000000 | \n", "0.623146 | \n", "|||
16 | \n", "0.339042 | \n", "0.486650 | \n", "0.000000 | \n", "0.825692 | \n", "|||
32 | \n", "0.743840 | \n", "0.506385 | \n", "0.000000 | \n", "1.250225 | \n", "|||
4 | \n", "2 | \n", "0.197858 | \n", "0.311136 | \n", "0.000000 | \n", "0.508994 | \n", "||
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2,2 | \n", "100.0 | \n", "16 | \n", "32 | \n", "1.358891 | \n", "0.000000 | \n", "1.419016 | \n", "2.777907 | \n", "
32 | \n", "2 | \n", "0.591882 | \n", "0.000000 | \n", "2.477300 | \n", "3.069183 | \n", "||
4 | \n", "0.804965 | \n", "0.000000 | \n", "1.729638 | \n", "2.534603 | \n", "|||
8 | \n", "0.935128 | \n", "0.000000 | \n", "1.520682 | \n", "2.455810 | \n", "|||
16 | \n", "1.221248 | \n", "0.000000 | \n", "1.541904 | \n", "2.763152 | \n", "
200 rows × 4 columns
\n", "\n", " | N | \n", "%Async | \n", "NP | \n", "N_par | \n", "NS | \n", "Dist | \n", "Matrix | \n", "Time | \n", "Iters | \n", "Ti | \n", "Tt | \n", "To | \n", "S | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1000000000 | \n", "0.0 | \n", "32 | \n", "8 | \n", "0 | \n", "2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.005463 | \n", "0.0 | \n", "6.0 | \n", "1000000000 | \n", "
1 | \n", "1000000000 | \n", "0.0 | \n", "32 | \n", "8 | \n", "0 | \n", "2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.005350 | \n", "0.0 | \n", "6.0 | \n", "1000000000 | \n", "
2 | \n", "1000000000 | \n", "0.0 | \n", "32 | \n", "8 | \n", "0 | \n", "2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.005355 | \n", "0.0 | \n", "6.0 | \n", "1000000000 | \n", "
3 | \n", "1000000000 | \n", "0.0 | \n", "32 | \n", "8 | \n", "0 | \n", "2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.005354 | \n", "0.0 | \n", "6.0 | \n", "1000000000 | \n", "
4 | \n", "1000000000 | \n", "0.0 | \n", "32 | \n", "8 | \n", "0 | \n", "2 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.005352 | \n", "0.0 | \n", "6.0 | \n", "1000000000 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
1199995 | \n", "1000000000 | \n", "50.0 | \n", "8 | \n", "16 | \n", "0 | \n", "1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.024075 | \n", "0.0 | \n", "27.0 | \n", "500000000 | \n", "
1199996 | \n", "1000000000 | \n", "50.0 | \n", "8 | \n", "16 | \n", "0 | \n", "1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.024076 | \n", "0.0 | \n", "27.0 | \n", "500000000 | \n", "
1199997 | \n", "1000000000 | \n", "50.0 | \n", "8 | \n", "16 | \n", "0 | \n", "1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.024076 | \n", "0.0 | \n", "27.0 | \n", "500000000 | \n", "
1199998 | \n", "1000000000 | \n", "50.0 | \n", "8 | \n", "16 | \n", "0 | \n", "1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.024411 | \n", "0.0 | \n", "27.0 | \n", "500000000 | \n", "
1199999 | \n", "1000000000 | \n", "50.0 | \n", "8 | \n", "16 | \n", "0 | \n", "1 | \n", "100000 | \n", "0.1 | \n", "1000 | \n", "0.024075 | \n", "0.0 | \n", "27.0 | \n", "500000000 | \n", "
1200000 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", "4 | \n", "0.099861 | \n", "500.0 | \n", "112.000000 | \n", "500.0 | \n", "
8 | \n", "0.099849 | \n", "500.0 | \n", "112.000000 | \n", "500.0 | \n", "||||
16 | \n", "0.099860 | \n", "500.0 | \n", "112.000000 | \n", "500.0 | \n", "||||
32 | \n", "0.099853 | \n", "500.0 | \n", "112.000000 | \n", "500.0 | \n", "||||
4 | \n", "2 | \n", "0.049642 | \n", "500.0 | \n", "55.666667 | \n", "500.0 | \n", "|||
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
1.0 | \n", "2 | \n", "100.0 | \n", "16 | \n", "32 | \n", "0.034899 | \n", "21.0 | \n", "14.000000 | \n", "21.0 | \n", "
32 | \n", "2 | \n", "0.012084 | \n", "101.0 | \n", "7.000000 | \n", "101.0 | \n", "|||
4 | \n", "0.015599 | \n", "54.0 | \n", "7.000000 | \n", "54.0 | \n", "||||
8 | \n", "0.012685 | \n", "54.0 | \n", "7.000000 | \n", "54.0 | \n", "||||
16 | \n", "0.015421 | \n", "44.0 | \n", "7.000000 | \n", "44.0 | \n", "
360 rows × 4 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", "4 | \n", "0.099861 | \n", "500.0 | \n", "112.000000 | \n", "500.0 | \n", "
8 | \n", "0.099849 | \n", "500.0 | \n", "112.000000 | \n", "500.0 | \n", "||||
16 | \n", "0.099860 | \n", "500.0 | \n", "112.000000 | \n", "500.0 | \n", "||||
32 | \n", "0.099853 | \n", "500.0 | \n", "112.000000 | \n", "500.0 | \n", "||||
4 | \n", "2 | \n", "0.049642 | \n", "500.0 | \n", "55.666667 | \n", "500.0 | \n", "|||
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
1.0 | \n", "2 | \n", "100.0 | \n", "16 | \n", "32 | \n", "0.034899 | \n", "21.0 | \n", "14.000000 | \n", "21.0 | \n", "
32 | \n", "2 | \n", "0.012084 | \n", "101.0 | \n", "7.000000 | \n", "101.0 | \n", "|||
4 | \n", "0.015599 | \n", "54.0 | \n", "7.000000 | \n", "54.0 | \n", "||||
8 | \n", "0.012685 | \n", "54.0 | \n", "7.000000 | \n", "54.0 | \n", "||||
16 | \n", "0.015421 | \n", "44.0 | \n", "7.000000 | \n", "44.0 | \n", "
360 rows × 4 columns
\n", "