Skip to content

Commit

Permalink
feat: Improved FPE monitoring (#2157)
Browse files Browse the repository at this point in the history
Overall the goal is to not fail a job when an FPE occurs, but to mask that FPE type in the signal handler, take a stack trace, resume execution. The sequencer can then demask the type again for the next algorithm. Overall I implemented the resuming based on discussion with @stephenswat and only for x86_64 for now. It keeps stack traces, accumulates them across algorithms / events / threads, deduplicates stack traces, and can print a summary at the end, looking something like this:

```
============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-7.0.1, pluggy-1.0.0
rootdir: /home/pagessin/dev/acts, configfile: pytest.ini, testpaths: Examples/Python/tests
plugins: pytest_check-1.0.4, rerunfailures-10.2, xdist-3.2.1
collected 227 items / 226 deselected / 1 selected

Examples/Python/tests/test_fpe.py 18:10:42    Sequencer      INFO      Create Sequencer with -1 threads
18:10:42    Sequencer      INFO      Add Algorithm 'FpeMaker'
18:10:42    Sequencer      INFO      Processing events [0, 30)
18:10:42    Sequencer      INFO      Starting event loop with -1 threads
18:10:42    Sequencer      INFO        0 context decorators
18:10:42    Sequencer      INFO        1 sequence elements
18:10:42    Sequencer      INFO        0 readers
18:10:42    Sequencer      INFO        1 algorithms
18:10:42    Sequencer      INFO        0 writers
SIGACTION
floating point divide by zero
18:10:42    Sequencer      INFO      finished event 0
SIGACTION
floating point overflow
18:10:42    Sequencer      INFO      finished event 1
SIGACTION
floating point invalid operation
18:10:42    Sequencer      INFO      finished event 2
SIGACTION
floating point divide by zero
SIGACTION
floating point divide by zero
SIGACTION
floating point overflow18:10:42    Sequencer      INFO      finished event 15

18:10:42    Sequencer      INFO      finished event 7
SIGACTION
floating point invalid operation
18:10:42    Sequencer      INFO      finished event 5
SIGACTION
floating point divide by zero
SIGACTION
floating point overflow
18:10:42    Sequencer      INFO      finished event 18
SIGACTION
floating point invalid operation
SIGACTION
floating point divide by zero
18:10:43    Sequencer      INFO      finished event 26
18:10:43    Sequencer      INFO      finished event 6
SIGACTION
floating point overflow
18:10:43    Sequencer      INFO      finished event 16
18:10:43    Sequencer      INFO      finished event 22
SIGACTION
floating point overflow
SIGACTION
floating point overflow18:10:43    Sequencer      INFO      finished event 28

SIGACTION
floating point invalid operation
18:10:43    Sequencer      INFO      finished event 19
18:10:43    Sequencer      INFO      finished event 23
SIGACTION
floating point invalid operation
18:10:43    Sequencer      INFO      finished event 8
SIGACTION
floating point divide by zero
18:10:43    Sequencer      INFO      finished event 27
SIGACTION
floating point invalid operation
18:10:43    Sequencer      INFO      finished event 17
SIGACTION
floating point invalid operation
SIGACTION
floating point invalid operation
18:10:43    Sequencer      INFO      finished event 20
SIGACTION
floating point divide by zero
SIGACTION
floating point divide by zero
SIGACTION
floating point divide by zero
18:10:43    Sequencer      INFO      finished event 9
18:10:43    Sequencer      INFO      finished event 24
SIGACTION
floating point overflow
SIGACTION
floating point invalid operation
SIGACTION
floating point overflow
SIGACTION
floating point overflow
SIGACTION
floating point overflow
18:10:43    Sequencer      INFO      finished event 25
SIGACTION
floating point invalid operation
18:10:43    Sequencer      INFO      finished event 3
SIGACTION
floating point divide by zero
18:10:43    Sequencer      INFO      finished event 13
18:10:43    Sequencer      INFO      finished event 29
18:10:43    Sequencer      INFO      finished event 21
18:10:44    Sequencer      INFO      finished event 10
18:10:44    Sequencer      INFO      finished event 14
18:10:44    Sequencer      INFO      finished event 4
18:10:44    Sequencer      INFO      finished event 12
18:10:44    Sequencer      INFO      finished event 11
FPE result summary:
- INTDIV: 0
- INTOVF: 0
- FLTDIV: 10
- FLTOVF: 10
- FLTUND: 0
- FLTRES: 0
- FLTINV: 10
- FLTSUB: 0

Stack traces:
- FLTDIV: (10 times)
 0# pybind11::cpp_function::initialize<pybind11_init_ActsPythonBindings(pybind11::module_&)::{lambda()#9}, void, , pybind11::name, pybind11::scope, pybind11::sibling>(pybind11_init_ActsPythonBindings(pybind11::module_&)::{lambda()#9}&&, void (*)(), pybind11::name const&, pybind11::scope const&, pybind11::sibling const&)::{lambda(pybind11::detail::function_call&)#3}::_FUN(pybind11::detail::function_call&) at /home/pagessin/dev/acts/build/_deps/pybind11-src/include/pybind11/pybind11.h:224
 1# pybind11::cpp_function::dispatcher(_object*, _object*, _object*) at /home/pagessin/dev/acts/build/_deps/pybind11-src/include/pybind11/pybind11.h:929
 2# PyCFunction_Call in /home/pagessin/dev/acts/bindvenv/bin/python3
 3# _PyObject_MakeTpCall in /home/pagessin/dev/acts/bindvenv/bin/python3
 4# _PyEval_EvalFrameDefault in /home/pagessin/dev/acts/bindvenv/bin/python3
 5# _PyFunction_Vectorcall in /home/pagessin/dev/acts/bindvenv/bin/python3
 6# 0x000000000050B23C in /home/pagessin/dev/acts/bindvenv/bin/python3
 7# PyObject_CallObject in /home/pagessin/dev/acts/bindvenv/bin/python3
 8# pybind11::object pybind11::detail::object_api<pybind11::handle>::operator()<(pybind11::return_value_policy)1, ActsExamples::AlgorithmContext const&>(ActsExamples::AlgorithmContext const&) const at /home/pagessin/dev/acts/build/_deps/pybind11-src/include/pybind11/cast.h:1631
 9# ActsExamples::IAlgorithm::internalExecute(ActsExamples::AlgorithmContext const&) at /home/pagessin/dev/acts/Examples/Framework/include/ActsExamples/Framework/IAlgorithm.hpp:51
10# ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const::{lambda(tbb::blocked_range<unsigned long> const&)#1}::operator()(tbb::blocked_range<unsigned long> const&) const at /home/pagessin/dev/acts/Examples/Framework/src/Framework/Sequencer.cpp:455
11# tbb::interface9::internal::start_for<tbb::blocked_range<unsigned long>, ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const::{lambda(tbb::blocked_range<unsigned long> const&)#1}, tbb::auto_partitioner const>::execute() at /usr/include/tbb/parallel_for.h:144
12# 0x00007F431EE37545 in /usr/lib/x86_64-linux-gnu/libtbb.so.2
13# 0x00007F431EE3780F in /usr/lib/x86_64-linux-gnu/libtbb.so.2
14# 0x00007F431EE34B68 in /usr/lib/x86_64-linux-gnu/libtbb.so.2
15# ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const at /home/pagessin/dev/acts/Examples/Framework/src/Framework/Sequencer.cpp:418
- FLTOVF: (10 times)
 0# pybind11::cpp_function::initialize<pybind11_init_ActsPythonBindings(pybind11::module_&)::{lambda()#10}, void, , pybind11::name, pybind11::scope, pybind11::sibling>(pybind11_init_ActsPythonBindings(pybind11::module_&)::{lambda()#10}&&, void (*)(), pybind11::name const&, pybind11::scope const&, pybind11::sibling const&)::{lambda(pybind11::detail::function_call&)#3}::_FUN(pybind11::detail::function_call&) at /home/pagessin/dev/acts/build/_deps/pybind11-src/include/pybind11/pybind11.h:224
 1# pybind11::cpp_function::dispatcher(_object*, _object*, _object*) at /home/pagessin/dev/acts/build/_deps/pybind11-src/include/pybind11/pybind11.h:929
 2# PyCFunction_Call in /home/pagessin/dev/acts/bindvenv/bin/python3
 3# _PyObject_MakeTpCall in /home/pagessin/dev/acts/bindvenv/bin/python3
 4# _PyEval_EvalFrameDefault in /home/pagessin/dev/acts/bindvenv/bin/python3
 5# _PyFunction_Vectorcall in /home/pagessin/dev/acts/bindvenv/bin/python3
 6# 0x000000000050B23C in /home/pagessin/dev/acts/bindvenv/bin/python3
 7# PyObject_CallObject in /home/pagessin/dev/acts/bindvenv/bin/python3
 8# pybind11::object pybind11::detail::object_api<pybind11::handle>::operator()<(pybind11::return_value_policy)1, ActsExamples::AlgorithmContext const&>(ActsExamples::AlgorithmContext const&) const at /home/pagessin/dev/acts/build/_deps/pybind11-src/include/pybind11/cast.h:1631
 9# ActsExamples::IAlgorithm::internalExecute(ActsExamples::AlgorithmContext const&) at /home/pagessin/dev/acts/Examples/Framework/include/ActsExamples/Framework/IAlgorithm.hpp:51
10# ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const::{lambda(tbb::blocked_range<unsigned long> const&)#1}::operator()(tbb::blocked_range<unsigned long> const&) const at /home/pagessin/dev/acts/Examples/Framework/src/Framework/Sequencer.cpp:455
11# tbb::interface9::internal::start_for<tbb::blocked_range<unsigned long>, ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const::{lambda(tbb::blocked_range<unsigned long> const&)#1}, tbb::auto_partitioner const>::execute() at /usr/include/tbb/parallel_for.h:144
12# 0x00007F431EE37545 in /usr/lib/x86_64-linux-gnu/libtbb.so.2
13# 0x00007F431EE3780F in /usr/lib/x86_64-linux-gnu/libtbb.so.2
14# 0x00007F431EE34B68 in /usr/lib/x86_64-linux-gnu/libtbb.so.2
15# ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const at /home/pagessin/dev/acts/Examples/Framework/src/Framework/Sequencer.cpp:418
- FLTINV: (10 times)
 0# pybind11::cpp_function::initialize<pybind11_init_ActsPythonBindings(pybind11::module_&)::{lambda()#11}, void, , pybind11::name, pybind11::scope, pybind11::sibling>(pybind11_init_ActsPythonBindings(pybind11::module_&)::{lambda()#11}&&, void (*)(), pybind11::name const&, pybind11::scope const&, pybind11::sibling const&)::{lambda(pybind11::detail::function_call&)#3}::_FUN(pybind11::detail::function_call&) at /home/pagessin/dev/acts/build/_deps/pybind11-src/include/pybind11/pybind11.h:224
 1# pybind11::cpp_function::dispatcher(_object*, _object*, _object*) at /home/pagessin/dev/acts/build/_deps/pybind11-src/include/pybind11/pybind11.h:929
 2# PyCFunction_Call in /home/pagessin/dev/acts/bindvenv/bin/python3
 3# _PyObject_MakeTpCall in /home/pagessin/dev/acts/bindvenv/bin/python3
 4# _PyEval_EvalFrameDefault in /home/pagessin/dev/acts/bindvenv/bin/python3
 5# _PyFunction_Vectorcall in /home/pagessin/dev/acts/bindvenv/bin/python3
 6# 0x000000000050B23C in /home/pagessin/dev/acts/bindvenv/bin/python3
 7# PyObject_CallObject in /home/pagessin/dev/acts/bindvenv/bin/python3
 8# pybind11::object pybind11::detail::object_api<pybind11::handle>::operator()<(pybind11::return_value_policy)1, ActsExamples::AlgorithmContext const&>(ActsExamples::AlgorithmContext const&) const at /home/pagessin/dev/acts/build/_deps/pybind11-src/include/pybind11/cast.h:1631
 9# ActsExamples::IAlgorithm::internalExecute(ActsExamples::AlgorithmContext const&) at /home/pagessin/dev/acts/Examples/Framework/include/ActsExamples/Framework/IAlgorithm.hpp:51
10# ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const::{lambda(tbb::blocked_range<unsigned long> const&)#1}::operator()(tbb::blocked_range<unsigned long> const&) const at /home/pagessin/dev/acts/Examples/Framework/src/Framework/Sequencer.cpp:455
11# tbb::interface9::internal::start_for<tbb::blocked_range<unsigned long>, ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const::{lambda(tbb::blocked_range<unsigned long> const&)#1}, tbb::auto_partitioner const>::execute() at /usr/include/tbb/parallel_for.h:144
12# 0x00007F431EE37545 in /usr/lib/x86_64-linux-gnu/libtbb.so.2
13# 0x00007F431EE3780F in /usr/lib/x86_64-linux-gnu/libtbb.so.2
14# 0x00007F431EE34B68 in /usr/lib/x86_64-linux-gnu/libtbb.so.2
15# ActsExamples::Sequencer::run()::{lambda()#1}::operator()() const at /home/pagessin/dev/acts/Examples/Framework/src/Framework/Sequencer.cpp:418
18:10:44    Sequencer      INFO      Processed 30 events in 1.961989 s (wall clock)
18:10:44    Sequencer      INFO      Average time per event: 327.442344 ms/event
.
----------------------------- Root file has checks -----------------------------
NOTE: Root file hash checks were skipped, enable with ROOT_HASH_CHECKS=on
See https://acts.readthedocs.io/en/latest/examples/python_bindings.html#root-file-hash-regression-checks for more details

====================== 1 passed, 226 deselected in 3.49s =======================
```

Currently, this doesn't fail the job, and the plan is to implement a masking mechanism based on the top level stack frame source file and line, as well as summation by algorithm / reader / writer, rather than just one global one.

Co-authored-by: Andreas Stefl <487211+andiwand@users.noreply.github.com>
  • Loading branch information
paulgessinger and andiwand committed Jun 19, 2023
1 parent dfc4940 commit 04bfbbc
Show file tree
Hide file tree
Showing 37 changed files with 1,826 additions and 389 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ jobs:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2204:v41
needs: [linux_ubuntu]
env:
ACTS_SEQUENCER_DISABLE_FPEMON: true

steps:
- name: Install git lfs
run: apt-get update && apt-get install -y git-lfs
Expand Down Expand Up @@ -269,6 +272,8 @@ jobs:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/ubuntu2204:v41
needs: [linux_ubuntu]
env:
ACTS_SEQUENCER_DISABLE_FPEMON: true

steps:
- name: Install git lfs
Expand Down
48 changes: 42 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variables:
CCACHE_DIR: ${CI_PROJECT_DIR}/ccache
CCACHE_MAXSIZE: 10G
CCACHE_MAXSIZE: 2G
CCACHE_KEY_SUFFIX: r1

clang_tidy:
Expand Down Expand Up @@ -100,7 +100,7 @@ build_exatrkx:
-DACTS_EXATRKX_ENABLE_ONNX=ON
-DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON
-DACTS_ENABLE_LOG_FAILURE_THRESHOLD=ON
- cmake --build build --
- cmake --build build -- -j3

test_exatrkx:
stage: test
Expand Down Expand Up @@ -137,6 +137,8 @@ build_linux_ubuntu:
paths:
- build/
exclude:
- build/bin/ActsUnitTest*
- build/bin/ActsIntegrationTest*
- build/**/*.o

script:
Expand All @@ -154,7 +156,7 @@ build_linux_ubuntu:
cmake -B build -S src
-GNinja
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_CXX_FLAGS=-Werror
-DCMAKE_CXX_STANDARD=17
-DACTS_ENABLE_LOG_FAILURE_THRESHOLD=ON
Expand All @@ -169,7 +171,7 @@ build_linux_ubuntu:
-DACTS_BUILD_PLUGIN_ACTSVG=ON
- ccache -z
- cmake --build build --
- cmake --build build -- -j3
- ccache -s

linux_test_examples:
Expand Down Expand Up @@ -200,6 +202,40 @@ linux_test_examples:
- pip3 install -r Examples/Python/tests/requirements.txt
- pytest -rFsv -k "not exatrkx" -v -n auto

linux_physmon:
stage: test
image: ghcr.io/acts-project/ubuntu2204:v41
needs: [build_linux_ubuntu]
tags:
- docker

artifacts:
when: always
paths:
- src/physmon

script:
- apt-get update && apt-get install -y git-lfs

- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- git submodule init
- git submodule update
- cd ..

- git config --global safe.directory "$GITHUB_WORKSPACE"
- pip3 install histcmp==0.5.2
- pip3 install -r src/Examples/Scripts/requirements.txt
- /usr/local/bin/geant4-config --install-datasets
- "source /usr/local/bin/thisroot.sh || true"
- "source /usr/local/bin/thisdd4hep_only.sh || true"
- "source /usr/local/bin/geant4.sh || true"
- source build/python/setup.sh
- export LD_LIBRARY_PATH=$PWD/build/thirdparty/OpenDataDetector/factory:$LD_LIBRARY_PATH
- cd src
- export PYTHONPATH="${PYTHONPATH}":"${PWD}/Examples/Scripts/Python"
- CI/physmon/phys_perf_mon.sh all physmon

###############################
### UBUNTU EXTRA JOB MATRIX ###
Expand Down Expand Up @@ -246,7 +282,7 @@ linux_test_examples:
-DACTS_BUILD_PLUGIN_ACTSVG=ON
- ccache -z
- cmake --build build --
- cmake --build build -- -j3
- ccache -s

- ctest --test-dir build -j$(nproc)
Expand Down Expand Up @@ -363,7 +399,7 @@ linux_ubuntu_2204_clang:
-DACTS_BUILD_PLUGIN_ACTSVG=ON
- ccache -z
- cmake --build build
- cmake --build build -- -j3
- ccache -s

- ctest --test-dir build -j$(nproc)
Expand Down
14 changes: 14 additions & 0 deletions CI/physmon/fpe_masks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"Fatras/include/ActsFatras/Physics/ElectroMagnetic/BetheHeitler.hpp:66":
FLTUND: 1
"Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp:178":
FLTUND: 1
"Core/include/Acts/TrackFitting/detail/GsfUtils.hpp:197":
FLTUND: 1
"Acts/Utilities/GaussianMixtureReduction.hpp:198":
FLTUND: 1
"Core/src/Utilities/AnnealingUtility.cpp:43":
FLTUND: 1
"Core/src/Utilities/AnnealingUtility.cpp:40":
FLTUND: 1
"Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp:119":
FLTUND: 1
22 changes: 13 additions & 9 deletions CI/physmon/workflows/physmon_ckf_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@
def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label):
with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=500, numThreads=-1, logLevel=acts.logging.INFO
events=500,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Path(__file__).parent.parent / "fpe_masks.yml"
),
)

