|
26 | 26 | from .importer import RocpdImportData |
27 | 27 | from .time_window import apply_time_window |
28 | 28 | from . import output_config |
29 | | -from . import libpyrocpd |
| 29 | +from .otf2_writer import write_otf2 as py_write_otf2 |
30 | 30 |
|
31 | 31 |
|
32 | 32 | def write_otf2(importData, config): |
33 | | - return libpyrocpd.write_otf2(importData, config) |
| 33 | + py_write_otf2(importData, config) |
| 34 | + |
| 35 | + # Read back the written OTF2 file and print its contents |
| 36 | + # from pathlib import Path |
| 37 | + # import importlib.util |
| 38 | + # import os |
| 39 | + |
| 40 | + # otf2_reader_path = os.path.join( |
| 41 | + # os.path.dirname(__file__), |
| 42 | + # "..", |
| 43 | + # "..", |
| 44 | + # "..", |
| 45 | + # "..", |
| 46 | + # "tests", |
| 47 | + # "pytest-packages", |
| 48 | + # "rocprofiler_sdk", |
| 49 | + # "pytest_utils", |
| 50 | + # "otf2_reader.py", |
| 51 | + # ) |
| 52 | + # otf2_reader_path = os.path.abspath(otf2_reader_path) |
| 53 | + # spec = importlib.util.spec_from_file_location("otf2_reader", otf2_reader_path) |
| 54 | + # otf2_reader = importlib.util.module_from_spec(spec) |
| 55 | + # spec.loader.exec_module(otf2_reader) |
| 56 | + # OTF2Reader = otf2_reader.OTF2Reader |
| 57 | + |
| 58 | + # trace_dir = getattr(config, "output_path", "./otf_traces") |
| 59 | + # trace_file = f"{getattr(config, "output_file", "traces")}_results" |
| 60 | + # otf2_path = f"{trace_dir}/{trace_file}.otf2" |
| 61 | + ## Read and print contents |
| 62 | + # import pdb |
| 63 | + |
| 64 | + # pdb.set_trace() |
| 65 | + # df, _ = OTF2Reader(otf2_path).read() |
| 66 | + # print(f"\nOTF2Reader DataFrame:\n{df}") |
34 | 67 |
|
35 | 68 |
|
36 | 69 | def execute(input, config=None, window_args=None, **kwargs): |
|
0 commit comments