Skip to content

Commit

Permalink
feature: importing HPCToolkit data into Hatchet (#126)
Browse files Browse the repository at this point in the history
* feature: importing HPCToolkit data into Hatchet

* update: issues addressed in the pr fixed

* fix: treating PMPI/MPI differently

* remove: graphframe test file

* remove: hpctoolkit test files

* tests: unit tests for importing HPCToolkit data into Hatchet

* update: storing depth as Node attribute

* fix: update tests

* update: license comments inside test filed

* delete: remove src directory from the test performance db

* update: gitignore file

* update: formating + more tests

* update: mapping inclusive/exlusive metrics and time metric

* format: graphframe

* remove: __init__ file inside tests dir

---------

Co-authored-by: Dragana Grbic <grbic1@quartz2300.llnl.gov>
Co-authored-by: Dragana Grbic <grbic1@quartz770.llnl.gov>
Co-authored-by: Dragana Grbic <grbic1@quartz1538.llnl.gov>
Co-authored-by: Dragana Grbic <grbic1@quartz764.llnl.gov>
  • Loading branch information
5 people committed May 30, 2024
1 parent 9a4e09f commit fc47f96
Show file tree
Hide file tree
Showing 10 changed files with 3,286 additions and 11 deletions.
50 changes: 39 additions & 11 deletions hatchet/graphframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,28 @@
# SPDX-License-Identifier: MIT

import copy
import json
import sys
import traceback

from collections import defaultdict

import pandas as pd
import numpy as np
import multiprocess as mp
import json
import numpy as np
import pandas as pd

from .node import Node
from .graph import Graph
from .external.console import ConsoleRenderer
from .frame import Frame
from .graph import Graph
from .node import Node
from .query import (
is_hatchet_query,
AbstractQuery,
ObjectQuery,
parse_string_dialect,
QueryEngine,
AbstractQuery,
is_hatchet_query,
parse_string_dialect,
)
from .external.console import ConsoleRenderer
from .util.dot import trees_to_dot
from .util.deprecated import deprecated_params
from .util.dot import trees_to_dot

try:
from .cython_modules.libs import graphframe_modules as _gfm_cy
Expand Down Expand Up @@ -110,6 +109,35 @@ def from_hpctoolkit(dirname):

return HPCToolkitReader(dirname).read()

@staticmethod
def from_hpctoolkit_latest(
dirname: str,
max_depth: int = None,
min_percentage_of_application_time: int = None,
min_percentage_of_parent_time: int = None,
):
"""
Read an HPCToolkit database directory into a new GraphFrame
Arguments:
dirname (str): directory of an HPCToolkit performance database
max_depth (int): maximum depth that nodes in the CCT can have to be imported in Hatchet
min_percentage_of_application_time (int): minimum percentage of application time that nodes in the CCT must have to be imported in Hatchet
min_percentage_of_parent_time (int): minimum percentage of parent time that nodes in the CCT must have to be imported in Hatchet
Returns:
(GraphFrame): new GraphFrame containing HPCToolkit profile data
"""
# import this lazily to avoid circular dependencies
from .readers.hpctoolkit_reader_latest import HPCToolkitReaderLatest

return HPCToolkitReaderLatest(
dirname,
max_depth=max_depth,
min_application_percentage_time=min_percentage_of_application_time,
min_parent_percentage_time=min_percentage_of_parent_time,
).read()

@staticmethod
def from_caliper(filename_or_stream, query=None):
"""Read in a Caliper .cali or .json file.
Expand Down
Loading

0 comments on commit fc47f96

Please sign in to comment.