diff --git a/docs/examples/dsl2-Copy2.ipynb b/docs/examples/dsl2-Copy2.ipynb deleted file mode 100644 index 7c47de9e..00000000 --- a/docs/examples/dsl2-Copy2.ipynb +++ /dev/null @@ -1,822 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "8227bf9b-a386-4cb0-9eba-a7e258bf1d00", - "metadata": {}, - "outputs": [], - "source": [ - "%load_ext autoreload \n", - "%autoreload 2" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "7c95d344-9406-4c66-978a-e7032df0967b", - "metadata": {}, - "outputs": [], - "source": [ - "import sys\n", - "sys.path.append(\"../..\")" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "a8ea89f2-3d70-486c-9901-aeb4900169cb", - "metadata": {}, - "outputs": [], - "source": [ - "import pandas as pd\n", - "import numpy as np\n", - "import pipit as pp" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "589e87fd-d8d1-4ddf-a426-b911410379c4", - "metadata": {}, - "outputs": [], - "source": [ - "trace = pp.Trace.from_otf2(\"../../pipit/tests/data/ping-pong-otf2/\")\n", - "pandas_df = trace.events[[\"Timestamp (ns)\", \"Name\", \"Event Type\", \"Process\", \"Thread\"]].copy()\n", - "pandas_df[\"Process\"] = pandas_df[\"Process\"].astype(int)\n", - "idx = pandas_df.groupby(['Process']).cumcount()\n", - "pandas_df[\"idx\"] = idx" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "3867d2a2-ff3e-4c8c-9c09-46a167a0fde4", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'pandas'" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pp.set_option(\"backend\", \"pandas\")\n", - "pp.get_option(\"backend\")" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "156df562-4431-40b8-b6b0-b7cfbe6206d0", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "TraceDataset (0 traces, 0 events)\n" - ] - } - ], - "source": [ - "ds = pp.dsl2.TraceDataset()\n", - "ds.show()" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "7fa7fe70-0c61-4503-9b27-3bae52d2f1c3", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "Event (rank=1, idx=0, thread=0, timestamp=0.0, event_type='Instant', name='ProgramBegin')" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# simulating a reader\n", - "row = pandas_df.iloc[0]\n", - "evt = pp.dsl2.Event(\n", - " rank=row[\"Process\"],\n", - " idx=row[\"idx\"],\n", - " thread=row[\"Thread\"],\n", - " timestamp=row[\"Timestamp (ns)\"],\n", - " event_type=row[\"Event Type\"],\n", - " name=row[\"Name\"],\n", - ")\n", - "evt" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "5abbffd5-3246-4331-9a40-86b5a6eda0d7", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "TraceDataset (1 trace, 0 events)\n" - ] - } - ], - "source": [ - "ds.push_event(evt)\n", - "ds.show()" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "bca1c384-0239-46b6-94d0-86439635eb80", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+-------+----------+-------------+--------------+--------------+\n", - "| rank | idx | thread | timestamp | event_type | name |\n", - "|--------+-------+----------+-------------+--------------+--------------|\n", - "| 1 | 0 | 0 | 0 | Instant | ProgramBegin |\n", - "+--------+-------+----------+-------------+--------------+--------------+\n", - "TraceDataset (1 trace, 1 event)\n" - ] - } - ], - "source": [ - "ds.flush()\n", - "ds.show()" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "2910c4d8-e40d-4683-b0d4-7943a6be34a6", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+-------+----------+--------------------+--------------+-----------------------+\n", - "| rank | idx | thread | timestamp | event_type | name |\n", - "|--------+-------+----------+--------------------+--------------+-----------------------|\n", - "| 1 | 0 | 0 | 0.0 | Instant | ProgramBegin |\n", - "| 1 | 1 | 0 | 30083.086937435106 | Enter | int main(int, char**) |\n", - "| 1 | 2 | 0 | 40288.33150186851 | Enter | MPI_Init |\n", - "| 0 | 0 | 0 | 307730.9358165928 | Instant | ProgramBegin |\n", - "| 0 | 1 | 0 | 336979.73374932166 | Enter | int main(int, char**) |\n", - "| ... | ... | ... | ... | ... | ... |\n", - "| 1 | 57 | 0 | 199574793.63126454 | Leave | MPI_Finalize |\n", - "| 0 | 58 | 0 | 199575243.23094556 | Leave | int main(int, char**) |\n", - "| 1 | 58 | 0 | 199576798.2158296 | Leave | int main(int, char**) |\n", - "| 0 | 59 | 0 | 199603304.5511645 | Instant | ProgramEnd |\n", - "| 1 | 59 | 0 | 199604459.57369962 | Instant | ProgramEnd |\n", - "+--------+-------+----------+--------------------+--------------+-----------------------+\n", - "TraceDataset (2 traces, 120 events)\n" - ] - } - ], - "source": [ - "for i in range(1, len(pandas_df)):\n", - " row = pandas_df.iloc[i]\n", - " evt = pp.dsl2.Event(\n", - " rank=row[\"Process\"],\n", - " idx=row[\"idx\"],\n", - " thread=row[\"Thread\"],\n", - " timestamp=row[\"Timestamp (ns)\"],\n", - " event_type=row[\"Event Type\"],\n", - " name=row[\"Name\"],\n", - " )\n", - " ds.push_event(evt)\n", - "\n", - "ds.flush()\n", - "ds.show()" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "72fac6a1-0486-4ab5-b95d-af594afe0996", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+-------+----------+-------------+--------------+---------------+\n", - "| rank | idx | thread | timestamp | event_type | name |\n", - "|--------+-------+----------+-------------+--------------+---------------|\n", - "| 1 | 0 | 0 | 0 | Instant | ProgramBegin |\n", - "| 1 | 1 | 0 | 30083.1 | Enter | int main(int, |\n", - "| | | | | | char**) |\n", - "| 1 | 2 | 0 | 40288.3 | Enter | MPI_Init |\n", - "| 0 | 0 | 0 | 307731 | Instant | ProgramBegin |\n", - "| 0 | 1 | 0 | 336980 | Enter | int main(int, |\n", - "| | | | | | char**) |\n", - "+--------+-------+----------+-------------+--------------+---------------+\n", - "TraceDataset (2 traces, 5 events)\n" - ] - } - ], - "source": [ - "ds.head().show()" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "3cba6972-052d-41df-a448-43f383fdf04e", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+-------+----------+-------------+--------------+---------------+\n", - "| rank | idx | thread | timestamp | event_type | name |\n", - "|--------+-------+----------+-------------+--------------+---------------|\n", - "| 1 | 57 | 0 | 1.99575e+08 | Leave | MPI_Finalize |\n", - "| 0 | 58 | 0 | 1.99575e+08 | Leave | int main(int, |\n", - "| | | | | | char**) |\n", - "| 1 | 58 | 0 | 1.99577e+08 | Leave | int main(int, |\n", - "| | | | | | char**) |\n", - "| 0 | 59 | 0 | 1.99603e+08 | Instant | ProgramEnd |\n", - "| 1 | 59 | 0 | 1.99604e+08 | Instant | ProgramEnd |\n", - "+--------+-------+----------+-------------+--------------+---------------+\n", - "TraceDataset (2 traces, 5 events)\n" - ] - } - ], - "source": [ - "ds.tail().show()" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "c8a7099f-c446-4800-b55a-c263b742a814", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+-------+----------+--------------------+--------------+-----------------------+\n", - "| rank | idx | thread | timestamp | event_type | name |\n", - "|--------+-------+----------+--------------------+--------------+-----------------------|\n", - "| 0 | 0 | 0 | 307730.9358165928 | Instant | ProgramBegin |\n", - "| 0 | 1 | 0 | 336979.73374932166 | Enter | int main(int, char**) |\n", - "| 0 | 2 | 0 | 346054.77444467926 | Enter | MPI_Init |\n", - "| 0 | 3 | 0 | 193643138.1741584 | Leave | MPI_Init |\n", - "| 1 | 3 | 0 | 193643835.4832178 | Leave | MPI_Init |\n", - "| ... | ... | ... | ... | ... | ... |\n", - "| 1 | 57 | 0 | 199574793.63126454 | Leave | MPI_Finalize |\n", - "| 0 | 58 | 0 | 199575243.23094556 | Leave | int main(int, char**) |\n", - "| 1 | 58 | 0 | 199576798.2158296 | Leave | int main(int, char**) |\n", - "| 0 | 59 | 0 | 199603304.5511645 | Instant | ProgramEnd |\n", - "| 1 | 59 | 0 | 199604459.57369962 | Instant | ProgramEnd |\n", - "+--------+-------+----------+--------------------+--------------+-----------------------+\n", - "TraceDataset (2 traces, 117 events)\n" - ] - } - ], - "source": [ - "ds.filter(\"timestamp > 1e5\").show()" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "ebf8f71a-6a30-4c90-a9b6-ecb2215192f7", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+-------+----------+--------------------+--------------+-----------------------+\n", - "| idx | thread | timestamp | event_type | name |\n", - "|-------+----------+--------------------+--------------+-----------------------|\n", - "| 0 | 0 | 307730.9358165928 | Instant | ProgramBegin |\n", - "| 1 | 0 | 336979.73374932166 | Enter | int main(int, char**) |\n", - "| 2 | 0 | 346054.77444467926 | Enter | MPI_Init |\n", - "| 3 | 0 | 193643138.1741584 | Leave | MPI_Init |\n", - "| 4 | 0 | 193651646.20379105 | Enter | MPI_Comm_size |\n", - "| ... | ... | ... | ... | ... |\n", - "| 55 | 0 | 199320512.07918367 | Leave | MPI_Recv |\n", - "| 56 | 0 | 199514778.2785141 | Enter | MPI_Finalize |\n", - "| 57 | 0 | 199573648.15437022 | Leave | MPI_Finalize |\n", - "| 58 | 0 | 199575243.23094556 | Leave | int main(int, char**) |\n", - "| 59 | 0 | 199603304.5511645 | Instant | ProgramEnd |\n", - "+-------+----------+--------------------+--------------+-----------------------+\n", - "_Trace (rank=0, 60 events)\n" - ] - } - ], - "source": [ - "ds.traces[0].show()" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "bde23e54-6f1b-4620-a90a-903ba8294c27", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "Event (rank=0, idx=54, thread=0, timestamp=199319973.70504335, event_type='Instant', name='MpiRecv')" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ds.traces[0].loc[54]" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "d1562ea5-8048-4c3c-8813-139ab83fcd33", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+-------+----------+-------------+--------------+----------+\n", - "| idx | thread | timestamp | event_type | name |\n", - "|-------+----------+-------------+--------------+----------|\n", - "| 40 | 0 | 1.94911e+08 | Leave | MPI_Send |\n", - "| 41 | 0 | 1.94912e+08 | Enter | MPI_Recv |\n", - "| 42 | 0 | 1.95132e+08 | Instant | MpiRecv |\n", - "| 43 | 0 | 1.95132e+08 | Leave | MPI_Recv |\n", - "| 44 | 0 | 1.95718e+08 | Enter | MPI_Send |\n", - "| 45 | 0 | 1.95719e+08 | Instant | MpiSend |\n", - "| 46 | 0 | 1.9614e+08 | Leave | MPI_Send |\n", - "| 47 | 0 | 1.9614e+08 | Enter | MPI_Recv |\n", - "| 48 | 0 | 1.96584e+08 | Instant | MpiRecv |\n", - "| 49 | 0 | 1.96584e+08 | Leave | MPI_Recv |\n", - "| 50 | 0 | 1.97613e+08 | Enter | MPI_Send |\n", - "| 51 | 0 | 1.97614e+08 | Instant | MpiSend |\n", - "| 52 | 0 | 1.98506e+08 | Leave | MPI_Send |\n", - "| 53 | 0 | 1.98507e+08 | Enter | MPI_Recv |\n", - "| 54 | 0 | 1.9932e+08 | Instant | MpiRecv |\n", - "+-------+----------+-------------+--------------+----------+\n", - "_Trace (rank=0, 15 events)\n" - ] - } - ], - "source": [ - "ds.traces[0].loc[40:54].show()" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "857acd69-9a15-454c-96c3-bdc4ba8ef955", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+-------+----------+--------------------+--------------+-----------------------+\n", - "| rank | idx | thread | timestamp | event_type | name |\n", - "|--------+-------+----------+--------------------+--------------+-----------------------|\n", - "| 0 | 0 | 0 | 307730.9358165928 | Instant | ProgramBegin |\n", - "| 0 | 1 | 0 | 336979.73374932166 | Enter | int main(int, char**) |\n", - "| 0 | 2 | 0 | 346054.77444467926 | Enter | MPI_Init |\n", - "| 0 | 3 | 0 | 193643138.1741584 | Leave | MPI_Init |\n", - "| 0 | 4 | 0 | 193651646.20379105 | Enter | MPI_Comm_size |\n", - "| ... | ... | ... | ... | ... | ... |\n", - "| 0 | 55 | 0 | 199320512.07918367 | Leave | MPI_Recv |\n", - "| 0 | 56 | 0 | 199514778.2785141 | Enter | MPI_Finalize |\n", - "| 0 | 57 | 0 | 199573648.15437022 | Leave | MPI_Finalize |\n", - "| 0 | 58 | 0 | 199575243.23094556 | Leave | int main(int, char**) |\n", - "| 0 | 59 | 0 | 199603304.5511645 | Instant | ProgramEnd |\n", - "+--------+-------+----------+--------------------+--------------+-----------------------+\n", - "TraceDataset (1 trace, 60 events)\n" - ] - } - ], - "source": [ - "ds.loc[0].show()" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "id": "2eeb2fae-2dca-4742-90de-725d45d1e5bb", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+-------+----------+--------------------+--------------+-----------------------+\n", - "| rank | idx | thread | timestamp | event_type | name |\n", - "|--------+-------+----------+--------------------+--------------+-----------------------|\n", - "| 1 | 0 | 0 | 0.0 | Instant | ProgramBegin |\n", - "| 1 | 1 | 0 | 30083.086937435106 | Enter | int main(int, char**) |\n", - "| 1 | 2 | 0 | 40288.33150186851 | Enter | MPI_Init |\n", - "| 0 | 0 | 0 | 307730.9358165928 | Instant | ProgramBegin |\n", - "| 0 | 1 | 0 | 336979.73374932166 | Enter | int main(int, char**) |\n", - "| ... | ... | ... | ... | ... | ... |\n", - "| 1 | 57 | 0 | 199574793.63126454 | Leave | MPI_Finalize |\n", - "| 0 | 58 | 0 | 199575243.23094556 | Leave | int main(int, char**) |\n", - "| 1 | 58 | 0 | 199576798.2158296 | Leave | int main(int, char**) |\n", - "| 0 | 59 | 0 | 199603304.5511645 | Instant | ProgramEnd |\n", - "| 1 | 59 | 0 | 199604459.57369962 | Instant | ProgramEnd |\n", - "+--------+-------+----------+--------------------+--------------+-----------------------+\n", - "TraceDataset (2 traces, 120 events)\n" - ] - } - ], - "source": [ - "ds.loc[0:2].show()" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "5e843a24-ff1a-44af-975a-15f83df89b07", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "Event (rank=0, idx=59, thread=0, timestamp=199603304.5511645, event_type='Instant', name='ProgramEnd')" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ds.loc[0, 59]" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "id": "2223f5fc-1433-443e-bd5f-1ae1c23faf28", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "120" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ds.map_traces(lambda trace: trace.count()).reduce(\"sum\")" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "id": "de60e9ad-5aff-4f08-9a83-9d6cd086bc06", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+-------+--------------------+\n", - "| idx | result |\n", - "|-------+--------------------|\n", - "| 0 | 307730.9358165928 |\n", - "| 1 | 336979.73374932166 |\n", - "| 2 | 346054.77444467926 |\n", - "| 3 | 193643138.1741584 |\n", - "| 4 | 193651646.20379105 |\n", - "| ... | ... |\n", - "| 55 | 199320512.07918367 |\n", - "| 56 | 199514778.2785141 |\n", - "| 57 | 199573648.15437022 |\n", - "| 58 | 199575243.23094556 |\n", - "| 59 | 199603304.5511645 |\n", - "+-------+--------------------+\n", - "DictLike (idx -> result, 60 items)\n" - ] - } - ], - "source": [ - "ds.traces[0].map_events(lambda event: event.timestamp).show()" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "id": "ac27a0b1-26df-4d6d-b9ff-35b77bcfb7c3", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+-------+--------------------+\n", - "| idx | result |\n", - "|-------+--------------------|\n", - "| 0 | 307730.9358165928 |\n", - "| 1 | 336979.73374932166 |\n", - "| 2 | 346054.77444467926 |\n", - "| 3 | 193643138.1741584 |\n", - "| 4 | 193651646.20379105 |\n", - "| ... | ... |\n", - "| 55 | 199320512.07918367 |\n", - "| 56 | 199514778.2785141 |\n", - "| 57 | 199573648.15437022 |\n", - "| 58 | 199575243.23094556 |\n", - "| 59 | 199603304.5511645 |\n", - "+-------+--------------------+\n", - "DictLike (idx -> result, 60 items)\n" - ] - } - ], - "source": [ - "ds.traces[0].map_events(lambda event: event.timestamp).show()" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "id": "7afbf369-7fe4-40c2-97c4-b80d339fcbcb", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "185373520.9350972" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ds.traces[0].map_events(lambda event: event.timestamp).reduce(\"mean\")" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "id": "44bd35aa-8763-4d11-808b-b42e10a95e81", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "11122246941.50224" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ds.map_traces(lambda trace: trace.map_events(lambda event: event.timestamp).reduce(\"sum\")).reduce(\"mean\")" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "id": "8821997b-1154-4e61-93c9-4cca21b948eb", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+----------+\n", - "| rank | result |\n", - "|--------+----------|\n", - "| 1 | 60 |\n", - "| 0 | 60 |\n", - "+--------+----------+\n", - "DictLike (rank -> result, 2 items)\n" - ] - } - ], - "source": [ - "ds.map_traces(lambda trace: trace.count()).show()" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "id": "8aa72310-728d-42c9-9e6a-dcc13f9a0299", - "metadata": {}, - "outputs": [], - "source": [ - "# matching_evt = np.full(ds.traces[0].count(), np.nan)\n", - "# matching_ts = np.full(ds.traces[0].count(), np.nan)\n", - "\n", - "# stack = []\n", - "\n", - "# for event in ds.traces[0].iter_events():\n", - "# if event.event_type == \"Enter\":\n", - "# stack.append((event.idx, event.timestamp))\n", - "# elif event.event_type == \"Leave\":\n", - "# enter_idx, enter_ts = stack.pop()\n", - "# matching_evt[enter_idx] = event.idx\n", - "# matching_ts[enter_idx] = event.timestamp\n", - "# matching_evt[event.idx] = enter_idx\n", - "# matching_ts[event.idx] = enter_ts\n", - "\n", - "# ds.traces[0].add_column(\"matching_evt\", matching_evt)\n", - "# ds.traces[0].add_column(\"matching_ts\", matching_ts)\n", - "\n", - "# del matching_evt\n", - "# del matching_ts\n", - "\n", - "# ds.traces[0].show()" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "id": "06005b18-cc7e-4363-9264-ea0c50142575", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+-------+----------+--------------------+--------------+-----------------------+\n", - "| rank | idx | thread | timestamp | event_type | name |\n", - "|--------+-------+----------+--------------------+--------------+-----------------------|\n", - "| 1 | 0 | 0 | 0.0 | Instant | ProgramBegin |\n", - "| 1 | 1 | 0 | 30083.086937435106 | Enter | int main(int, char**) |\n", - "| 1 | 2 | 0 | 40288.33150186851 | Enter | MPI_Init |\n", - "| 0 | 0 | 0 | 307730.9358165928 | Instant | ProgramBegin |\n", - "| 0 | 1 | 0 | 336979.73374932166 | Enter | int main(int, char**) |\n", - "| ... | ... | ... | ... | ... | ... |\n", - "| 1 | 57 | 0 | 199574793.63126454 | Leave | MPI_Finalize |\n", - "| 0 | 58 | 0 | 199575243.23094556 | Leave | int main(int, char**) |\n", - "| 1 | 58 | 0 | 199576798.2158296 | Leave | int main(int, char**) |\n", - "| 0 | 59 | 0 | 199603304.5511645 | Instant | ProgramEnd |\n", - "| 1 | 59 | 0 | 199604459.57369962 | Instant | ProgramEnd |\n", - "+--------+-------+----------+--------------------+--------------+-----------------------+\n", - "TraceDataset (2 traces, 120 events)\n" - ] - } - ], - "source": [ - "ds.show()" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "id": "3312389e-71c4-411d-b8e0-9d8c14367359", - "metadata": {}, - "outputs": [], - "source": [ - "analyzer = pp.dsl2.Analyzer(ds)" - ] - }, - { - "cell_type": "code", - "execution_count": 29, - "id": "008cdda4-7d70-4501-9f43-55c6b465e1f2", - "metadata": {}, - "outputs": [], - "source": [ - "analyzer._match_events()" - ] - }, - { - "cell_type": "code", - "execution_count": 30, - "id": "c5d1a502-d728-4831-a608-9577c2c843b8", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+-------+----------+--------------------+--------------+-----------------------+----------------+--------------------+\n", - "| rank | idx | thread | timestamp | event_type | name | matching_evt | matching_ts |\n", - "|--------+-------+----------+--------------------+--------------+-----------------------+----------------+--------------------|\n", - "| 1 | 0 | 0 | 0.0 | Instant | ProgramBegin | -1 | nan |\n", - "| 1 | 1 | 0 | 30083.086937435106 | Enter | int main(int, char**) | 58 | 199576798.2158296 |\n", - "| 1 | 2 | 0 | 40288.33150186851 | Enter | MPI_Init | 3 | 193643835.4832178 |\n", - "| 0 | 0 | 0 | 307730.9358165928 | Instant | ProgramBegin | -1 | nan |\n", - "| 0 | 1 | 0 | 336979.73374932166 | Enter | int main(int, char**) | 58 | 199575243.23094556 |\n", - "| ... | ... | ... | ... | ... | ... | ... | ... |\n", - "| 1 | 57 | 0 | 199574793.63126454 | Leave | MPI_Finalize | 56 | 199529686.66029385 |\n", - "| 0 | 58 | 0 | 199575243.23094556 | Leave | int main(int, char**) | 1 | 336979.73374932166 |\n", - "| 1 | 58 | 0 | 199576798.2158296 | Leave | int main(int, char**) | 1 | 30083.086937435106 |\n", - "| 0 | 59 | 0 | 199603304.5511645 | Instant | ProgramEnd | -1 | nan |\n", - "| 1 | 59 | 0 | 199604459.57369962 | Instant | ProgramEnd | -1 | nan |\n", - "+--------+-------+----------+--------------------+--------------+-----------------------+----------------+--------------------+\n", - "TraceDataset (2 traces, 120 events)\n" - ] - } - ], - "source": [ - "analyzer.ds.show()" - ] - }, - { - "cell_type": "code", - "execution_count": 31, - "id": "ada9f092-fcbc-4f90-bb36-c22e8353d6fe", - "metadata": {}, - "outputs": [], - "source": [ - "analyzer._match_caller_callee()" - ] - }, - { - "cell_type": "code", - "execution_count": 32, - "id": "6c856475-0ea0-4acb-8c2b-2b1bfcdb5391", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "+--------+-------+----------+--------------------+--------------+-----------------------+----------------+--------------------+---------+-------+--------------------------+\n", - "| rank | idx | thread | timestamp | event_type | name | matching_evt | matching_ts | depth | par | children |\n", - "|--------+-------+----------+--------------------+--------------+-----------------------+----------------+--------------------+---------+-------+--------------------------|\n", - "| 1 | 0 | 0 | 0.0 | Instant | ProgramBegin | -1 | nan | 0 | -1 | [] |\n", - "| 1 | 1 | 0 | 30083.086937435106 | Enter | int main(int, char**) | 58 | 199576798.2158296 | 0 | -1 | [2, 4, 6, 8, 11, 14, 17, |\n", - "| | | | | | | | | | | 20, 23, 26, 29, 32, 35, |\n", - "| | | | | | | | | | | 38, 41, 44, 47, 50, 53, |\n", - "| | | | | | | | | | | 56] |\n", - "| 1 | 2 | 0 | 40288.33150186851 | Enter | MPI_Init | 3 | 193643835.4832178 | 1 | 1 | [] |\n", - "| 0 | 0 | 0 | 307730.9358165928 | Instant | ProgramBegin | -1 | nan | 0 | -1 | [] |\n", - "| 0 | 1 | 0 | 336979.73374932166 | Enter | int main(int, char**) | 58 | 199575243.23094556 | 0 | -1 | [2, 4, 6, 8, 11, 14, 17, |\n", - "| | | | | | | | | | | 20, 23, 26, 29, 32, 35, |\n", - "| | | | | | | | | | | 38, 41, 44, 47, 50, 53, |\n", - "| | | | | | | | | | | 56] |\n", - "| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |\n", - "| 1 | 57 | 0 | 199574793.63126454 | Leave | MPI_Finalize | 56 | 199529686.66029385 | 0 | -1 | [] |\n", - "| 0 | 58 | 0 | 199575243.23094556 | Leave | int main(int, char**) | 1 | 336979.73374932166 | 0 | -1 | [] |\n", - "| 1 | 58 | 0 | 199576798.2158296 | Leave | int main(int, char**) | 1 | 30083.086937435106 | 0 | -1 | [] |\n", - "| 0 | 59 | 0 | 199603304.5511645 | Instant | ProgramEnd | -1 | nan | 0 | -1 | [] |\n", - "| 1 | 59 | 0 | 199604459.57369962 | Instant | ProgramEnd | -1 | nan | 0 | -1 | [] |\n", - "+--------+-------+----------+--------------------+--------------+-----------------------+----------------+--------------------+---------+-------+--------------------------+\n", - "TraceDataset (2 traces, 120 events)\n" - ] - } - ], - "source": [ - "analyzer.ds.show()" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "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.8.10" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/pipit/config.py b/pipit/config.py deleted file mode 100644 index ff575453..00000000 --- a/pipit/config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "notebook_url": "http://localhost:8888", - "theme": """ - attrs: - Plot: - height: 350 - width: 700 - background_fill_color: "#fafafa" - Axis: - axis_label_text_font_style: "bold" - minor_tick_line_color: null - Toolbar: - autohide: true - logo: null - HoverTool: - point_policy: "follow_mouse" - Legend: - label_text_font_size: "8.5pt" - spacing: 10 - border_line_color: null - glyph_width: 16 - glyph_height: 16 - Scatter: - size: 9 - DataRange1d: - range_padding: 0.05 - """, -}