Commit 0f09eb2d authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Centralize jemalloc logic

parent 63fc0d63
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -65,6 +65,18 @@ rewrite_pyopencl_test()
}


set_up_jemalloc()
{
  CONDA_JEMALLOC="$CONDA_PREFIX/lib/libjemalloc.so.2"
  if test "$CONDA_PREFIX" != "" && test -f "$CONDA_JEMALLOC"; then
    # echo "*** running with $CONDA_JEMALLOC in LD_PRELOAD"
    # CI_SUPPORT_LD_PRELOAD="$CONDA_JEMALLOC"
    echo "*** $CONDA_JEMALLOC installed, skipping because of crashes observed in January 2025"
  fi
  CI_SUPPORT_LD_PRELOAD="$LD_PRELOAD"
}


# {{{ utilities

function tomlsh {
@@ -484,13 +496,7 @@ test_py_project()
    DOCTEST_MODULES_FLAG=""
  fi

  CONDA_JEMALLOC="$CONDA_PREFIX/lib/libjemalloc.so.2"
  if test "$CONDA_PREFIX" != "" && test -f "$CONDA_JEMALLOC"; then
    # echo "*** running with $CONDA_JEMALLOC in LD_PRELOAD"
    # CI_SUPPORT_LD_PRELOAD="$CONDA_JEMALLOC"
    echo "*** $CONDA_JEMALLOC installed, skipping because of crashes observed in January 2025"
  fi
  CI_SUPPORT_LD_PRELOAD="$LD_PRELOAD"
  set_up_jemalloc

  # Core dumps? Sure, take them.
  ulimit -c unlimited || true
@@ -584,13 +590,7 @@ run_examples()
      cwd=$(dirname "$i")
      example_script=$(basename "$i")

      CONDA_JEMALLOC="$CONDA_PREFIX/lib/libjemalloc.so.2"
      if test "$CONDA_PREFIX" != "" && test -f "$CONDA_JEMALLOC"; then
        # echo "*** running with $CONDA_JEMALLOC in LD_PRELOAD"
        # CI_SUPPORT_LD_PRELOAD="$CONDA_JEMALLOC"
        echo "*** $CONDA_JEMALLOC installed, skipping because of crashes observed in January 2025"
      fi
      CI_SUPPORT_LD_PRELOAD="$LD_PRELOAD"
      set_up_jemalloc

      if [[ $example_script == *mpi* ]]; then
        # FIXME: This command line is OpenMPI-specific.)