2
0

Handle fork in target application (#191)

* Always print PID in log messages

* omnitrace-dl updates

- omnitrace_preload does not call omnitrace_init or omnitrace_init_tooling
- omnitrace_preload will call omnitrace_set_mpi if OMNITRACE_USE_MPI
  or OMNITRACE_USE_MPIP in the env is true but not call it otherwise
  because doing so either overrides OMNITRACE_USE_PID (when true) or
  disable mpip from initialization (when false) and the MPI
  init can be caught later and override OMNITRACE_USE_PID

* config updates

- set_setting_value sets user update type
- remove volatile from get_settings_configured
- don't override settings::default_process_suffix
- don't kill process in omnitrace_exit_action
- set_state ignores updating state if >= State::Finalized

* Handle state > State::Finalized

* fork gotcha updates

- unsets LD_PRELOAD
- sets OMNITRACE_ROOT_PROCESS
- sets OMNITRACE_CHILD_PROCESS

* libomnitrace library.cpp updates

- basic_bundle for fini metrics
- handle finalization from child process

* sampling updates

- sampling::shutdown handles when child process

* Add example and test using fork

* Update run-ci script to support not submitting

* Tweak test envs

* Update build flags when codecov enabled

* remove unnecessary includes of sampling header

* Replace mpi copy/fini static lambda with free-funcs

* Update codecov job

* Fix OMPT segfaults after finalization

* Miscellaneous updates after rebase

* fixes for causal profiling

* revert some run-ci.sh changes

* Disable storing env in sampling::shutdown

* formatting fix

* Update timemory submodule

- fixed occasional synchronization issues with allocator offloading
- exclude protozero:: from internal samples

* improve root/child process detection

- avoid omnitrace_finalize in MPI when child process
- revert some testing tweaks
Este cometimento está contido em:
Jonathan R. Madsen
2023-02-08 01:31:38 -06:00
cometido por GitHub
ascendente 0da62c980e
cometimento 32b15fe7b7
39 ficheiros modificados com 440 adições e 133 eliminações
+28 -24
Ver ficheiro
@@ -19,7 +19,6 @@ omnitrace_add_option(OMNITRACE_BUILD_EXTRA_OPTIMIZATIONS "Extra optimization fla
omnitrace_add_option(OMNITRACE_BUILD_LTO "Build with link-time optimization" OFF)
omnitrace_add_option(OMNITRACE_USE_COMPILE_TIMING
"Build with timing metrics for compilation" OFF)
omnitrace_add_option(OMNITRACE_USE_COVERAGE "Build with code-coverage flags" OFF)
omnitrace_add_option(OMNITRACE_USE_SANITIZER
"Build with -fsanitze=\${OMNITRACE_SANITIZER_TYPE}" OFF)
omnitrace_add_option(OMNITRACE_BUILD_STATIC_LIBGCC
@@ -145,13 +144,15 @@ endif()
# non-debug optimizations
#
omnitrace_add_interface_library(omnitrace-compile-extra "Extra optimization flags")
if(NOT OMNITRACE_USE_COVERAGE AND OMNITRACE_BUILD_EXTRA_OPTIMIZATIONS)
if(NOT OMNITRACE_BUILD_CODECOV AND OMNITRACE_BUILD_EXTRA_OPTIMIZATIONS)
add_target_flag_if_avail(
omnitrace-compile-extra "-finline-functions" "-funroll-loops" "-ftree-vectorize"
"-ftree-loop-optimize" "-ftree-loop-vectorize")
endif()
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" AND OMNITRACE_BUILD_EXTRA_OPTIMIZATIONS)
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug"
AND OMNITRACE_BUILD_EXTRA_OPTIMIZATIONS
AND NOT OMNITRACE_BUILD_CODECOV)
target_link_libraries(omnitrace-compile-options
INTERFACE $<BUILD_INTERFACE:omnitrace-compile-extra>)
add_flag_if_avail(
@@ -166,29 +167,32 @@ endif()
#
add_cxx_flag_if_avail("-faligned-new")
omnitrace_save_variables(FLTO VARIABLES CMAKE_CXX_FLAGS)
set(_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-flto=thin ${_CXX_FLAGS}")
omnitrace_add_interface_library(omnitrace-lto "Adds link-time-optimization flags")
add_target_flag_if_avail(omnitrace-lto "-flto=thin")
if(NOT cxx_omnitrace_lto_flto_thin)
set(CMAKE_CXX_FLAGS "-flto ${_CXX_FLAGS}")
add_target_flag_if_avail(omnitrace-lto "-flto")
if(NOT cxx_omnitrace_lto_flto)
set(OMNITRACE_BUILD_LTO OFF)
else()
target_link_options(omnitrace-lto INTERFACE -flto)
endif()
add_target_flag_if_avail(omnitrace-lto "-fno-fat-lto-objects")
if(cxx_omnitrace_lto_fno_fat_lto_objects)
target_link_options(omnitrace-lto INTERFACE -fno-fat-lto-objects)
endif()
else()
target_link_options(omnitrace-lto INTERFACE -flto=thin)
endif()
omnitrace_restore_variables(FLTO VARIABLES CMAKE_CXX_FLAGS)
if(NOT OMNITRACE_BUILD_CODECOV)
omnitrace_save_variables(FLTO VARIABLES CMAKE_CXX_FLAGS)
set(_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-flto=thin ${_CXX_FLAGS}")
add_target_flag_if_avail(omnitrace-lto "-flto=thin")
if(NOT cxx_omnitrace_lto_flto_thin)
set(CMAKE_CXX_FLAGS "-flto ${_CXX_FLAGS}")
add_target_flag_if_avail(omnitrace-lto "-flto")
if(NOT cxx_omnitrace_lto_flto)
set(OMNITRACE_BUILD_LTO OFF)
else()
target_link_options(omnitrace-lto INTERFACE -flto)
endif()
add_target_flag_if_avail(omnitrace-lto "-fno-fat-lto-objects")
if(cxx_omnitrace_lto_fno_fat_lto_objects)
target_link_options(omnitrace-lto INTERFACE -fno-fat-lto-objects)
endif()
else()
target_link_options(omnitrace-lto INTERFACE -flto=thin)
endif()
omnitrace_restore_variables(FLTO VARIABLES CMAKE_CXX_FLAGS)
endif()
# ----------------------------------------------------------------------------------------#
# print compilation timing reports (Clang compiler)