Various optimizations (#192)
* CDash name prefix {{ repo_owner }}-{{ ref_name }}
- remove /merge from CI name
* disable using BFD when sampling_include_inlines is OFF
- this consumes a lot of memory
* Improve finalization of rocprofiler
* update timemory submodule
- disable OMPT thread begin/end callbacks
- support hierarchies in signal handlers
- update operation::pop_node debugging
- settings_update_type + setting_supported_data_types
- fixed parsing args in timemory_init
* Improve timemory build time
* Remove kokkosp restrictions for perfetto
* omnitrace exe signal handler update
- configure signal handlers before main to allow libomnitrace to override
* Backtrace and timemory submodule updates
- Use unwind::cache w/o inline info
- update timemory submodule
- unwind::cache updates
- filepath updates
- fix termination_signal_message
- fix vsettings::report_change
* Update dyninst submodule
- updates BinaryEdit::getResolvedLibraryPath
* update timemory submodule
- update CpuArch support
* Cleanup configure warnings
* Update examples cmake and workflows
- (Mostly) eliminate configuration warnings
* omnitrace exe updates
- pass environ to BPatch::processCreate
- avoid trailing ":" in DYNINST_REWRITER_PATHS
* Update dyninst submodule
- Add flags to DyninstOptimization.cmake
- Remove strtok from BinaryEdit::getResolvedLibraryPath
* examples/mpi CMakeLists.txt update
- STATUS message about missing MPI during CI, otherwise AUTHOR_WARNING
* Dev build and linker flags
- use -gsplit-dwarf when OMNITRACE_BUILD_DEVELOPER is ON
- disable when OMNITRACE_BUILD_NUMBER > 1
- OMNITRACE_BUILD_LINKER option
- add -fuse-ld=${OMNITRACE_BUILD_LINKER}
- omnitrace_add_cache_option function
* Update workflows to set OMNITRACE_BUILD_NUMBER
* Fix generator expressions for -fuse-ld
* Suppress some configuration warnings during CI
- helps to keep track of real warnings when they arise
* Update timemory and dyninst submodules with CMP0135
* Add -V flag to run-ci script
Bu işleme şunda yer alıyor:
işlemeyi yapan:
GitHub
ebeveyn
b23b581563
işleme
f147670a7a
@@ -11,6 +11,10 @@ concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
OMNITRACE_VERBOSE: 1
|
||||
OMNITRACE_CI: ON
|
||||
|
||||
jobs:
|
||||
opensuse:
|
||||
runs-on: ubuntu-20.04
|
||||
@@ -23,10 +27,6 @@ jobs:
|
||||
os-release: [ '15.2', '15.3' ]
|
||||
build-type: ['Release']
|
||||
|
||||
env:
|
||||
OMNITRACE_VERBOSE: 1
|
||||
OMNITRACE_CI: ON
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
git config --global --add safe.directory ${PWD} &&
|
||||
cmake --version &&
|
||||
./scripts/run-ci.sh -B build
|
||||
--name opensuse-${{ matrix.os-release }}-${{ matrix.compiler }}-nompi-python
|
||||
--name ${{ github.repository_owner }}-${{ github.ref_name }}-opensuse-${{ matrix.os-release }}-${{ matrix.compiler }}-nompi-python
|
||||
--build-jobs 2
|
||||
--site GitHub
|
||||
--cmake-args
|
||||
@@ -62,10 +62,13 @@ jobs:
|
||||
-DOMNITRACE_USE_HIP=OFF
|
||||
-DOMNITRACE_USE_OMPT=OFF
|
||||
-DOMNITRACE_USE_PYTHON=ON
|
||||
-DOMNITRACE_USE_MPI_HEADERS=ON
|
||||
-DOMNITRACE_PYTHON_PREFIX=/opt/conda/envs
|
||||
-DOMNITRACE_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10"
|
||||
-DOMNITRACE_CI_MPI_RUN_AS_ROOT=ON
|
||||
-DOMNITRACE_MAX_THREADS=32
|
||||
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
|
||||
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
|
||||
|
||||
- name: Install
|
||||
timeout-minutes: 10
|
||||
|
||||
@@ -78,11 +78,12 @@ jobs:
|
||||
timeout-minutes: 115
|
||||
shell: bash
|
||||
run:
|
||||
git config --global --add safe.directory ${PWD} &&
|
||||
cmake --version &&
|
||||
if [ "${{ matrix.mpi }}" = "nompi" ]; then USE_MPI=OFF; else USE_MPI=ON; fi &&
|
||||
append-tagname() { if [ "${1}" == "ON" ]; then TAG="${TAG}-${2}"; fi; } &&
|
||||
./scripts/run-ci.sh -B build
|
||||
--name ubuntu-bionic-${{ matrix.compiler }}-${{ matrix.mpi }}-python
|
||||
--name ${{ github.repository_owner }}-${{ github.ref_name }}-ubuntu-bionic-${{ matrix.compiler }}-${{ matrix.mpi }}-python
|
||||
--build-jobs 2
|
||||
--site GitHub
|
||||
--cmake-args
|
||||
@@ -99,6 +100,8 @@ jobs:
|
||||
-DOMNITRACE_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10"
|
||||
-DLULESH_BUILD_KOKKOS=OFF
|
||||
-DOMNITRACE_MAX_THREADS=32
|
||||
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
|
||||
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
|
||||
|
||||
- name: Install
|
||||
run:
|
||||
|
||||
@@ -103,7 +103,7 @@ jobs:
|
||||
append-tagname ${{ matrix.static-libstdcxx }} libstdcxx &&
|
||||
cmake --version &&
|
||||
./scripts/run-ci.sh -B build
|
||||
--name ubuntu-focal-${{ matrix.compiler }}${TAG}
|
||||
--name ${{ github.repository_owner }}-${{ github.ref_name }}-ubuntu-focal-${{ matrix.compiler }}${TAG}
|
||||
--build-jobs 2
|
||||
--site GitHub
|
||||
--cmake-args
|
||||
@@ -125,6 +125,8 @@ jobs:
|
||||
-DOMNITRACE_PYTHON_PREFIX=/opt/conda/envs
|
||||
-DOMNITRACE_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10"
|
||||
-DOMNITRACE_MAX_THREADS=32
|
||||
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
|
||||
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
|
||||
|
||||
- name: Test Build-Tree Module
|
||||
timeout-minutes: 45
|
||||
@@ -282,7 +284,7 @@ jobs:
|
||||
TAG="-rocm-${{ matrix.rocm-version }}" &&
|
||||
TAG="$(echo ${TAG} | sed 's/debian/latest/g')" &&
|
||||
./scripts/run-ci.sh -B build
|
||||
--name ubuntu-focal-rocm-${{ matrix.compiler }}${TAG}
|
||||
--name ${{ github.repository_owner }}-${{ github.ref_name }}-ubuntu-focal-rocm-${{ matrix.compiler }}${TAG}
|
||||
--build-jobs 2
|
||||
--site GitHub
|
||||
--cmake-args
|
||||
@@ -306,7 +308,9 @@ jobs:
|
||||
-DOMNITRACE_PYTHON_PREFIX=/opt/conda/envs
|
||||
-DOMNITRACE_PYTHON_ENVS="py3.6;py3.7;py3.8;py3.9;py3.10"
|
||||
-DOMNITRACE_CI_MPI_RUN_AS_ROOT=${{ matrix.mpi-headers }}
|
||||
-DOMNITRACE_CI_GPU=OFF
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF
|
||||
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
|
||||
--ctest-args
|
||||
${{ matrix.ctest-exclude }}
|
||||
|
||||
@@ -382,7 +386,6 @@ jobs:
|
||||
env:
|
||||
ELFUTILS_DOWNLOAD_VERSION: 0.186
|
||||
OMNITRACE_VERBOSE: 1
|
||||
OMNITRACE_CI: ON
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -420,7 +423,7 @@ jobs:
|
||||
if [ "${{ matrix.mpi }}" = "nompi" ]; then USE_MPI=OFF; else USE_MPI=ON; fi &&
|
||||
if [ -z "${{ matrix.deps }}" ]; then TAG=""; else TAG="-external-deps"; fi &&
|
||||
./scripts/run-ci.sh -B ${{ github.workspace }}/build
|
||||
--name ubuntu-focal-${{ matrix.compiler }}-${{ matrix.mpi }}${TAG}
|
||||
--name ${{ github.repository_owner }}-${{ github.ref_name }}-ubuntu-focal-${{ matrix.compiler }}-${{ matrix.mpi }}${TAG}
|
||||
--build-jobs 2
|
||||
--site GitHub
|
||||
--cmake-args
|
||||
@@ -443,6 +446,8 @@ jobs:
|
||||
-DDYNINST_BUILD_STATIC_LIBS=OFF
|
||||
-DDYNINST_ELFUTILS_DOWNLOAD_VERSION=${{ env.ELFUTILS_DOWNLOAD_VERSION }}
|
||||
-DOMNITRACE_MAX_THREADS=32
|
||||
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
|
||||
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
|
||||
|
||||
- name: Test Build-Tree Env
|
||||
timeout-minutes: 60
|
||||
@@ -550,7 +555,7 @@ jobs:
|
||||
git config --global --add safe.directory ${PWD} &&
|
||||
cmake --version &&
|
||||
./scripts/run-ci.sh -B build
|
||||
--name ubuntu-focal-codecov-mpi-python-ompt-papi
|
||||
--name ${{ github.repository_owner }}-${{ github.ref_name }}-ubuntu-focal-codecov-mpi-python-ompt-papi
|
||||
--build-jobs 2
|
||||
--site GitHub
|
||||
--coverage
|
||||
@@ -564,5 +569,7 @@ jobs:
|
||||
-DOMNITRACE_USE_OMPT=ON
|
||||
-DOMNITRACE_USE_PAPI=ON
|
||||
-DOMNITRACE_USE_HIP=OFF
|
||||
-DOMNITRACE_USE_RCCL=ON
|
||||
-DOMNITRACE_USE_RCCL=OFF
|
||||
-DOMNITRACE_MAX_THREADS=32
|
||||
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
|
||||
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
|
||||
|
||||
@@ -123,7 +123,7 @@ jobs:
|
||||
append-tagname ${{ matrix.static-libgcc }} libgcc &&
|
||||
append-tagname ${{ matrix.static-libstdcxx }} libstdcxx &&
|
||||
./scripts/run-ci.sh -B build
|
||||
--name ubuntu-jammy-${{ matrix.compiler }}${TAG}
|
||||
--name ${{ github.repository_owner }}-${{ github.ref_name }}-ubuntu-jammy-${{ matrix.compiler }}${TAG}
|
||||
--build-jobs 2
|
||||
--site GitHub
|
||||
--cmake-args
|
||||
@@ -147,6 +147,8 @@ jobs:
|
||||
-DOMNITRACE_PYTHON_ENVS="py3.7;py3.8;py3.9;py3.10"
|
||||
-DOMNITRACE_STRIP_LIBRARIES=${{ matrix.strip }}
|
||||
-DOMNITRACE_MAX_THREADS=32
|
||||
-DOMNITRACE_DISABLE_EXAMPLES="transpose;rccl"
|
||||
-DOMNITRACE_BUILD_NUMBER=${{ github.run_attempt }}
|
||||
-DUSE_CLANG_OMP=OFF
|
||||
|
||||
- name: Install
|
||||
|
||||
+19
-2
@@ -33,11 +33,21 @@ if(Git_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --tags
|
||||
OUTPUT_VARIABLE OMNITRACE_GIT_DESCRIBE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE _GIT_DESCRIBE_RESULT
|
||||
ERROR_QUIET)
|
||||
if(NOT _GIT_DESCRIBE_RESULT EQUAL 0)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe
|
||||
OUTPUT_VARIABLE OMNITRACE_GIT_DESCRIBE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE _GIT_DESCRIBE_RESULT
|
||||
ERROR_QUIET)
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||
OUTPUT_VARIABLE OMNITRACE_GIT_REVISION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
|
||||
else()
|
||||
set(OMNITRACE_GIT_DESCRIBE "v${OMNITRACE_VERSION}")
|
||||
set(OMNITRACE_GIT_REVISION "")
|
||||
@@ -184,6 +194,13 @@ endif()
|
||||
if(OMNITRACE_USE_PYTHON)
|
||||
omnitrace_add_option(OMNITRACE_BUILD_PYTHON
|
||||
"Build python bindings with internal pybind11" ON)
|
||||
elseif("$ENV{OMNITRACE_CI}")
|
||||
# quiet warnings in dashboard
|
||||
if(OMNITRACE_PYTHON_ENVS OR OMNITRACE_PYTHON_PREFIX)
|
||||
omnitrace_message(
|
||||
STATUS
|
||||
"Ignoring values of OMNITRACE_PYTHON_ENVS and/or OMNITRACE_PYTHON_PREFIX")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT OMNITRACE_USE_HIP)
|
||||
|
||||
@@ -27,6 +27,11 @@ omnitrace_add_option(OMNITRACE_BUILD_STATIC_LIBGCC
|
||||
omnitrace_add_option(OMNITRACE_BUILD_STATIC_LIBSTDCXX
|
||||
"Build with -static-libstdc++ if possible" OFF)
|
||||
omnitrace_add_option(OMNITRACE_BUILD_STACK_PROTECTOR "Build with -fstack-protector" ON)
|
||||
omnitrace_add_cache_option(
|
||||
OMNITRACE_BUILD_LINKER
|
||||
"If set to a non-empty value, pass -fuse-ld=\${OMNITRACE_BUILD_LINKER}" STRING "bfd")
|
||||
omnitrace_add_cache_option(OMNITRACE_BUILD_NUMBER "Internal CI use" STRING "0" ADVANCED
|
||||
NO_FEATURE)
|
||||
|
||||
omnitrace_add_interface_library(omnitrace-static-libgcc
|
||||
"Link to static version of libgcc")
|
||||
@@ -224,6 +229,16 @@ if(OMNITRACE_BUILD_DEVELOPER)
|
||||
omnitrace-compile-options "-Werror" "-Wdouble-promotion" "-Wshadow" "-Wextra"
|
||||
"-Wpedantic" "-Wstack-usage=524288" # 512 KB
|
||||
"/showIncludes")
|
||||
if(OMNITRACE_BUILD_NUMBER LESS 2)
|
||||
add_target_flag_if_avail(omnitrace-compile-options "-gsplit-dwarf")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(OMNITRACE_BUILD_LINKER)
|
||||
target_link_options(
|
||||
omnitrace-compile-options INTERFACE
|
||||
$<$<C_COMPILER_ID:GNU>:-fuse-ld=${OMNITRACE_BUILD_LINKER}>
|
||||
$<$<CXX_COMPILER_ID:GNU>:-fuse-ld=${OMNITRACE_BUILD_LINKER}>)
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------------------#
|
||||
|
||||
@@ -375,6 +375,40 @@ function(OMNITRACE_ADD_OPTION _NAME _MESSAGE _DEFAULT)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# ----------------------------------------------------------------------------------------#
|
||||
# function omnitrace_add_cache_option(<OPTION_NAME> <DOCSRING> <TYPE> <DEFAULT_VALUE>
|
||||
# [NO_FEATURE] [ADVANCED] [CMAKE_DEFINE])
|
||||
#
|
||||
function(OMNITRACE_ADD_CACHE_OPTION _NAME _MESSAGE _TYPE _DEFAULT)
|
||||
set(_FORCE)
|
||||
if("FORCE" IN_LIST ARGN)
|
||||
set(_FORCE FORCE)
|
||||
endif()
|
||||
|
||||
set(${_NAME}
|
||||
"${_DEFAULT}"
|
||||
CACHE ${_TYPE} "${_MESSAGE}" ${_FORCE})
|
||||
|
||||
if("NO_FEATURE" IN_LIST ARGN)
|
||||
mark_as_advanced(${_NAME})
|
||||
else()
|
||||
omnitrace_add_feature(${_NAME} "${_MESSAGE}")
|
||||
|
||||
if(OMNITRACE_BUILD_DOCS)
|
||||
set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME}_CMAKE_OPTIONS_DOC
|
||||
"${_NAME}` | ${_MESSAGE} |")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("ADVANCED" IN_LIST ARGN)
|
||||
mark_as_advanced(${_NAME})
|
||||
endif()
|
||||
|
||||
if("CMAKE_DEFINE" IN_LIST ARGN)
|
||||
set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME}_CMAKE_DEFINES ${_NAME})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# ----------------------------------------------------------------------------------------#
|
||||
# function omnitrace_report_feature_changes() :: print changes in features
|
||||
#
|
||||
|
||||
@@ -109,7 +109,7 @@ elseif("${MPI_HEADERS_VENDOR}" STREQUAL "MPICH")
|
||||
option(
|
||||
MPI_HEADERS_ALLOW_MPICH
|
||||
"Permit the use of MPI headers from MPICH instead of using internal OpenMPI header"
|
||||
)
|
||||
OFF)
|
||||
mark_as_advanced(MPI_HEADERS_ALLOW_MPICH)
|
||||
if(NOT MPI_HEADERS_ALLOW_MPICH)
|
||||
set(_MESSAGE "\nFound MPI headers belonging to a MPICH distribution. ")
|
||||
|
||||
@@ -536,8 +536,11 @@ endif()
|
||||
#
|
||||
# ----------------------------------------------------------------------------------------#
|
||||
|
||||
target_compile_definitions(omnitrace-timemory-config INTERFACE TIMEMORY_PAPI_ARRAY_SIZE=12
|
||||
TIMEMORY_USE_ROOFLINE=0)
|
||||
target_compile_definitions(
|
||||
omnitrace-timemory-config
|
||||
INTERFACE TIMEMORY_PAPI_ARRAY_SIZE=12 TIMEMORY_USE_ROOFLINE=0 TIMEMORY_USE_ERT=0
|
||||
TIMEMORY_USE_CONTAINERS=0 TIMEMORY_USE_ERT_EXTERN=0
|
||||
TIMEMORY_USE_CONTAINERS_EXTERN=0)
|
||||
|
||||
if(OMNITRACE_BUILD_STACK_PROTECTOR)
|
||||
add_target_flag_if_avail(omnitrace-timemory-config "-fstack-protector-strong"
|
||||
@@ -628,6 +631,9 @@ set(TIMEMORY_BUILD_EXTRA_OPTIMIZATIONS
|
||||
set(TIMEMORY_BUILD_ERT
|
||||
OFF
|
||||
CACHE BOOL "Disable building ERT support" FORCE)
|
||||
set(TIMEMORY_BUILD_CONTAINERS
|
||||
OFF
|
||||
CACHE BOOL "Disable building container extern templates (unused)" FORCE)
|
||||
|
||||
# timemory build settings
|
||||
set(TIMEMORY_TLS_MODEL
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
|
||||
|
||||
project(omnitrace-code-coverage LANGUAGES CXX)
|
||||
project(omnitrace-code-coverage-example LANGUAGES CXX)
|
||||
|
||||
if(OMNITRACE_DISABLE_EXAMPLES)
|
||||
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
|
||||
OMNITRACE_DISABLE_EXAMPLES)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
||||
string(REPLACE " " ";" _FLAGS "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
project(lulesh LANGUAGES C CXX)
|
||||
project(omnitrace-lulesh-example LANGUAGES C CXX)
|
||||
|
||||
if(OMNITRACE_DISABLE_EXAMPLES)
|
||||
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
|
||||
OMNITRACE_DISABLE_EXAMPLES)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
||||
|
||||
@@ -54,9 +63,9 @@ endif()
|
||||
file(GLOB headers ${PROJECT_SOURCE_DIR}/*.h ${PROJECT_SOURCE_DIR}/*.hxx)
|
||||
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.cc)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${sources} ${headers})
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/includes)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Kokkos::kokkos lulesh-mpi)
|
||||
add_executable(lulesh ${sources} ${headers})
|
||||
target_include_directories(lulesh PRIVATE ${PROJECT_SOURCE_DIR}/includes)
|
||||
target_link_libraries(lulesh PRIVATE Kokkos::kokkos lulesh-mpi)
|
||||
|
||||
if(OMNITRACE_INSTALL_EXAMPLES)
|
||||
if(LULESH_BUILD_KOKKOS)
|
||||
@@ -64,12 +73,11 @@ if(OMNITRACE_INSTALL_EXAMPLES)
|
||||
TARGETS kokkoscore kokkoscontainers
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
COMPONENT omnitrace-examples)
|
||||
set_target_properties(
|
||||
${PROJECT_NAME} PROPERTIES INSTALL_RPATH
|
||||
"\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
|
||||
set_target_properties(lulesh PROPERTIES INSTALL_RPATH
|
||||
"\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
install(
|
||||
TARGETS ${PROJECT_NAME}
|
||||
TARGETS lulesh
|
||||
DESTINATION bin
|
||||
COMPONENT omnitrace-examples)
|
||||
endif()
|
||||
|
||||
@@ -2,9 +2,23 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
project(omnitrace-mpi-examples LANGUAGES C CXX)
|
||||
|
||||
if(OMNITRACE_DISABLE_EXAMPLES)
|
||||
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
|
||||
OMNITRACE_DISABLE_EXAMPLES)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(MPI)
|
||||
if(NOT MPI_FOUND)
|
||||
message(AUTHOR_WARNING "MPI could not be found. Cannot build omnitrace-mpi target")
|
||||
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace" AND "$ENV{OMNITRACE_CI}")
|
||||
set(_MSG_TYPE STATUS) # don't generate warnings during CI
|
||||
else()
|
||||
set(_MSG_TYPE AUTHOR_WARNING)
|
||||
endif()
|
||||
message(${_MSG_TYPE} "MPI could not be found. Cannot build omnitrace-mpi target")
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
project(omnitrace-parallel-overhead LANGUAGES CXX)
|
||||
project(omnitrace-parallel-overhead-example LANGUAGES CXX)
|
||||
|
||||
if(OMNITRACE_DISABLE_EXAMPLES)
|
||||
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
|
||||
OMNITRACE_DISABLE_EXAMPLES)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
@@ -2,6 +2,15 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
project(omnitrace-python)
|
||||
|
||||
if(OMNITRACE_DISABLE_EXAMPLES)
|
||||
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
|
||||
OMNITRACE_DISABLE_EXAMPLES)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(PYTHON_FILES builtin.py external.py source.py noprofile.py fill.py)
|
||||
|
||||
find_package(Python3 COMPONENTS Interpreter)
|
||||
|
||||
@@ -2,17 +2,46 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
project(omnitrace-rccl-example LANGUAGES CXX)
|
||||
|
||||
find_package(rccl)
|
||||
find_package(hip HINTS ${ROCmVersion_DIR} PATHS ${ROCmVersion_DIR})
|
||||
if(OMNITRACE_DISABLE_EXAMPLES)
|
||||
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
function(rccl_message)
|
||||
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
|
||||
OMNITRACE_DISABLE_EXAMPLES)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
function(rccl_message _MSG_TYPE)
|
||||
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace"
|
||||
AND "$ENV{OMNITRACE_CI}"
|
||||
AND "${_MSG_TYPE}" MATCHES "WARNING")
|
||||
set(_MSG_TYPE STATUS) # don't generate warnings during CI
|
||||
endif()
|
||||
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace")
|
||||
omnitrace_message(${ARGN})
|
||||
omnitrace_message(${_MSG_TYPE} ${ARGN})
|
||||
else()
|
||||
message(${ARGN})
|
||||
message(${_MSG_TYPE} ${ARGN})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
find_package(hip HINTS ${ROCmVersion_DIR} PATHS ${ROCmVersion_DIR})
|
||||
|
||||
if(NOT hip_FOUND)
|
||||
rccl_message(AUTHOR_WARNING "${PROJECT_NAME} skipped. Missing HIP...")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace" AND "$ENV{OMNITRACE_CI}")
|
||||
find_package(rccl QUIET) # avoid generating warning in CI
|
||||
else()
|
||||
find_package(rccl)
|
||||
endif()
|
||||
|
||||
if(NOT rccl_FOUND)
|
||||
rccl_message(AUTHOR_WARNING "${PROJECT_NAME} skipped. Missing RCCL...")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(hip_FOUND AND rccl_FOUND)
|
||||
include(FetchContent)
|
||||
fetchcontent_declare(
|
||||
@@ -56,6 +85,4 @@ if(hip_FOUND AND rccl_FOUND)
|
||||
"${_RCCL_TEST_TARGETS}"
|
||||
CACHE INTERNAL "rccl-test targets")
|
||||
endif()
|
||||
else()
|
||||
rccl_message(AUTHOR_WARNING "${PROJECT_NAME} skipped. Missing RCCL and/or HIP...")
|
||||
endif()
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
project(omnitrace-transpose LANGUAGES CXX)
|
||||
project(omnitrace-transpose-example LANGUAGES CXX)
|
||||
|
||||
if(OMNITRACE_DISABLE_EXAMPLES)
|
||||
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
|
||||
OMNITRACE_DISABLE_EXAMPLES)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(hip QUIET HINTS ${ROCmVersion_DIR} PATHS ${ROCmVersion_DIR})
|
||||
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
project(omnitrace-user-api LANGUAGES CXX)
|
||||
project(omnitrace-user-api-example LANGUAGES CXX)
|
||||
|
||||
if(OMNITRACE_DISABLE_EXAMPLES)
|
||||
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
|
||||
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
|
||||
OMNITRACE_DISABLE_EXAMPLES)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_BUILD_TYPE "Debug")
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
Sağlanmış
+1
-1
external/dyninst alt modülü güncellendi: 65c34d95ea...7ae32b5796
Sağlanmış
+1
-1
external/timemory alt modülü güncellendi: d5e3987802...7a6a361eb8
@@ -80,7 +80,7 @@ do
|
||||
;;
|
||||
-n|--name)
|
||||
shift
|
||||
NAME=$(echo ${1} | sed 's/g++/gcc/g')
|
||||
NAME=$(echo ${1} | sed 's/g++/gcc/g' | sed 's/\/merge//1')
|
||||
reset-last
|
||||
;;
|
||||
-s|--site)
|
||||
@@ -249,4 +249,4 @@ EOF
|
||||
|
||||
verbose-run cat CTestCustom.cmake
|
||||
verbose-run cat dashboard.cmake
|
||||
verbose-run ctest ${CDASH_ARGS} -S dashboard.cmake --output-on-failure ${CTEST_ARGS}
|
||||
verbose-run ctest ${CDASH_ARGS} -S dashboard.cmake --output-on-failure -V ${CTEST_ARGS}
|
||||
|
||||
@@ -130,6 +130,12 @@ std::unique_ptr<std::ofstream> log_ofs = {};
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace process = tim::process;
|
||||
namespace signals = tim::signals;
|
||||
|
||||
using signal_settings = tim::signals::signal_settings;
|
||||
using sys_signal = tim::signals::sys_signal;
|
||||
|
||||
bool binary_rewrite = false;
|
||||
bool is_attached = false;
|
||||
bool use_mpi = false;
|
||||
@@ -188,9 +194,60 @@ get_cwd();
|
||||
|
||||
void
|
||||
find_dyn_api_rt();
|
||||
} // namespace
|
||||
|
||||
namespace process = tim::process;
|
||||
void
|
||||
activate_signal_handlers(const std::vector<sys_signal>& _signals)
|
||||
{
|
||||
for(const auto& itr : _signals)
|
||||
signal_settings::enable(itr);
|
||||
|
||||
static bool _protect = false;
|
||||
auto _exit_action = [](int nsig) {
|
||||
if(_protect) return;
|
||||
_protect = true;
|
||||
TIMEMORY_PRINTF_FATAL(
|
||||
stderr, "omnitrace exited with signal %i :: %s\n", nsig,
|
||||
signal_settings::str(static_cast<sys_signal>(nsig)).c_str());
|
||||
|
||||
// print the last log entries
|
||||
print_log_entries(std::cerr, num_log_entries);
|
||||
|
||||
// print any forced entries
|
||||
print_log_entries(
|
||||
std::cerr, -1, [](const auto& _v) { return _v.forced(); },
|
||||
[]() {
|
||||
tim::log::stream(std::cerr, tim::log::color::info())
|
||||
<< "\n[omnitrace][exe] Potentially important log entries:\n\n";
|
||||
});
|
||||
|
||||
TIMEMORY_PRINTF_FATAL(stderr, "\n");
|
||||
TIMEMORY_PRINTF_FATAL(
|
||||
stderr,
|
||||
"These were the last %i log entries from omnitrace. You can control the "
|
||||
"number of log entries via the '--log <N>' option or OMNITRACE_LOG_COUNT "
|
||||
"env variable.\n",
|
||||
num_log_entries);
|
||||
|
||||
if(log_ofs) log_ofs->close();
|
||||
log_ofs.reset();
|
||||
|
||||
_protect = false;
|
||||
};
|
||||
|
||||
signal_settings::set_exit_action(_exit_action);
|
||||
signal_settings::check_environment();
|
||||
signals::enable_signal_detection(signal_settings::get_enabled());
|
||||
}
|
||||
|
||||
// default signals to catch
|
||||
auto _activate =
|
||||
(activate_signal_handlers({ sys_signal::Interrupt, sys_signal::FPE, sys_signal::Stop,
|
||||
sys_signal::Quit, sys_signal::Illegal, sys_signal::Abort,
|
||||
sys_signal::Bus, sys_signal::SegFault,
|
||||
sys_signal::FileSize, sys_signal::CPUtime }),
|
||||
true);
|
||||
|
||||
} // namespace
|
||||
|
||||
//======================================================================================//
|
||||
//
|
||||
@@ -201,56 +258,6 @@ namespace process = tim::process;
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
{
|
||||
using signal_settings = tim::signals::signal_settings;
|
||||
using sys_signal = tim::signals::sys_signal;
|
||||
|
||||
// default signals to catch
|
||||
for(const auto& itr :
|
||||
{ sys_signal::Interrupt, sys_signal::FPE, sys_signal::Stop, sys_signal::Quit,
|
||||
sys_signal::Illegal, sys_signal::Abort, sys_signal::Bus,
|
||||
sys_signal::SegFault, sys_signal::FileSize, sys_signal::CPUtime })
|
||||
signal_settings::enable(itr);
|
||||
|
||||
static bool _protect = false;
|
||||
auto _exit_action = [](int nsig) {
|
||||
if(_protect) return;
|
||||
_protect = true;
|
||||
TIMEMORY_PRINTF_FATAL(
|
||||
stderr, "omnitrace exited with signal %i :: %s\n", nsig,
|
||||
signal_settings::str(static_cast<sys_signal>(nsig)).c_str());
|
||||
|
||||
// print the last log entries
|
||||
print_log_entries(std::cerr, num_log_entries);
|
||||
|
||||
// print any forced entries
|
||||
print_log_entries(
|
||||
std::cerr, -1, [](const auto& _v) { return _v.forced(); },
|
||||
[]() {
|
||||
tim::log::stream(std::cerr, tim::log::color::info())
|
||||
<< "\n[omnitrace][exe] Potentially important log entries:\n\n";
|
||||
});
|
||||
|
||||
TIMEMORY_PRINTF_FATAL(stderr, "\n");
|
||||
TIMEMORY_PRINTF_FATAL(
|
||||
stderr,
|
||||
"These were the last %i log entries from omnitrace. You can control the "
|
||||
"number of log entries via the '--log <N>' option or OMNITRACE_LOG_COUNT "
|
||||
"env variable.\n",
|
||||
num_log_entries);
|
||||
|
||||
if(log_ofs) log_ofs->close();
|
||||
log_ofs.reset();
|
||||
|
||||
kill(process::get_id(), nsig);
|
||||
_protect = false;
|
||||
};
|
||||
|
||||
signal_settings::set_exit_action(_exit_action);
|
||||
signal_settings::check_environment();
|
||||
tim::signals::enable_signal_detection(signal_settings::get_enabled());
|
||||
}
|
||||
|
||||
argv0 = argv[0];
|
||||
|
||||
OMNITRACE_ADD_LOG_ENTRY(argv[0]);
|
||||
@@ -263,7 +270,7 @@ main(int argc, char** argv)
|
||||
std::vector<string_t> libname = {};
|
||||
std::vector<string_t> sharedlibname = {};
|
||||
std::vector<string_t> staticlibname = {};
|
||||
tim::process::id_t _pid = -1;
|
||||
process::id_t _pid = -1;
|
||||
|
||||
fixed_module_functions = {
|
||||
{ &available_module_functions, false },
|
||||
@@ -881,8 +888,7 @@ main(int argc, char** argv)
|
||||
auto _settings = tim::settings::push<omnitrace_env_config_s>();
|
||||
for(auto&& iitr : *_settings)
|
||||
{
|
||||
iitr.second->set_config_updated(false);
|
||||
iitr.second->set_environ_updated(false);
|
||||
if(iitr.second->get_updated()) iitr.second->set_user_updated();
|
||||
}
|
||||
_settings->read(itr);
|
||||
for(auto&& iitr : *_settings)
|
||||
@@ -2554,9 +2560,12 @@ find_dyn_api_rt()
|
||||
(_file_exists(tim::get_env<string_t>("DYNINSTAPI_RT_LIB", ""))) ? 0 : 1;
|
||||
tim::set_env<string_t>("DYNINSTAPI_RT_LIB", _fname, _overwrite);
|
||||
_fname = tim::get_env<string_t>("DYNINSTAPI_RT_LIB", _fname);
|
||||
tim::set_env<string_t>("DYNINST_REWRITER_PATHS",
|
||||
TIMEMORY_JOIN(':', dirname(_fname), _rewriter_paths),
|
||||
1);
|
||||
tim::set_env<string_t>(
|
||||
"DYNINST_REWRITER_PATHS",
|
||||
_rewriter_paths.empty()
|
||||
? dirname(_fname)
|
||||
: TIMEMORY_JOIN(':', dirname(_fname), _rewriter_paths),
|
||||
1);
|
||||
};
|
||||
|
||||
auto _resolved = [&](std::string _fname) {
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
//======================================================================================//
|
||||
|
||||
@@ -229,9 +230,11 @@ omnitrace_get_address_space(patch_pointer_t& _bpatch, int _cmdc, char** _cmdv,
|
||||
auto _cmd_msg = ss.str();
|
||||
if(_cmd_msg.length() > 1) _cmd_msg = _cmd_msg.substr(1);
|
||||
|
||||
char** _environ = environ;
|
||||
verbprintf(1, "Creating process '%s'... ", _cmd_msg.c_str());
|
||||
fflush(stderr);
|
||||
mutatee = _bpatch->processCreate(_cmdv[0], (const char**) _cmdv, nullptr);
|
||||
mutatee = _bpatch->processCreate(_cmdv[0], (const char**) _cmdv,
|
||||
(const char**) _environ);
|
||||
if(!mutatee)
|
||||
{
|
||||
verbprintf(-1, "Failed to create process: '%s'\n", _cmd_msg.c_str());
|
||||
|
||||
@@ -80,9 +80,9 @@ backtrace::get() const
|
||||
if(size() == 0) return _v;
|
||||
|
||||
{
|
||||
static auto _cache = cache_type{};
|
||||
static auto _cache = cache_type{ get_sampling_include_inlines() };
|
||||
auto_lock_t _lk{ type_mutex<backtrace>() };
|
||||
_v = m_data.get(&_cache, true);
|
||||
_v = m_data.get(&_cache, false);
|
||||
}
|
||||
|
||||
// put the bottom of the call-stack on top
|
||||
@@ -144,6 +144,7 @@ backtrace::filter_and_patch(const std::vector<entry_type>& _data)
|
||||
};
|
||||
|
||||
auto _ret = std::vector<entry_type>{};
|
||||
_ret.reserve(_data.size());
|
||||
for(const auto& itr : _data)
|
||||
{
|
||||
auto _name = tim::demangle(_patch_label(itr.name));
|
||||
@@ -183,7 +184,7 @@ backtrace::sample(int)
|
||||
{
|
||||
using namespace tim::backtrace;
|
||||
constexpr bool with_signal_frame = false;
|
||||
constexpr size_t ignore_depth = 3;
|
||||
constexpr size_t ignore_depth = 4;
|
||||
// ignore depth based on:
|
||||
// 1. this frame
|
||||
// 2. tim::sampling::sampler<...>::sample(...) [always inline]
|
||||
|
||||
@@ -321,7 +321,6 @@ extern "C"
|
||||
|
||||
void kokkosp_push_profile_region(const char* name)
|
||||
{
|
||||
if(omnitrace::get_use_perfetto()) return; // perfetto doesn't support regions
|
||||
OMNITRACE_SCOPED_THREAD_STATE(ThreadState::Internal);
|
||||
kokkosp::logger_t{}.mark(1, __FUNCTION__, name);
|
||||
kokkosp::get_profiler_stack<kokkosp_region>().push_back(
|
||||
@@ -331,7 +330,6 @@ extern "C"
|
||||
|
||||
void kokkosp_pop_profile_region()
|
||||
{
|
||||
if(omnitrace::get_use_perfetto()) return; // perfetto doesn't support regions
|
||||
OMNITRACE_SCOPED_THREAD_STATE(ThreadState::Internal);
|
||||
kokkosp::logger_t{}.mark(-1, __FUNCTION__);
|
||||
if(kokkosp::get_profiler_stack<kokkosp_region>().empty()) return;
|
||||
@@ -343,7 +341,6 @@ extern "C"
|
||||
|
||||
void kokkosp_create_profile_section(const char* name, uint32_t* secid)
|
||||
{
|
||||
if(omnitrace::get_use_perfetto()) return; // perfetto doesn't support regions
|
||||
OMNITRACE_SCOPED_THREAD_STATE(ThreadState::Internal);
|
||||
*secid = kokkosp::get_unique_id();
|
||||
auto pname = TIMEMORY_JOIN(" ", "[kokkos]", name);
|
||||
@@ -352,7 +349,6 @@ extern "C"
|
||||
|
||||
void kokkosp_destroy_profile_section(uint32_t secid)
|
||||
{
|
||||
if(omnitrace::get_use_perfetto()) return; // perfetto doesn't support regions
|
||||
OMNITRACE_SCOPED_THREAD_STATE(ThreadState::Internal);
|
||||
kokkosp::destroy_profiler<kokkosp_region>(secid);
|
||||
}
|
||||
@@ -361,7 +357,6 @@ extern "C"
|
||||
|
||||
void kokkosp_start_profile_section(uint32_t secid)
|
||||
{
|
||||
if(omnitrace::get_use_perfetto()) return; // perfetto doesn't support regions
|
||||
OMNITRACE_SCOPED_THREAD_STATE(ThreadState::Internal);
|
||||
kokkosp::logger_t{}.mark(1, __FUNCTION__, secid);
|
||||
kokkosp::start_profiler<kokkosp_region>(secid);
|
||||
@@ -369,7 +364,6 @@ extern "C"
|
||||
|
||||
void kokkosp_stop_profile_section(uint32_t secid)
|
||||
{
|
||||
if(omnitrace::get_use_perfetto()) return; // perfetto doesn't support regions
|
||||
OMNITRACE_SCOPED_THREAD_STATE(ThreadState::Internal);
|
||||
kokkosp::logger_t{}.mark(-1, __FUNCTION__, secid);
|
||||
kokkosp::start_profiler<kokkosp_region>(secid);
|
||||
|
||||
@@ -513,6 +513,7 @@ post_process_perfetto()
|
||||
for(const auto& itr : _inp)
|
||||
{
|
||||
if(_ts >= itr->entry && _ts <= itr->exit) _v.emplace_back(itr);
|
||||
if(_ts > itr->exit) break;
|
||||
}
|
||||
return _v;
|
||||
};
|
||||
@@ -551,11 +552,14 @@ post_process_perfetto()
|
||||
|
||||
for(auto& ditr : _device_range)
|
||||
{
|
||||
auto _dev_id = ditr.first;
|
||||
auto _values = std::vector<rocm_feature_value>{};
|
||||
auto _dev_id = ditr.first;
|
||||
auto _values = std::vector<rocm_feature_value>{};
|
||||
auto _ts_sorted_data = _device_data[_dev_id];
|
||||
std::sort(_ts_sorted_data.begin(), _ts_sorted_data.end(),
|
||||
[](auto* _l, auto* _r) { return _l->exit < _r->exit; });
|
||||
for(const auto& itr : ditr.second)
|
||||
{
|
||||
auto _v = _get_events(_device_data[_dev_id], itr);
|
||||
auto _v = _get_events(_ts_sorted_data, itr);
|
||||
uint64_t _ts = itr;
|
||||
for(auto* vitr : _v)
|
||||
{
|
||||
@@ -629,6 +633,13 @@ post_process_timemory()
|
||||
_device_data[itr.device_id].emplace_back(&itr);
|
||||
}
|
||||
|
||||
for(auto& itr : _device_data)
|
||||
{
|
||||
// sort according to when it exited
|
||||
std::sort(itr.second.begin(), itr.second.end(),
|
||||
[](auto* _lhs, auto* _rhs) { return _lhs->exit < _rhs->exit; });
|
||||
}
|
||||
|
||||
using storage_type = typename rocm_data_tracker::storage_type;
|
||||
using bundle_type = tim::lightweight_tuple<rocm_data_tracker>;
|
||||
|
||||
@@ -646,8 +657,8 @@ post_process_timemory()
|
||||
|
||||
struct local_event
|
||||
{
|
||||
rocm_event* parent = nullptr;
|
||||
std::vector<local_event> children = {};
|
||||
rocm_event* parent = nullptr;
|
||||
mutable std::vector<local_event> children = {};
|
||||
|
||||
TIMEMORY_DEFAULT_OBJECT(local_event)
|
||||
|
||||
@@ -657,17 +668,11 @@ post_process_timemory()
|
||||
|
||||
bool operator()(rocm_event* _v)
|
||||
{
|
||||
OMNITRACE_CI_THROW(!parent, "Error! '%s' has nullptr", __PRETTY_FUNCTION__);
|
||||
|
||||
if(!parent) return false;
|
||||
if(_v->device_id != parent->device_id) return false;
|
||||
if(_v->entry > parent->entry && _v->exit <= parent->exit)
|
||||
{
|
||||
for(auto& itr : children)
|
||||
{
|
||||
if(itr(_v)) return true;
|
||||
}
|
||||
children.emplace_back(_v);
|
||||
std::sort(children.begin(), children.end());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -675,22 +680,20 @@ post_process_timemory()
|
||||
|
||||
bool operator<(const local_event& _v) const
|
||||
{
|
||||
OMNITRACE_CI_THROW(!parent, "Error! '%s' has nullptr", __PRETTY_FUNCTION__);
|
||||
OMNITRACE_CI_THROW(!_v.parent, "Error! '%s' passed nullptr",
|
||||
__PRETTY_FUNCTION__);
|
||||
|
||||
if(!parent && _v.parent) return true;
|
||||
if(parent && !_v.parent) return false;
|
||||
return *parent < *_v.parent;
|
||||
}
|
||||
|
||||
void operator()(int64_t _index, scope::config _scope) const
|
||||
{
|
||||
OMNITRACE_CI_THROW(!parent, "Error! '%s' has nullptr", __PRETTY_FUNCTION__);
|
||||
|
||||
if(!parent) return;
|
||||
bundle_type _bundle{ parent->name, _scope };
|
||||
_bundle.push(parent->queue_id)
|
||||
.start()
|
||||
.store(parent->feature_values.at(_index));
|
||||
|
||||
std::sort(children.begin(), children.end());
|
||||
for(const auto& itr : children)
|
||||
itr(_index, _scope);
|
||||
|
||||
@@ -737,6 +740,8 @@ post_process_timemory()
|
||||
|
||||
for(auto& ditr : _device_data)
|
||||
{
|
||||
OMNITRACE_VERBOSE_F(1, "Post-processing %zu entries for device %u...\n",
|
||||
ditr.second.size(), ditr.first);
|
||||
auto _storage = std::vector<local_storage>{};
|
||||
for(auto& itr : ditr.second)
|
||||
{
|
||||
@@ -752,22 +757,38 @@ post_process_timemory()
|
||||
}
|
||||
|
||||
auto& _local = _local_data[ditr.first];
|
||||
_local.reserve(ditr.second.size());
|
||||
double _avg = 0.0;
|
||||
for(auto& itr : ditr.second)
|
||||
{
|
||||
for(auto& litr : _local)
|
||||
if(_local.empty() || itr->entry >= _local.back().parent->exit)
|
||||
{
|
||||
if(litr(itr))
|
||||
{
|
||||
goto _bypass_insert;
|
||||
}
|
||||
_local.emplace_back(itr);
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t _n = 0;
|
||||
bool _found = false;
|
||||
for(auto litr = _local.rbegin(); litr != _local.rend(); ++litr)
|
||||
{
|
||||
++_n;
|
||||
if((*litr)(itr))
|
||||
{
|
||||
_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!_found) _local.emplace_back(itr);
|
||||
_avg += _n;
|
||||
}
|
||||
_local.emplace_back(itr);
|
||||
_bypass_insert:;
|
||||
}
|
||||
|
||||
OMNITRACE_VERBOSE_F(3, "Average # of iterations before match: %.1f\n",
|
||||
_avg / ditr.second.size() * 100.0);
|
||||
|
||||
for(auto& sitr : _storage)
|
||||
{
|
||||
for(auto& itr : _local_data[ditr.first])
|
||||
for(auto& itr : _local)
|
||||
sitr(itr, _scope);
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ endif()
|
||||
# -------------------------------------------------------------------------------------- #
|
||||
|
||||
set(_VALID_GPU OFF)
|
||||
if(OMNITRACE_USE_HIP)
|
||||
if(OMNITRACE_USE_HIP AND (NOT DEFINED OMNITRACE_CI_GPU OR OMNITRACE_CI_GPU))
|
||||
set(_VALID_GPU ON)
|
||||
find_program(
|
||||
OMNITRACE_ROCM_SMI_EXE
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle