{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "from pdfCropMargins import crop\n",
    "from importlib import reload\n",
    "\n",
    "import draw_graph_expr_6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    bench_name  ckpt_trig  ckpt_exec  no_forward_progress  time_passed\n",
      "19         fft         26          1                    1   234.467708\n",
      "155        fft         26          2                    1   537.957919\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "('plot_expr_6_cropped.pdf', None, None, None)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 70152 characters]",
      "text/plain": [
       "<Figure size 1200x300 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "reload(draw_graph_expr_6)\n",
    "benchmark = \"vFFT\"\n",
    "fig = draw_graph_expr_6.draw_graph(benchmark)\n",
    "output_file_name = \"plot_expr_6.pdf\"\n",
    "cropped_file_name = \"plot_expr_6_cropped.pdf\"\n",
    "fig.savefig(output_file_name, bbox_inches=\"tight\")\n",
    "crop([\"-o\", cropped_file_name, \"-p4\", \"0\", \"0\", \"0\", \"0\", output_file_name])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "number of finished tasks:\n",
      "{'adaptive': 195, 'counter': 166, 'unroll': 153}\n",
      "ratio to adaptive:\n",
      "counter: 1.1746987951807228\n",
      "unroll: 1.2745098039215685\n",
      "adaptive\n",
      "finished during 0~200 secs: 10 0.05\n",
      "finished during 300~500 secs: 100 0.5\n",
      "counter\n",
      "finished during 0~200 secs: 9 0.045\n",
      "finished during 300~500 secs: 82 0.41\n",
      "unroll\n",
      "finished during 0~200 secs: 8 0.04\n",
      "finished during 300~500 secs: 78 0.39\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "('plot_expr_6_completions_cropped.pdf', None, None, None)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 479428 characters]",
      "text/plain": [
       "<Figure size 3200x1600 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = draw_graph_expr_6.draw_completeions(benchmark)\n",
    "output_file_name = \"plot_expr_6_completions.pdf\"\n",
    "cropped_file_name = \"plot_expr_6_completions_cropped.pdf\"\n",
    "fig.savefig(output_file_name, bbox_inches=\"tight\")\n",
    "crop([\"-o\", cropped_file_name, \"-p4\", \"0\", \"0\", \"65\", \"70\", output_file_name])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "     index DATE (MM/DD/YYYY)    PST  current (mA)\n",
      "0        0         4/22/2015  05:22      0.138150\n",
      "1        1         4/22/2015  05:23      0.085454\n",
      "2        2         4/22/2015  05:24      0.038014\n",
      "3        3         4/22/2015  05:25      0.052288\n",
      "4        4         4/22/2015  05:26      0.065767\n",
      "..     ...               ...    ...           ...\n",
      "801    801         4/22/2015  18:43      0.100084\n",
      "802    802         4/22/2015  18:44      0.074430\n",
      "803    803         4/22/2015  18:45      0.070010\n",
      "804    804         4/22/2015  18:46      0.256750\n",
      "805    805         4/22/2015  18:47      0.240722\n",
      "\n",
      "[806 rows x 4 columns]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "('plot_expr_6_power_trace_cropped.pdf', None, None, None)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 218412 characters]",
      "text/plain": [
       "<Figure size 1800x1620 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = draw_graph_expr_6.draw_power_trace()\n",
    "output_file_name = \"plot_expr_6_power_trace.pdf\"\n",
    "cropped_file_name = \"plot_expr_6_power_trace_cropped.pdf\"\n",
    "fig.savefig(output_file_name, bbox_inches=\"tight\")\n",
    "crop([\"-o\", cropped_file_name, \"-p4\", \"0\", \"0\", \"20\", \"0\", output_file_name])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "embedded",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
