From 97eb442e5a2a25f56444a3da13da3de1926ae0aa Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Wed, 14 Jan 2015 10:17:45 -0600 Subject: [PATCH] dealii::multithread_info.n_cpus returns the correct number of CPU on FreeBSD. --- doc/news/changes.h | 6 ++++++ source/base/multithread_info.cc | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/news/changes.h b/doc/news/changes.h index bceba1927b..e28e3b94bd 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -202,6 +202,12 @@ inconvenience this causes.

Specific improvements

    +
  1. New: dealii::multithread_info.n_cpus returns the correct number of CPU + on FreeBSD. +
    + (Bruno Turcksin, 2015/01/14) +
  2. +
  3. Improved: MPI collective operations such as MPI::sum, MPI::max now check for job_supports_mpi() internally, which allows running them also without a call to MPI_Init. diff --git a/source/base/multithread_info.cc b/source/base/multithread_info.cc index 0c162e16bc..0728ea5169 100644 --- a/source/base/multithread_info.cc +++ b/source/base/multithread_info.cc @@ -20,14 +20,11 @@ # include #endif -#if defined(__MACH__) && defined(__APPLE__) +#if (defined(__MACH__) && defined(__APPLE__)) || defined(__FreeBSD__) # include # include #endif -#if defined(__FreeBSD__) -# include -#endif #ifdef DEAL_II_WITH_THREADS # include @@ -53,7 +50,7 @@ unsigned int MultithreadInfo::get_n_cpus() return sysconf(_SC_NPROCESSORS_ONLN); } -# elif defined(__MACH__) && defined(__APPLE__) +# elif (defined(__MACH__) && defined(__APPLE__)) || defined(__FreeBSD__) // This is only tested on a dual G5 2.5GHz running MacOSX 10.3.6 // and on an Intel Mac Book Pro. // If it doesn't work please contact the mailinglist. -- 2.39.5