]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Modern times for #if ...
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 11 Sep 2012 16:25:17 +0000 (16:25 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 11 Sep 2012 16:25:17 +0000 (16:25 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26291 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/config.h.in
deal.II/include/deal.II/base/parallel.h
deal.II/include/deal.II/base/thread_local_storage.h
deal.II/include/deal.II/base/thread_management.h
deal.II/include/deal.II/base/work_stream.h
deal.II/include/deal.II/matrix_free/matrix_free.h
deal.II/include/deal.II/matrix_free/matrix_free.templates.h
deal.II/source/base/boost_threads.cc
deal.II/source/base/multithread_info.cc
deal.II/source/base/thread_management.cc

index 3780aa197f9053a349f7842ef6e069af29209998..ea46530a2d43158d5b5d0b21b0bfcc40ced476fd 100644 (file)
@@ -58,7 +58,7 @@
 
 
 /* Defined if deal.II is configured with an external Boost library */
-#cmakedefine DEAL_II_USE_EXTERNAL_BOOST 1
+#cmakedefine DEAL_II_USE_EXTERNAL_BOOST
 
 
 
@@ -67,8 +67,8 @@
  * Configured in configure_functionparser.cmake:
  */
 
-/* Defined to 1 if you have the `functionparser' library */
-#cmakedefine HAVE_FUNCTIONPARSER 1
+/* Defined if you have the `functionparser' library */
+#cmakedefine HAVE_FUNCTIONPARSER
 
 
 
@@ -79,7 +79,7 @@
 
 
 /* Defined if the compiler supports mpi */
-#cmakedefine DEAL_II_COMPILER_SUPPORTS_MPI 1
+#cmakedefine DEAL_II_COMPILER_SUPPORTS_MPI
 
 
 
@@ -89,8 +89,8 @@
  */
 
 
-/* Defined to 1 if you have the `NetCDF' library */
-#cmakedefine HAVE_LIBNETCDF 1
+/* Defined if you have the `NetCDF' library */
+#cmakedefine HAVE_LIBNETCDF
 
 
 
 /* Flag indicating whether the library shall be compiled for multithreaded
  * applications. If so, then it is set to one, otherwise to zero.
  */
-#cmakedefine DEAL_II_USE_MT 1
+#cmakedefine DEAL_II_USE_MT
 
 /* Defined if multi-threading is to be achieved by using the POSIX functions
  */
  * Barriers will then not work in the library, but the other threading
  * functionality is available.
  */
-#cmakedefine DEAL_II_USE_MT_POSIX_NO_BARRIERS 1
+#cmakedefine DEAL_II_USE_MT_POSIX_NO_BARRIERS
 
 /**
  * Depending on the use of threads, we will have to make some variables
  * volatile. We do this here in a very old-fashioned C-style, but still
  * convenient way.
  */
-#if DEAL_II_USE_MT != 0
+#if DEAL_II_USE_MT
 #  define DEAL_VOLATILE volatile
 #else
 #  define DEAL_VOLATILE
 
 
 /* Defined if deal.II was configure with zlib support */
-#cmakedefine HAVE_LIBZ 1
+#cmakedefine HAVE_LIBZ
 
 
 
  */
 
 
-/* Defined if the compiler's library in use provides a std::iterator class
-   (early gcc versions did not) */
-#cmakedefine HAVE_STD_ITERATOR_CLASS 1
-
-/* Defined if the compiler's library in use provides std::i/ostringstream
-   classes (early gcc versions did not) */
-#cmakedefine HAVE_STD_STRINGSTREAM 1
-
-/* Defined if the compiler's library in use provides std::numeric_limits
-   classes in the appropriate header file */
-#cmakedefine HAVE_STD_NUMERIC_LIMITS 1
-
 /* Defined if vector iterators are just plain pointers */
-#cmakedefine DEAL_II_VECTOR_ITERATOR_IS_POINTER 1
+#cmakedefine DEAL_II_VECTOR_ITERATOR_IS_POINTER
 
 /* Defined if the compiler provides an <ostream> header file */
-#cmakedefine HAVE_STD_OSTREAM_HEADER 1
+#cmakedefine HAVE_STD_OSTREAM_HEADER
 
 /* Defined if the compiler provides an <iosfwd> header file */
-#cmakedefine HAVE_STD_IOSFWD_HEADER 1
+#cmakedefine HAVE_STD_IOSFWD_HEADER
 
-/* Defined to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H 1
+/* Defined if you have the <stdint.h> header file. */
+#cmakedefine HAVE_STDINT_H
 
-/* Defined to 1 if you have the <stdlib.h> header file. */
-#cmakedefine HAVE_STDLIB_H 1
+/* Defined if you have the <stdlib.h> header file. */
+#cmakedefine HAVE_STDLIB_H
 
-/* Defined to 1 if you have the <strings.h> header file. */
-#cmakedefine HAVE_STRINGS_H 1
+/* Defined if you have the <strings.h> header file. */
+#cmakedefine HAVE_STRINGS_H
 
-/* Defined to 1 if you have the <string.h> header file. */
-#cmakedefine HAVE_STRING_H 1
+/* Defined if you have the <string.h> header file. */
+#cmakedefine HAVE_STRING_H
 
-/* Defined to 1 if you have the <sys/stat.h> header file. */
-#cmakedefine HAVE_SYS_STAT_H 1
+/* Defined if you have the <sys/stat.h> header file. */
+#cmakedefine HAVE_SYS_STAT_H
 
-/* Defined to 1 if you have the <sys/syscall.h> header file. */
-#cmakedefine HAVE_SYS_SYSCALL_H 1
+/* Defined if you have the <sys/syscall.h> header file. */
+#cmakedefine HAVE_SYS_SYSCALL_H
 
-/* Defined to 1 if you have the <sys/times.h> header file. */
-#cmakedefine HAVE_SYS_TIMES_H 1
+/* Defined if you have the <sys/times.h> header file. */
+#cmakedefine HAVE_SYS_TIMES_H
 
-/* Defined to 1 if you have the <sys/types.h> header file. */
-#cmakedefine HAVE_SYS_TYPES_H 1
+/* Defined if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TYPES_H
 
-/* Defined to 1 if you have the `strtrs_' function. */
-#cmakedefine HAVE_STRTRS_ 1
+/* Defined if you have the `strtrs_' function. */
+#cmakedefine HAVE_STRTRS_ /* TODO */
 
 
 
index 285322472fe6cdc77b624f29fd6533ca738b029e..d4f46a59aa1596ba5e3e9f1049477a000c243f2c 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <cstddef>
 
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
 #  include <tbb/parallel_for.h>
 #  include <tbb/parallel_reduce.h>
 #  include <tbb/partitioner.h>
@@ -176,7 +176,7 @@ namespace parallel
                   Predicate           &predicate,
                   const unsigned int   grainsize)
   {
-#if DEAL_II_USE_MT == 0
+#ifndef DEAL_II_USE_MT
                                      // make sure we don't get compiler
                                      // warnings about unused arguments
     (void) grainsize;
@@ -244,7 +244,7 @@ namespace parallel
                   Predicate            &predicate,
                   const unsigned int    grainsize)
   {
-#if DEAL_II_USE_MT == 0
+#ifndef DEAL_II_USE_MT
                                      // make sure we don't get compiler
                                      // warnings about unused arguments
     (void) grainsize;
@@ -314,7 +314,7 @@ namespace parallel
                   Predicate            &predicate,
                   const unsigned int    grainsize)
   {
-#if DEAL_II_USE_MT == 0
+#ifndef DEAL_II_USE_MT
                                      // make sure we don't get compiler
                                      // warnings about unused arguments
     (void) grainsize;
@@ -340,7 +340,7 @@ namespace parallel
 
   namespace internal
   {
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
                                      /**
                                       * Take a range argument and call the
                                       * given function with its begin and end.
@@ -461,7 +461,7 @@ namespace parallel
                            const Function                           &f,
                            const unsigned int                        grainsize)
   {
-#if DEAL_II_USE_MT == 0
+#ifndef DEAL_II_USE_MT
                                      // make sure we don't get compiler
                                      // warnings about unused arguments
     (void) grainsize;
@@ -546,7 +546,7 @@ namespace parallel
 
   namespace internal
   {
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
                                      /**
                                       * A class that conforms to the Body
                                       * requirements of the TBB
@@ -741,7 +741,7 @@ namespace parallel
                                         const typename identity<RangeType>::type &end,
                                         const unsigned int grainsize)
   {
-#if DEAL_II_USE_MT == 0
+#ifndef DEAL_II_USE_MT
                                      // make sure we don't get compiler
                                      // warnings about unused arguments
     (void) grainsize;
@@ -813,7 +813,7 @@ namespace internal
 namespace parallel
 {
 
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
 
   namespace internal
   {
index d655cbb0380a03cc428c3fb7ed52d23398193c53..210b90c80d61ea46c84369d838034ec311ecd237 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <deal.II/base/config.h>
 
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
 #  include <tbb/enumerable_thread_specific.h>
 #endif
 
@@ -121,7 +121,7 @@ namespace Threads
     ThreadLocalStorage<T> & operator = (const T &t);
 
   private:
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
     /**
      * The data element we store. If we support threads, then this
      * object will be of a type that provides a separate object
@@ -163,7 +163,7 @@ namespace Threads
   T &
   ThreadLocalStorage<T>::get ()
   {
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
     return data.local();
 #else
     return data;
index d2f83f0333aebf111fcba8dee47b9920584fbd08..e16b39078f52e2be1b3982427aeb074dbeab1516 100644 (file)
@@ -21,7 +21,7 @@
 #include <deal.II/base/std_cxx1x/shared_ptr.h>
 #include <deal.II/base/std_cxx1x/bind.h>
 
-#if (DEAL_II_USE_MT == 1)
+#if DEAL_II_USE_MT
 #  include <deal.II/base/std_cxx1x/thread.h>
 #  include <deal.II/base/std_cxx1x/mutex.h>
 #  include <deal.II/base/std_cxx1x/condition_variable.h>
@@ -33,7 +33,7 @@
 #include <utility>
 
 
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
 #  if defined(DEAL_II_USE_MT_POSIX)
 #    include <pthread.h>
 #  endif
@@ -273,7 +273,7 @@ namespace Threads
   };
 
 
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
 
                                    /**
                                     * Class implementing a
@@ -1229,7 +1229,7 @@ namespace Threads
 
   namespace internal
   {
-#if (DEAL_II_USE_MT == 1)
+#if DEAL_II_USE_MT
 
                                      /**
                                       * A class that represents threads. For
@@ -3735,7 +3735,7 @@ namespace Threads
 
   namespace internal
   {
-#if (DEAL_II_USE_MT == 1)
+#if DEAL_II_USE_MT
 
     template <typename> struct TaskDescriptor;
 
index dd6fd8a93cb84cabaa2c27c6a90be582df888c2e..f70eb9afd4156244893dad5c96d303f5a81f7e55 100644 (file)
@@ -19,7 +19,7 @@
 #include <deal.II/base/std_cxx1x/function.h>
 #include <deal.II/base/std_cxx1x/bind.h>
 
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
 #  include <deal.II/base/thread_management.h>
 #  include <tbb/pipeline.h>
 #endif
@@ -125,7 +125,7 @@ DEAL_II_NAMESPACE_OPEN
 namespace WorkStream
 {
 
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
 
 
   namespace internal
@@ -527,7 +527,7 @@ namespace WorkStream
     if (!(begin != end))
       return;
 
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
                                      // create the three stages of the
                                      // pipeline
     internal::IteratorRangeToItemStream<Iterator,ScratchData,CopyData>
index 266a77f58e4ce26518a1afc041849409e0f36883..b9e75d51179aee00734be63c824fb00a490d7da3 100644 (file)
@@ -33,7 +33,7 @@
 #include <deal.II/matrix_free/dof_info.h>
 #include <deal.II/matrix_free/mapping_info.h>
 
-#if DEAL_II_USE_MT==1
+#if DEAL_II_USE_MT
 #include <tbb/task.h>
 #include <tbb/task_scheduler_init.h>
 #include <tbb/parallel_for.h>
@@ -2101,7 +2101,7 @@ namespace internal
   }
 
 
-#if DEAL_II_USE_MT==1
+#if DEAL_II_USE_MT
 
   // This defines the TBB data structures that
   // are needed to schedule the
@@ -2353,7 +2353,7 @@ namespace internal
     VectorStruct &dst;
   };
 
-#endif // #if DEAL_II_USE_MT==1
+#endif // #if DEAL_II_USE_MT
 
 } // end of namespace internal
 
@@ -2372,7 +2372,7 @@ MatrixFree<dim, Number>::cell_loop
  OutVector       &dst,
  const InVector  &src) const
 {
-#if DEAL_II_USE_MT==1
+#if DEAL_II_USE_MT
 
                                 // Use multithreading if so requested and if
                                 // there is enough work to do in parallel (the
index 1fc7d26320a73c3c42dab253205180f8636bc82e..77a4f0759297e0383e568f531fa2897c7b9c23a5 100644 (file)
@@ -139,7 +139,7 @@ internal_reinit(const Mapping<dim>                         &mapping,
                                 // initialize the basic multithreading
                                 // information that needs to be passed to the
                                 // DoFInfo structure
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
       if (additional_data.tasks_parallel_scheme != AdditionalData::none)
         {
           task_info.use_multithreading = true;
@@ -242,7 +242,7 @@ internal_reinit(const Mapping<dim>                            &mapping,
                                 // initialize the basic multithreading
                                 // information that needs to be passed to the
                                 // DoFInfo structure
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
       if (additional_data.tasks_parallel_scheme != AdditionalData::none)
         {
           task_info.use_multithreading = true;
index e07f70ee1fdb5401f05eadede67faac63cf6fc1c..7c14d74918a92a3d71b08a7158789c2fcd617857 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <deal.II/base/config.h>
 
-#if (DEAL_II_USE_MT == 1) && !defined(DEAL_II_CAN_USE_CXX1X) && !defined(DEAL_II_USE_EXTERNAL_BOOST)
+#if DEAL_II_USE_MT && !defined(DEAL_II_CAN_USE_CXX1X) && !defined(DEAL_II_USE_EXTERNAL_BOOST)
 
 // if the C++ compiler doesn't completely support the C++1x standard (and
 // consequently we can't use std::thread, std::mutex, etc), then include all
index e60f66f28d91dce2af38c9ea59835b585da25559..421f4a447456ea5a19bb9e899980a4f1d51fded7 100644 (file)
@@ -36,7 +36,7 @@
 DEAL_II_NAMESPACE_OPEN
 
 
-#if DEAL_II_USE_MT == 1
+#if DEAL_II_USE_MT
 
 /* Detecting how many processors a given machine has is something that
    varies greatly between operating systems. For a few operating
index 7549689b4827ca483a588ca15f91083ebfd2dcfc..2400d2765d267940bb429a004b8407e8e3e263d8 100644 (file)
@@ -164,7 +164,7 @@ namespace Threads
 
 
 
-#if DEAL_II_USE_MT != 1
+#ifndef DEAL_II_USE_MT
   DummyBarrier::DummyBarrier (const unsigned int  count,
                               const char         *,
                               void               *)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.