|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "code", |
| 5 | + "execution_count": 1, |
| 6 | + "metadata": {}, |
| 7 | + "outputs": [], |
| 8 | + "source": [ |
| 9 | + "import numpy as np\n", |
| 10 | + "import matplotlib as mpl\n", |
| 11 | + "%matplotlib inline\n", |
| 12 | + "\n", |
| 13 | + "import pandas as pd\n", |
| 14 | + "\n", |
| 15 | + "import json\n", |
| 16 | + "import glob\n", |
| 17 | + "import os" |
| 18 | + ] |
| 19 | + }, |
| 20 | + { |
| 21 | + "cell_type": "code", |
| 22 | + "execution_count": 2, |
| 23 | + "metadata": {}, |
| 24 | + "outputs": [], |
| 25 | + "source": [ |
| 26 | + "data = {}\n", |
| 27 | + "\n", |
| 28 | + "for path in glob.glob(\"../../data/results/lfr_params_ground_truth/*.json\") + \\\n", |
| 29 | + " glob.glob(\"../../data/results/lfr_params/**/*.json\", recursive=True) + \\\n", |
| 30 | + " glob.glob(\"../../data/results/all_real/*.json\") + \\\n", |
| 31 | + " glob.glob(\"../../data/results/all_real_seq/*.json\") + \\\n", |
| 32 | + " glob.glob(\"../../data/results/all_real_seq2/*.json\") + \\\n", |
| 33 | + " glob.glob(\"../../data/results/gossip_map/*.json\") + \\\n", |
| 34 | + " glob.glob(\"../../data/results/gossip_map2/*.json\") + \\\n", |
| 35 | + " glob.glob(\"../../data/results/louvain_baseline/*.json\") + \\\n", |
| 36 | + " glob.glob(\"../../data/results/infomap_baseline/*.json\") + \\\n", |
| 37 | + " glob.glob(\"../../data/results/weak_scaling/*.json\") + \\\n", |
| 38 | + " glob.glob(\"../../data/results/weak_scaling_small_quality/**/*.json\", recursive=True):\n", |
| 39 | + " for typename, items in json.load(open(path)).items():\n", |
| 40 | + " if typename in data:\n", |
| 41 | + " for key, object_data in items.items():\n", |
| 42 | + " if key in data[typename]:\n", |
| 43 | + " data[typename][key].update(object_data)\n", |
| 44 | + " else:\n", |
| 45 | + " data[typename][key] = object_data\n", |
| 46 | + " else:\n", |
| 47 | + " data[typename] = items\n", |
| 48 | + "\n", |
| 49 | + "frames = { typename: pd.DataFrame.from_dict(items, orient='index') for typename, items in data.items() }" |
| 50 | + ] |
| 51 | + }, |
| 52 | + { |
| 53 | + "cell_type": "code", |
| 54 | + "execution_count": 3, |
| 55 | + "metadata": {}, |
| 56 | + "outputs": [], |
| 57 | + "source": [ |
| 58 | + "frames['algorithm_run']['runtime'].fillna((frames['algorithm_run']['done_ts'] - frames['algorithm_run']['start_ts']) / 1000000.0, inplace=True)" |
| 59 | + ] |
| 60 | + }, |
| 61 | + { |
| 62 | + "cell_type": "code", |
| 63 | + "execution_count": 4, |
| 64 | + "metadata": {}, |
| 65 | + "outputs": [], |
| 66 | + "source": [ |
| 67 | + "frames['program_run']['hosts'].fillna(1, inplace=True)\n", |
| 68 | + "frames['program_run']['workers_per_host'].fillna(1, inplace=True)" |
| 69 | + ] |
| 70 | + }, |
| 71 | + { |
| 72 | + "cell_type": "code", |
| 73 | + "execution_count": 9, |
| 74 | + "metadata": {}, |
| 75 | + "outputs": [ |
| 76 | + { |
| 77 | + "data": { |
| 78 | + "text/plain": [ |
| 79 | + "3.5908500805376624" |
| 80 | + ] |
| 81 | + }, |
| 82 | + "execution_count": 9, |
| 83 | + "metadata": {}, |
| 84 | + "output_type": "execute_result" |
| 85 | + } |
| 86 | + ], |
| 87 | + "source": [ |
| 88 | + "data = frames['algorithm_run'].merge(frames['program_run'], left_on='program_run_id', right_index=True)\n", |
| 89 | + "(data['runtime'] * data['hosts'] * data['workers_per_host']).sum() / 60 / 60 / 24 / 365" |
| 90 | + ] |
| 91 | + } |
| 92 | + ], |
| 93 | + "metadata": { |
| 94 | + "kernelspec": { |
| 95 | + "display_name": "Python 3", |
| 96 | + "language": "python", |
| 97 | + "name": "python3" |
| 98 | + }, |
| 99 | + "language_info": { |
| 100 | + "codemirror_mode": { |
| 101 | + "name": "ipython", |
| 102 | + "version": 3 |
| 103 | + }, |
| 104 | + "file_extension": ".py", |
| 105 | + "mimetype": "text/x-python", |
| 106 | + "name": "python", |
| 107 | + "nbconvert_exporter": "python", |
| 108 | + "pygments_lexer": "ipython3", |
| 109 | + "version": "3.6.4" |
| 110 | + } |
| 111 | + }, |
| 112 | + "nbformat": 4, |
| 113 | + "nbformat_minor": 2 |
| 114 | +} |
0 commit comments