{ "cells": [ { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "import pandas as pd " ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
elapsed_time (seconds)function_name
00.150900./lib_src/generate.c:75:
10.000051./lib_src/build_real.c:50:
20.000091./lib_src/cov_value.c:60:
30.000021./lib_src/length.c:47:
40.000017./lib_src/clean_real.c:48:
50.000068./lib_src/gasdev.c:43:
60.082331./lib_src/covariance.c:86:
70.000713./lib_src/gasdev.c:35:
80.000101./lib_src/ran2.c:68:
90.000047./lib_src/prebuild_gwn.c:57:
100.236221./lib_src/Py_kgeneration.c:74:
110.084618./lib_src/fftma2.c:106:
120.000007./lib_src/maxfactor.c:42:
130.000835./lib_src/fourt.c:593:
140.000086./lib_src/cgrid.c:50:
150.000026./lib_src/Py_getvalues.c:157:
\n", "
" ], "text/plain": [ " elapsed_time (seconds) function_name\n", "0 0.150900 ./lib_src/generate.c:75:\n", "1 0.000051 ./lib_src/build_real.c:50:\n", "2 0.000091 ./lib_src/cov_value.c:60:\n", "3 0.000021 ./lib_src/length.c:47:\n", "4 0.000017 ./lib_src/clean_real.c:48:\n", "5 0.000068 ./lib_src/gasdev.c:43:\n", "6 0.082331 ./lib_src/covariance.c:86:\n", "7 0.000713 ./lib_src/gasdev.c:35:\n", "8 0.000101 ./lib_src/ran2.c:68:\n", "9 0.000047 ./lib_src/prebuild_gwn.c:57:\n", "10 0.236221 ./lib_src/Py_kgeneration.c:74:\n", "11 0.084618 ./lib_src/fftma2.c:106:\n", "12 0.000007 ./lib_src/maxfactor.c:42:\n", "13 0.000835 ./lib_src/fourt.c:593:\n", "14 0.000086 ./lib_src/cgrid.c:50:\n", "15 0.000026 ./lib_src/Py_getvalues.c:157:" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = {}\n", "with open(\"log_16.txt\") as log_file:\n", " lines = log_file.readlines()\n", " for line in lines:\n", " if \"ELAPSED\" in line:\n", " split_line = line.split()\n", " idx_elapsed = split_line.index(\"ELAPSED\") + 2\n", " function_name, elapsed = split_line[2], float(split_line[idx_elapsed])\n", " if function_name not in data or (function_name in data and elapsed > data[function_name]):\n", " data[function_name] = elapsed\n", "new_data = {\"function_name\": data.keys(), \"elapsed_time (seconds)\": data.values()}\n", " \n", "df = pd.DataFrame(new_data) \n", "\n", "df" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.18" } }, "nbformat": 4, "nbformat_minor": 2 }