Skip to content

Commit

Permalink
MPI events, and some general realism changes
Browse files Browse the repository at this point in the history
  • Loading branch information
joshop authored and bhatele committed Oct 9, 2023
1 parent 42725cf commit 17afcd6
Show file tree
Hide file tree
Showing 3 changed files with 260 additions and 21 deletions.
8 changes: 8 additions & 0 deletions pipit/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import numpy as np
import pandas as pd
import ast


class Trace:
Expand Down Expand Up @@ -72,6 +73,13 @@ def from_csv(filename):
# ensure that ranks are ints
events_dataframe = events_dataframe.astype({"Process": "int32"})

# ensure that the attributes are a dict, not a string
if "Attributes" in events_dataframe.columns:
# use literal_eval so we're not running a security risk
events_dataframe["Attributes"] = events_dataframe["Attributes"].apply(
ast.literal_eval
)

# make certain columns categorical
events_dataframe = events_dataframe.astype(
{
Expand Down
8 changes: 6 additions & 2 deletions pipit/util/fake.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from pipit import Trace
import numpy as np
from faketest import gen_fake_tree, emit_tree_file
from faketest import gen_fake_tree, emit_tree_file, gen_forest
import pandas as pd


function_names = ["foo", "bar", "baz", "quux", "grault", "garply", "waldo"]


def test_with_fake_data():
"""
Generate a fake test file and ground truth file, read the test file
Expand All @@ -12,7 +15,8 @@ def test_with_fake_data():
"""
num_processes = 8
# generate one fake tree per process, 2000 functions in the tree
trees = [gen_fake_tree(2000) for n in range(num_processes)]
seed_tree = gen_fake_tree(200, function_names)
trees = gen_forest(seed_tree, num_processes)
test_file = open("fake.csv", "w")
ground_truth = open("fake_ground.csv", "w")
emit_tree_file(trees, test_file, ground_truth)
Expand Down
Loading

0 comments on commit 17afcd6

Please sign in to comment.