From: Bruno Turcksin Date: Wed, 14 Jan 2015 16:17:45 +0000 (-0600) Subject: dealii::multithread_info.n_cpus returns the correct number of CPU on FreeBSD. X-Git-Tag: v8.3.0-rc1~541^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F440%2Fhead;p=dealii.git dealii::multithread_info.n_cpus returns the correct number of CPU on FreeBSD. --- 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.