tp = Path(temp)
Expand Down Expand Up @@ -180,11 +185,10 @@ def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label):
shutil.copy(perf_file, setup.outdir / f"{stem}_{label}.root")


with acts.FpeMonitor():
for truthSmearedSeeded, truthEstimatedSeeded, label in [
(True, False, "truth_smeared"), # if first is true, second is ignored
(False, True, "truth_estimated"),
(False, False, "seeded"),
(False, False, "orthogonal"),
]:
run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label)
for truthSmearedSeeded, truthEstimatedSeeded, label in [
(True, False, "truth_smeared"), # if first is true, second is ignored
(False, True, "truth_estimated"),
(False, False, "seeded"),
(False, False, "orthogonal"),
]:
run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label)
40 changes: 22 additions & 18 deletions CI/physmon/workflows/physmon_truth_tracking_gsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,28 @@

setup = makeSetup()

with acts.FpeMonitor():
with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=500, numThreads=-1, logLevel=acts.logging.INFO
)
with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=500,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Path(__file__).parent.parent / "fpe_masks.yml"
),
)

tp = Path(temp)
runTruthTrackingGsf(
setup.trackingGeometry,
setup.digiConfig,
setup.field,
outputDir=tp,
s=s,
)
tp = Path(temp)
runTruthTrackingGsf(
setup.trackingGeometry,
setup.digiConfig,
setup.field,
outputDir=tp,
s=s,
)

