From 07880c799a57fce411157df76519c1ea1725bd9f Mon Sep 17 00:00:00 2001 From: Ralf Hartmann Date: Wed, 3 Mar 2004 07:17:27 +0000 Subject: [PATCH] Replace #warning directive by #error directive (commented out). Update documentation. git-svn-id: https://svn.dealii.org/trunk@8644 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/multithread_info.h | 7 +++++ deal.II/base/source/multithread_info.cc | 30 +++++++++++++------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/deal.II/base/include/base/multithread_info.h b/deal.II/base/include/base/multithread_info.h index f30e48285d..0890db0fbe 100644 --- a/deal.II/base/include/base/multithread_info.h +++ b/deal.II/base/include/base/multithread_info.h @@ -53,6 +53,13 @@ class MultithreadInfo * system. It is one if * detection is not implemented * or failed. + * + * If it is one, although you + * are on a multi-processor + * machine, please refer to the + * documentation in + * multithread_info.cc + * near to the #error directive. */ const unsigned int n_cpus; diff --git a/deal.II/base/source/multithread_info.cc b/deal.II/base/source/multithread_info.cc index 5fc7a3e49a..f01523cc7f 100644 --- a/deal.II/base/source/multithread_info.cc +++ b/deal.II/base/source/multithread_info.cc @@ -72,16 +72,26 @@ unsigned int MultithreadInfo::get_n_cpus() # else -// if you get to see this warning, then this can have two reasons: either -// because you fell through all of the above #if clauses and on your system -// the detection of processors is really not implemented, or you are using -// a compiler that does not understand the #warning directive, in which case -// you will see a report on the screen even if the detection of processors -// is implemented for your system. In the latter case, you need not worry -// about the warning (although it is acknowledged that it is annoying), -// otherwise you might want to consider implementing the missing feature -// and submitting it back to the authors of the library. -# warning Detection of Processors not supported on this OS +// If you get n_cpus=1 although you are on a multi-processor machine, +// then this may have two reasons: either because the system macros, +// e.g.__linux__, __sgi__, etc. weren't defined by the compiler or the +// detection of processors is really not implemented for your specific +// system. In the first case you can add e.g. -D__sgi__ to your +// compiling flags, in the latter case you need to implement the +// get_n_cpus() function for your system. +// +// In both cases, this #else case is compiled, a fact that you can +// easily verify by uncommenting the following #error directive, +// recompiling and getting a compilation error right at that line. +// After definition of the system macro or the implementation of the +// new detection this #error message during compilation shouldn't +// occur any more. +// +// Please send all new implementations of detection of processors to +// the deal.II mailing list, such that it can be included into the +// next deal.II release. + +//#error Detection of Processors not supported on this OS. Setting n_cpus=1 by default. unsigned int MultithreadInfo::get_n_cpus() { -- 2.39.5