The source project of this merge request has been removed.
SimpleCscClusterFitter - minor code tidy up
Hi,
in the latest large-scale MT tests the following FPE
15:09:56 FPEAuditor 6535 6 WARNING FPE INVALID in [Execute] of [CscThresholdClusterBuilder] on event 406405297 500 0x2b8c5376d864
15:09:57 FPEAuditor 6535 6 INFO FPE stacktrace 0 :
15:09:57 in function : std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*) (/cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0-cebb0/x86_64-centos7/include/c++/8.3.0/ostream:562)
15:09:57 included from : fpe_sig_action (/build/atnight/localbuilds/nightlies/Athena/master/athena/Control/AthenaAuditors/src/FPEAudit_linux.icc:94)
15:09:57 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-05-16T2101/Athena/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/lib/libAthenaAuditors.so
15:09:57 FPEAuditor 6535 6 INFO FPE stacktrace 1 :
15:09:57 in function : __restore_rt (sigaction.c:0)
15:09:57 in library : /lib64/libpthread.so.0
15:10:01 FPEAuditor 6535 6 INFO FPE stacktrace 2 :
15:10:01 in function : SimpleCscClusterFitter::fit(std::vector<ICscStripFitter::Result, std::allocator<ICscStripFitter::Result> > const&) const (/build/atnight/localbuilds/nightlies/Athena/master/athena/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/SimpleCscClusterFitter.cxx:143)
15:10:01 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-05-16T2101/Athena/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/lib/libCscClusterizationLib.so
15:10:03 FPEAuditor 6535 6 INFO FPE stacktrace 3 :
15:10:03 in function : std::enable_if<std::__and_<std::__not_<std::__is_tuple_like<ICscClusterFitter::Result*> >, std::is_move_constructible<ICscClusterFitter::Result*>, std::is_move_assignable<ICscClusterFitter::Result*> >::value, void>::type std::swap<ICscClusterFitter::Result*>(ICscClusterFitter::Result*&, ICscClusterFitter::Result*&) (/cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0-cebb0/x86_64-centos7/include/c++/8.3.0/bits/move.h:195)
15:10:03 included from : std::_Vector_base<ICscClusterFitter::Result, std::allocator<ICscClusterFitter::Result> >::_Vector_impl::_M_swap_data(std::_Vector_base<ICscClusterFitter::Result, std::allocator<ICscClusterFitter::Result> >::_Vector_impl&) (/cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0-cebb0/x86_64-centos7/include/c++/8.3.0/bits/stl_vector.h:112)
15:10:03 included from : std::vector<ICscClusterFitter::Result, std::allocator<ICscClusterFitter::Result> >::_M_move_assign(std::vector<ICscClusterFitter::Result, std::allocator<ICscClusterFitter::Result> >&&, std::integral_constant<bool, true>) (/cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0-cebb0/x86_64-centos7/include/c++/8.3.0/bits/stl_vector.h:1680)
15:10:03 included from : std::vector<ICscClusterFitter::Result, std::allocator<ICscClusterFitter::Result> >::operator=(std::vector<ICscClusterFitter::Result, std::allocator<ICscClusterFitter::Result> >&&) (/cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0-cebb0/x86_64-centos7/include/c++/8.3.0/bits/stl_vector.h:601)
15:10:03 included from : CscThresholdClusterBuilderTool::make_clusters(bool, std::vector<Muon::CscStripPrepData const*, std::allocator<Muon::CscStripPrepData const*> > const&, Muon::MuonPrepDataCollection<Muon::CscPrepData>*&) (/build/atnight/localbuilds/nightlies/Athena/master/athena/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.cxx:796)
15:10:03 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-05-16T2101/Athena/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/lib/libCscClusterizationLib.so
15:10:04 FPEAuditor 6535 6 INFO FPE stacktrace 4 :
15:10:04 in function : CscThresholdClusterBuilderTool::getClusters(std::vector<IdentifierHash, std::allocator<IdentifierHash> >&, Muon::MuonPrepDataContainer<Muon::MuonPrepDataCollection<Muon::CscPrepData> >*) (/build/atnight/localbuilds/nightlies/Athena/master/athena/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.cxx:325)
15:10:04 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-05-16T2101/Athena/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/lib/libCscClusterizationLib.so
15:10:06 FPEAuditor 6535 6 INFO FPE stacktrace 5 :
15:10:06 in function : StatusCode::isSuccess() const (/build/atnight/localbuilds/nightlies/Athena/master/build/install/AthenaExternals/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/include/GaudiKernel/StatusCode.h:393)
15:10:06 included from : StatusCode::isFailure() const (/build/atnight/localbuilds/nightlies/Athena/master/build/install/AthenaExternals/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/include/GaudiKernel/StatusCode.h:149)
15:10:06 included from : CscThresholdClusterBuilderTool::getClusters(std::vector<IdentifierHash, std::allocator<IdentifierHash> >&, std::vector<IdentifierHash, std::allocator<IdentifierHash> >&, Muon::MuonPrepDataContainer<Muon::MuonPrepDataCollection<Muon::CscPrepData> >*) (/build/atnight/localbuilds/nightlies/Athena/master/athena/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilderTool.cxx:153)
15:10:06 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-05-16T2101/Athena/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/lib/libCscClusterizationLib.so
15:10:07 FPEAuditor 6535 6 INFO FPE stacktrace 6 :
15:10:07 in function : StatusCode::isSuccess() const (/build/atnight/localbuilds/nightlies/Athena/master/build/install/AthenaExternals/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/include/GaudiKernel/StatusCode.h:393)
15:10:07 included from : StatusCode::isFailure() const (/build/atnight/localbuilds/nightlies/Athena/master/build/install/AthenaExternals/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/include/GaudiKernel/StatusCode.h:149)
15:10:07 included from : CscThresholdClusterBuilder::execute() (/build/atnight/localbuilds/nightlies/Athena/master/athena/MuonSpectrometer/MuonReconstruction/MuonDataPrep/CscClusterization/src/CscThresholdClusterBuilder.cxx:59)
15:10:07 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-05-16T2101/Athena/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/lib/libCscClusterizationLib.so
15:10:08 FPEAuditor 6535 6 INFO FPE stacktrace 7 :
15:10:08 in function : Gaudi::details::LegacyAlgorithmAdapter::execute(EventContext const&) const (/build/atnight/localbuilds/nightlies/Athena/master/build/build/AthenaExternals/src/Gaudi/GaudiKernel/include/GaudiKernel/Algorithm.h:49)
15:10:08 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-05-16T2101/AthenaExternals/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/lib/libGaudiPythonLib.so
15:10:10 FPEAuditor 6535 6 INFO FPE stacktrace 8 :
15:10:10 in function : StatusCode::operator=(StatusCode const&) (/build/atnight/localbuilds/nightlies/Athena/master/build/build/AthenaExternals/src/Gaudi/GaudiKernel/include/GaudiKernel/StatusCode.h:142)
15:10:10 included from : Gaudi::Algorithm::sysExecute(EventContext const&) (/build/atnight/localbuilds/nightlies/Athena/master/build/build/AthenaExternals/src/Gaudi/GaudiKernel/src/Lib/Algorithm.cpp:366)
15:10:10 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-05-16T2101/AthenaExternals/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/lib/libGaudiKernel.so
15:10:10 FPEAuditor 6535 6 INFO FPE stacktrace 9 :
15:10:10 in function : StatusCode::isSuccess() const (/build/atnight/localbuilds/nightlies/Athena/master/build/build/AthenaExternals/src/Gaudi/GaudiKernel/include/GaudiKernel/StatusCode.h:393)
15:10:10 included from : StatusCode::isFailure() const (/build/atnight/localbuilds/nightlies/Athena/master/build/build/AthenaExternals/src/Gaudi/GaudiKernel/include/GaudiKernel/StatusCode.h:149)
15:10:10 included from : AlgTask<tbb::task>::execute() (/build/atnight/localbuilds/nightlies/Athena/master/build/build/AthenaExternals/src/Gaudi/GaudiHive/src/AlgTask.h:86)
15:10:10 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-05-16T2101/AthenaExternals/22.0.35/InstallArea/x86_64-centos7-gcc8-opt/lib/libGaudiHive.so
15:10:11 FPEAuditor 6535 6 INFO FPE stacktrace 10 :
15:10:11 in function : tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) (/workspace/build/externals/tbb-2020_U2/src/tbb/2020_U2/build/linux_intel64_gcc_cc8.3.0_libc2.17_kernel3.10.0_release/../../src/tbb/custom_scheduler.h:474)
15:10:11 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/sw/lcg/releases/LCG_100_ATLAS_1/tbb/2020_U2/x86_64-centos7-gcc8-opt/lib/libtbb.so.2
15:10:11 FPEAuditor 6535 6 INFO FPE stacktrace 11 :
15:10:11 in function : tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) (/workspace/build/externals/tbb-2020_U2/src/tbb/2020_U2/build/linux_intel64_gcc_cc8.3.0_libc2.17_kernel3.10.0_release/../../src/tbb/custom_scheduler.h:636)
15:10:11 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/sw/lcg/releases/LCG_100_ATLAS_1/tbb/2020_U2/x86_64-centos7-gcc8-opt/lib/libtbb.so.2
15:10:11 FPEAuditor 6535 6 INFO FPE stacktrace 12 :
15:10:11 in function : tbb::internal::arena::process(tbb::internal::generic_scheduler&) (/workspace/build/externals/tbb-2020_U2/src/tbb/2020_U2/build/linux_intel64_gcc_cc8.3.0_libc2.17_kernel3.10.0_release/../../src/tbb/arena.cpp:196)
15:10:11 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/sw/lcg/releases/LCG_100_ATLAS_1/tbb/2020_U2/x86_64-centos7-gcc8-opt/lib/libtbb.so.2
15:10:11 FPEAuditor 6535 6 INFO FPE stacktrace 13 :
15:10:11 in function : tbb::internal::market::process(rml::job&) (/workspace/build/externals/tbb-2020_U2/src/tbb/2020_U2/build/linux_intel64_gcc_cc8.3.0_libc2.17_kernel3.10.0_release/../../src/tbb/market.cpp:668)
15:10:11 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/sw/lcg/releases/LCG_100_ATLAS_1/tbb/2020_U2/x86_64-centos7-gcc8-opt/lib/libtbb.so.2
15:10:11 FPEAuditor 6535 6 INFO FPE stacktrace 14 :
15:10:11 in function : int tbb::internal::__TBB_machine_atomic_load<int, 2>(int const volatile&) (/workspace/build/externals/tbb-2020_U2/src/tbb/2020_U2/build/linux_intel64_gcc_cc8.3.0_libc2.17_kernel3.10.0_release/../../include/tbb/machine/gcc_generic.h:160)
15:10:11 included from : tbb::internal::machine_load_store<int, 4ul>::load_with_acquire(int const volatile&) (/workspace/build/externals/tbb-2020_U2/src/tbb/2020_U2/build/linux_intel64_gcc_cc8.3.0_libc2.17_kernel3.10.0_release/../../include/tbb/machine/gcc_generic.h:175)
15:10:11 included from : int tbb::internal::__TBB_load_with_acquire<int>(int const volatile&) (/workspace/build/externals/tbb-2020_U2/src/tbb/2020_U2/build/linux_intel64_gcc_cc8.3.0_libc2.17_kernel3.10.0_release/../../include/tbb/tbb_machine.h:710)
15:10:11 included from : tbb::internal::atomic_impl<tbb::internal::rml::private_worker::state_t>::operator tbb::internal::rml::private_worker::state_t() const volatile (/workspace/build/externals/tbb-2020_U2/src/tbb/2020_U2/build/linux_intel64_gcc_cc8.3.0_libc2.17_kernel3.10.0_release/../../include/tbb/atomic.h:312)
15:10:11 included from : tbb::internal::rml::private_worker::run() (/workspace/build/externals/tbb-2020_U2/src/tbb/2020_U2/build/linux_intel64_gcc_cc8.3.0_libc2.17_kernel3.10.0_release/../../src/tbb/private_server.cpp:264)
15:10:11 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/sw/lcg/releases/LCG_100_ATLAS_1/tbb/2020_U2/x86_64-centos7-gcc8-opt/lib/libtbb.so.2
15:10:11 FPEAuditor 6535 6 INFO FPE stacktrace 15 :
15:10:11 in function : tbb::internal::rml::private_worker::thread_routine(void*) (/workspace/build/externals/tbb-2020_U2/src/tbb/2020_U2/build/linux_intel64_gcc_cc8.3.0_libc2.17_kernel3.10.0_release/../../src/tbb/private_server.cpp:221)
15:10:11 in library : /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/sw/lcg/releases/LCG_100_ATLAS_1/tbb/2020_U2/x86_64-centos7-gcc8-opt/lib/libtbb.so.2
15:10:11 FPEAuditor 6535 6 INFO FPE stacktrace 16 :
15:10:11 in function : start_thread (pthread_create.c:0)
15:10:11 in library : /lib64/libpthread.so.0
15:10:11 FPEAuditor 6535 6 INFO FPE stacktrace 17 :
15:10:11 in library : /lib64/libc.so.6
happened. This FPE is essentially the same as in ATLASRECTS-6204, but unfortunately not reliably reproducible. @sschramm suggested that the logic of this code might be overcomplicated and that also the overflow of the vector might be accessed returning just non-sense if the next memory register had stored non-sense before. So I tried to simplify the loop ensuring that the vector accesses are always sane while keeping the core part of its logic.