s.run()
del s
s.run()
del s

perf_file = tp / "performance_gsf.root"
assert perf_file.exists(), "Performance file not found"
shutil.copy(perf_file, setup.outdir / "performance_gsf.root")
perf_file = tp / "performance_gsf.root"
assert perf_file.exists(), "Performance file not found"
shutil.copy(perf_file, setup.outdir / "performance_gsf.root")
40 changes: 22 additions & 18 deletions CI/physmon/workflows/physmon_truth_tracking_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,28 @@

setup = makeSetup()

with acts.FpeMonitor():
with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=10000, numThreads=-1, logLevel=acts.logging.INFO
)
with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=10000,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Path(__file__).parent.parent / "fpe_masks.yml"
),
)

tp = Path(temp)
runTruthTrackingKalman(
setup.trackingGeometry,
setup.field,
digiConfigFile=setup.digiConfig,
outputDir=tp,
s=s,
)
tp = Path(temp)
runTruthTrackingKalman(
setup.trackingGeometry,
setup.field,
digiConfigFile=setup.digiConfig,
outputDir=tp,
s=s,
)

s.run()
del s
s.run()
del s

perf_file = tp / "performance_track_fitter.root"
assert perf_file.exists(), "Performance file not found"
shutil.copy(perf_file, setup.outdir / "performance_truth_tracking.root")
perf_file = tp / "performance_track_fitter.root"
assert perf_file.exists(), "Performance file not found"
shutil.copy(perf_file, setup.outdir / "performance_truth_tracking.root")
28 changes: 16 additions & 12 deletions CI/physmon/workflows/physmon_vertexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@
def run_vertexing(fitter, mu, events):
with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=events, numThreads=-1, logLevel=acts.logging.INFO
events=events,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Path(__file__).parent.parent / "fpe_masks.yml"
),
)

tp = Path(temp)
Expand Down Expand Up @@ -136,18 +141,17 @@ def run_vertexing(fitter, mu, events):
)


with acts.FpeMonitor():
for fitter in (VertexFinder.Iterative, VertexFinder.AMVF):
for mu in (1, 10, 25, 50, 75, 100, 125, 150, 175, 200):
start = datetime.datetime.now()
for fitter in (VertexFinder.Iterative, VertexFinder.AMVF):
for mu in (1, 10, 25, 50, 75, 100, 125, 150, 175, 200):
start = datetime.datetime.now()

events = 5
run_vertexing(fitter, mu, events)
events = 5
run_vertexing(fitter, mu, events)

delta = datetime.datetime.now() - start
delta = datetime.datetime.now() - start

duration = delta.total_seconds() / events
duration = delta.total_seconds() / events

(
setup.outdir / f"performance_vertexing_{fitter.name}_mu{mu}_time.txt"
).write_text(str(duration))
(
setup.outdir / f"performance_vertexing_{fitter.name}_mu{mu}_time.txt"
).write_text(str(duration))
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ option(ACTS_BUILD_PLUGIN_ACTSVG "Build SVG display plugin" OFF)
option(ACTS_BUILD_PLUGIN_CUDA "Build CUDA plugin" OFF)
option(ACTS_BUILD_PLUGIN_DD4HEP "Build DD4hep plugin" OFF)
option(ACTS_BUILD_PLUGIN_EDM4HEP "Build EDM4hep plugin" OFF)
option(ACTS_BUILD_PLUGIN_FPEMON "Build FPE monitoring plugin" OFF)
option(ACTS_BUILD_PLUGIN_GEANT4 "Build Geant4 plugin" OFF)
option(ACTS_BUILD_PLUGIN_EXATRKX "Build the Exa.TrkX plugin" OFF)
option(ACTS_EXATRKX_ENABLE_ONNX "Build the Onnx backend for the exatrkx plugin" OFF)
Expand Down Expand Up @@ -144,6 +145,8 @@ set_option_if(
set_option_if(ACTS_BUILD_PLUGIN_LEGACY ACTS_BUILD_EVERYTHING)
set_option_if(ACTS_BUILD_PLUGIN_AUTODIFF ACTS_BUILD_EVERYTHING)
set_option_if(ACTS_BUILD_PLUGIN_EXATRKX ACTS_BUILD_EXAMPLES_EXATRKX)
set_option_if(ACTS_BUILD_PLUGIN_FPEMON
ACTS_BUILD_EXAMPLES OR ACTS_BUILD_EVERYTHING)

# feature tests
include(CheckCXXSourceCompiles)
Expand Down
28 changes: 0 additions & 28 deletions Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,6 @@ target_link_libraries(
ActsCore
PUBLIC Boost::boost Eigen3::Eigen)

# Fpe flags
set(_fpe_options "")

find_library(dl_LIBRARY dl)
find_package(Backtrace)
find_program(addr2line_EXECUTABLE addr2line)
if(APPLE)
list(APPEND _fpe_options -D_GNU_SOURCE)
else()
if(dl_LIBRARY)
target_link_libraries(ActsCore PUBLIC ${dl_LIBRARY})
if(addr2line_EXECUTABLE)
list(APPEND _fpe_options -DBOOST_STACKTRACE_USE_ADDR2LINE)
list(APPEND _fpe_options -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=${addr2line_EXECUTABLE})
elseif(Backtrace_FOUND)
list(APPEND _fpe_options -DBOOST_STACKTRACE_USE_BACKTRACE)
target_link_libraries(ActsCore PUBLIC ${Backtrace_LIBRARY})
else()
list(APPEND _fpe_options -BOOST_STACKTRACE_USE_NOOP)
endif()
else()
list(APPEND _fpe_options -BOOST_STACKTRACE_USE_NOOP)
endif()
endif()

message(STATUS ${_fpe_options})

set_source_files_properties(src/Utilities/FpeMonitor.cpp PROPERTIES COMPILE_OPTIONS "${_fpe_options}")

if(ACTS_PARAMETER_DEFINITIONS_HEADER)
target_compile_definitions(
Expand Down
26 changes: 0 additions & 26 deletions Core/include/Acts/Utilities/FpeMonitor.hpp

This file was deleted.

1 change: 0 additions & 1 deletion Core/src/Utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ target_sources(
BinUtility.cpp
Logger.cpp
SpacePointUtility.cpp
FpeMonitor.cpp
)

0 comments on commit 04bfbbc

Please sign in to comment.