-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from lanl/refactor
Refactor
- Loading branch information
Showing
18 changed files
with
3,680 additions
and
1,170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.1...3.25) | ||
|
||
project( | ||
gs_patterns | ||
VERSION 1.0 | ||
LANGUAGES C) | ||
project( gs_patterns VERSION 1.0 LANGUAGES CXX) | ||
|
||
add_executable(gs_patterns gs_patterns.c) | ||
set (CMAKE_C_FLAGS "-lz -lm") | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED On) | ||
#set(CMAKE_CXX_EXTENSIONS Off) | ||
|
||
add_library(gs_patterns_core SHARED | ||
utils.h | ||
utils.cpp | ||
gs_patterns.h | ||
gs_patterns_core.h | ||
gs_patterns_core.cpp | ||
gsnv_patterns.h | ||
gsnv_patterns.cpp | ||
gspin_patterns.h | ||
gspin_patterns.cpp | ||
) | ||
|
||
add_executable( gs_patterns | ||
gs_patterns_main.cpp | ||
) | ||
|
||
target_link_libraries(gs_patterns gs_patterns_core) | ||
|
||
set(CMAKE_CXX_STANDARD_LIBRARIES "-lm -lz ${CMAKE_CXX_STANDARD_LIBRARIES}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# Description | ||
Memory analysis tool for finding nontrivial gather / scatter (g/s) accesses from DynamoRio formatted traces. gs_patterns doesn't just look for explicit g/s instructions, but also all other scalar accesses in loops. gs_patterns writes the subtraces to binary traces and a spatter yaml formatted file. The source lines of the top aggressors are reported. Use the provided pin clients in the pin_tracing folder or use DynamoRio. Pin tends to be more reliable for larger applications. | ||
Memory analysis tool for finding nontrivial gather / scatter (g/s) accesses from DynamoRio & NVBit traces. gs_patterns writes the subtraces to binary traces and a spatter yaml formatted file. The source lines of the top aggressors are reported. Use the provided pin clients in the pin_tracing folder or use DynamoRio. Pin tends to be more reliable for larger applications. | ||
|
||
For CUDA kernels use the provided nvbit client in the nvbit_tracing folder. | ||
|
||
See the README in the respective folders for more detailed information on these tools. | ||
|
||
|
||
# Build | ||
``` | ||
|
@@ -10,16 +15,28 @@ make | |
``` | ||
|
||
# Use | ||
|
||
## For Pin/DynamoRio | ||
``` | ||
gs_pattern <pin_trace.gz> <binary> | ||
``` | ||
gs_pattern <trace.gz> <binary> | ||
|
||
## For NVBit (CUDA Kernels) | ||
|
||
``` | ||
gs_pattern <nvbit_trace.gz> -nv | ||
``` | ||
trace file should be gzipped (not tar + gz). Binary file should be compiled with symbols turned on (-g) | ||
|
||
Trace file should be gzipped (not tar + gz). For Pin or DynamoRio, binary file should be compiled with symbols turned on (-g). | ||
|
||
For NVBit tracing the kernel must be compiled with line numbers (--generate-line-info). Please see nvbit_tracing/README.md for detailed information on how to extract traces for CUDA kernels which are compatible with gs_patterns. | ||
|
||
# How gs_patterns works | ||
g/s accesses are found by looking at repeated instruction addresses (loops) that are memory instructions (scalar and vector). The first pass finds the top g/s's and filters out instructions with trivial access patterns. The second pass focuses on the top g/s accesses and records the normalized address array indices to a binary file and spatter yaml file. | ||
|
||
# License | ||
BSD-3 License. See [the LICENSE file](https://github.com/lanl/gs_patterns/blob/main/LICENSE). | ||
|
||
# Author | ||
# Authors | ||
Kevin Sheridan, <[email protected]> | ||
Christopher Scott, <[email protected]> |
Oops, something went wrong.