Skip to content

Conversation

GindaChen
Copy link
Collaborator

@GindaChen GindaChen commented Nov 26, 2023

Change overview

  • Add mem_profiler.template.cpp - a simple memory profiler that uses tcmalloc to log alloc/dealloc event.
  • Add memory profiling workflow (run_memprofile.sh). Usage: sh run_memprofiler.sh <ScaleFactor>.

Cavets

  • Must run on lab07. The script still assume we are on lab07 machine.
  • Must manually copy profiling code for memory profiling. So far we haven't found a good way to separate the profiler code from source code.

Example Usage

cd /home/junda/Scad/runtime/test/src/tpcds_1_cpp
sh run_memprofiler.sh 1 # test on scale factor 1 dataset
cd /home/junda/Scad/runtime/test/src/tpcds_1_cpp/analysis_memory
# see the output files:
# - tpcds_1.sf_1.lifetime.csv
#     Variable's lifetime. Schema: (variable, start_line, end_line)
# - tpcds_1.sf_1.line_activity.csv
#     Mem activity. Schema: (index, event, timestamp, size, line_num)
# - tpcds_1.sf_1.final.csv
#     Final result

@GindaChen GindaChen changed the base branch from main to numpy_c November 26, 2023 20:10
for child in node.get_children():
get_all_used_node_types(child)

get_all_used_node_types(_main_func)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def get_used_node_types(target):
    node_types = set()

    def get_all_used_node_types(node):
        node_types.add(node.kind)
        for child in node.get_children():
            get_all_used_node_types(child)

    get_all_used_node_types(target)
    return node_types



def describe_with_source(node):
f = _main_func.extent.start.file.name
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    f = node.extent.start.file.name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant