<commit_before># ------------------------------------------------------------------------------
# Choose the best thread option available, if any
# ------------------------------------------------------------------------------
AC_DEFUN([ACX_BEST_THREAD],
[
  AC_ARG_WITH(thread-model,
              AS_HELP_STRING([--with-thread-model=tbb,pthread,auto,none],[Specify the thread model to use]),
              [case "${withval}" in
                tbb)     requested_thread_model=tbb     ;;
                pthread) requested_thread_model=pthread ;;
                auto)    requested_thread_model=auto    ;;
                none)    requested_thread_model=none    ;;
                *)       AC_MSG_ERROR(bad value ${withval} for --with-thread-model) ;;
              esac],
              requested_thread_model=auto)

  AC_MSG_RESULT([User requested thread model: $requested_thread_model])

  # Set this variable when a threading model is found
  found_thread_model=none

  # Test different threading models, enabling only one.  For auto-detection, the
  # ordering of the tests is:
  # .) TBB
  # .) OpenMP
  # .) Pthread
  if (test "x$requested_thread_model" = "xtbb" -o "x$requested_thread_model" = "xauto"); then
    CONFIGURE_TBB

    if (test $enabletbb = yes); then
      libmesh_optional_INCLUDES="$TBB_INCLUDE $libmesh_optional_INCLUDES"
      libmesh_optional_LIBS="$TBB_LIBRARY $libmesh_optional_LIBS"
      found_thread_model=tbb
      break
    fi

  elif (test "x$requested_thread_model" = "xpthread" -o "x$requested_thread_model" = "xauto"); then
    AX_PTHREAD

    if (test x$ax_pthread_ok = xyes); then
      AC_DEFINE(USING_THREADS, 1,
                [Flag indicating whether the library shall be compiled to use any particular thread API.])
      AC_MSG_RESULT(<<< Configuring library with pthread support >>>)
      libmesh_optional_INCLUDES="$PTHREAD_CFLAGS $libmesh_optional_INCLUDES"
      libmesh_optional_LIBS="$PTHREAD_LIBS $libmesh_optional_LIBS"
      found_thread_model=pthread
      break
    else
      enablepthreads=no
    fi
  fi

  # OpenMP support -- enabled unless the user has requested no<commit_msg>Fix issue with 'break' in threads.m4<commit_after># ------------------------------------------------------------------------------
# Choose the best thread option available, if any
# ------------------------------------------------------------------------------
AC_DEFUN([ACX_BEST_THREAD],
[
  AC_ARG_WITH(thread-model,
              AS_HELP_STRING([--with-thread-model=tbb,pthread,auto,none],[Specify the thread model to use]),
              [case "${withval}" in
                tbb)     requested_thread_model=tbb     ;;
                pthread) requested_thread_model=pthread ;;
                auto)    requested_thread_model=auto    ;;
                none)    requested_thread_model=none    ;;
                *)       AC_MSG_ERROR(bad value ${withval} for --with-thread-model) ;;
              esac],
              requested_thread_model=auto)

  AC_MSG_RESULT([User requested thread model: $requested_thread_model])

  # Set this variable when a threading model is found
  found_thread_model=none

  # Test different threading models, enabling only one.  For auto-detection, the
  # ordering of the tests is:
  # .) TBB
  # .) OpenMP
  # .) Pthread
  if (test "x$requested_thread_model" = "xtbb" -o "x$requested_thread_model" = "xauto"); then
    CONFIGURE_TBB

    if (test $enabletbb = yes); then
      libmesh_optional_INCLUDES="$TBB_INCLUDE $libmesh_optional_INCLUDES"
      libmesh_optional_LIBS="$TBB_LIBRARY $libmesh_optional_LIBS"
      found_thread_model=tbb
    fi
  fi

  # If TBB wasn't selected, try pthreads as long as the user requested it (or auto)
  if (test "$found_thread_model" = none) ; then
    if (test "x$requested_thread_model" = "xpthread" -o "x$requested_thread_model" = "xauto"); then
      AX_PTHREAD

      if (test x$ax_pthread_ok = xyes); then
        AC_DEFINE(USING_THREADS, 1,
                  [Flag indicating whether the library shall be compiled to use any particular thread API.])
        AC_MSG_RESULT(<<< Configuring library with pthread support >>>)
        libmesh_optional_INCLUDES="$PTHREAD_CFLAGS $libmesh_optional_INCLUDES"
        libmesh_optional_LIBS="$PTHREAD_LIBS $libmesh_optional_LIBS"
        found_thread_model=pthread
      else
        enablepthreads=no
      fi
    fi
  fi

  # OpenMP support -- enabled unless the user has requested no
{'fraction_non_alphanumeric': 0.15313694625590285, 'fraction_numerical': 0.0006746120980436249, 'mean_word_length': 2.27540500736377, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3772864', 'n_tokens_mistral': 1345, 'n_tokens_neox': 1291, 'n_words': 312}