Skip to content
Snippets Groups Projects

online: Disable parallel sorting to prevent memleak from libTBB

Merged Felix Weiglhofer requested to merge fweig/cbmroot:memleak-fix into master

Files

+ 6
3
@@ -19,8 +19,7 @@
#include <algorithm>
#if defined(__cpp_lib_execution) && defined(HAVE_PARALLEL_ALGORITHM)
#define WITH_EXECUTION
#ifdef HAVE_PARALLEL_ALGORITHM
#include <execution>
#endif
@@ -36,7 +35,11 @@ namespace cbm::algo
template<typename It, typename Compare>
void Sort(It first, It last, Compare comp)
{
#ifdef WITH_EXECUTION
// Disable parallel sorting for the moment
// The underlying implementation in libTBB has a massive memory leak:
// https://community.intel.com/t5/Intel-oneAPI-Threading-Building/std-sort-std-execution-par-unseq-has-a-memory-leak-on-Linux/m-p/1580910
#if 0
// #ifdef HAVE_PARALLEL_ALGORITHM
std::sort(std::execution::par_unseq, first, last, comp);
#else
std::sort(first, last, comp);
Loading