From df187d4d1a84c2a0bccee4b55024c7c56331f228 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 14 Nov 2002 21:12:40 +0000 Subject: [PATCH] Make DEAL_II_USE_MT a true variable with a value, not only something that can be tested for existence with the preprocessor. git-svn-id: https://svn.dealii.org/trunk@6763 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 11 +- deal.II/base/include/base/thread_management.h | 4 +- deal.II/base/source/multithread_info.cc | 2 +- deal.II/base/source/thread_management.cc | 4 +- deal.II/configure | 597 +++++++++++++----- deal.II/deal.II/source/numerics/data_out.cc | 11 +- .../deal.II/source/numerics/data_out_faces.cc | 40 +- .../source/numerics/data_out_rotation.cc | 42 +- .../source/numerics/error_estimator.cc | 11 +- .../deal.II/source/numerics/time_dependent.cc | 44 +- deal.II/doc/news/2002/c-3-4.html | 18 + .../lac/include/lac/sparse_matrix.templates.h | 38 +- .../lac/include/lac/sparse_vanka.templates.h | 174 ++--- .../include/lac/swappable_vector.templates.h | 56 +- 14 files changed, 656 insertions(+), 396 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 3a806dd84d..e0b45599cf 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -917,10 +917,15 @@ dnl Default (i.e. no arg) means POSIX DEAL_II_SET_ACE_FLAGS fi - AC_DEFINE(DEAL_II_USE_MT, 1, - [Flag indicating whether the library shall be compiled for - multithreaded applications]) + DEAL_II_USE_MT_VAL=1 + else + DEAL_II_USE_MT_VAL=0 fi + + AC_DEFINE_UNQUOTED(DEAL_II_USE_MT, $DEAL_II_USE_MT_VAL, + [Flag indicating whether the library shall be + compiled for multithreaded applications. If so, + then it is set to one, otherwise to zero.]) ]) diff --git a/deal.II/base/include/base/thread_management.h b/deal.II/base/include/base/thread_management.h index 55c18e55be..022bcc35c9 100644 --- a/deal.II/base/include/base/thread_management.h +++ b/deal.II/base/include/base/thread_management.h @@ -21,7 +21,7 @@ #include #include -#ifdef DEAL_II_USE_MT +#if DEAL_II_USE_MT == 1 # if defined(DEAL_II_USE_MT_ACE) # include # include @@ -182,7 +182,7 @@ namespace Threads }; -#ifdef DEAL_II_USE_MT +#if DEAL_II_USE_MT == 1 # if defined(DEAL_II_USE_MT_ACE) /** * In multithread mode with ACE diff --git a/deal.II/base/source/multithread_info.cc b/deal.II/base/source/multithread_info.cc index 45f7f93a4c..bfbd6162c2 100644 --- a/deal.II/base/source/multithread_info.cc +++ b/deal.II/base/source/multithread_info.cc @@ -30,7 +30,7 @@ -#ifdef DEAL_II_USE_MT +#if DEAL_II_USE_MT == 1 #if defined(__linux__) diff --git a/deal.II/base/source/thread_management.cc b/deal.II/base/source/thread_management.cc index 2a75222f8f..13d632f0d6 100644 --- a/deal.II/base/source/thread_management.cc +++ b/deal.II/base/source/thread_management.cc @@ -107,7 +107,7 @@ namespace Threads }; -#ifndef DEAL_II_USE_MT +#if DEAL_II_USE_MT != 1 void DummyThreadManager::spawn (const FunPtr fun_ptr, void * fun_data, int /*flags*/) const @@ -393,7 +393,7 @@ namespace Threads // once it has copied all data fun_data.fun_data_base->lock.acquire (); // now start the new thread -#ifdef DEAL_II_USE_MT +#if DEAL_II_USE_MT == 1 # if defined(DEAL_II_USE_MT_ACE) thread_manager.spawn (*fun_data.fun_data_base->thread_entry_point, (void*)&fun_data, diff --git a/deal.II/configure b/deal.II/configure index 457aad15fe..4b3fa90f24 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,12 +1,20 @@ #! /bin/sh # From configure.in Revision: 1.127 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.54. +# Generated by GNU Autoconf 2.53a. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + + + ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -15,13 +23,11 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +# NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset @@ -29,38 +35,39 @@ else as_unset=false fi +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi +# Name of the executable. if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi - -# Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -72,7 +79,6 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -86,7 +92,7 @@ if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh - if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: @@ -235,7 +241,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } # Name of the host. @@ -249,7 +255,6 @@ exec 6>&1 # Initializations. # ac_default_prefix=/usr/local -ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= @@ -270,8 +275,6 @@ PACKAGE_BUGREPORT= ac_unique_file="deal.II" ac_subdirs_all="$ac_subdirs_all contrib tests" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DEAL_II_MAJOR DEAL_II_MINOR DEAL_II_PATH DEAL2_DIR build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GXX_VERSION CXXFLAGSG CXXFLAGSO CXXFLAGSPIC SHLIBLD LDFLAGSPIC enablemultithreading withmultithreading F77 F77_VERSION F77FLAGSO F77FLAGSG F77FLAGSPIC F77LIBS enableshared lib_suffix enablemultigrid TECPLOT_LIBRARY_PATH TECPLOT_INCLUDE_PATH USE_CONTRIB_HSL kdocdir kdocversion docxx PERL subdirs LIBOBJS LTLIBOBJS' -ac_subst_files='' # Initialize some variables set by options. ac_init_help= @@ -695,9 +698,6 @@ if test ! -r $srcdir/$ac_unique_file; then { (exit 1); exit 1; }; } fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias @@ -875,7 +875,7 @@ esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` @@ -915,7 +915,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.54. Invocation command line was +generated by GNU Autoconf 2.53a. Invocation command line was $ $0 $@ @@ -981,9 +981,12 @@ do *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + esac # Get rid of the leading space. - ac_sep=" " done # When interrupted or exit'd, cleanup temporary files, and complete @@ -995,7 +998,6 @@ trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo - cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## @@ -1018,35 +1020,6 @@ _ASBOX esac; } echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## @@ -1054,7 +1027,7 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + sed "/^$/d" confdefs.h echo fi test "$ac_signal" != 0 && @@ -1198,7 +1171,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_config_headers="$ac_config_headers base/include/base/config.h" @@ -1568,7 +1540,9 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + set dummy "$as_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" fi fi fi @@ -1701,6 +1675,12 @@ cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -1729,8 +1709,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.*; do - test -f "$ac_file" || continue +for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; a.out ) # We found the default executable, but exeext='' is most @@ -1746,10 +1727,8 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -check \`config.log' for details." >&5 -echo "$as_me: error: C compiler cannot create executables -check \`config.log' for details." >&2;} +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi @@ -1806,8 +1785,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` @@ -1838,6 +1816,12 @@ else #line $LINENO "configure" #include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -1882,6 +1866,12 @@ else #line $LINENO "configure" #include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -1930,6 +1920,12 @@ else #line $LINENO "configure" #include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2013,6 +2009,12 @@ struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2101,6 +2103,12 @@ do #include "confdefs.h" #include $ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2132,6 +2140,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext #line $LINENO "configure" #include "confdefs.h" $ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2340,6 +2354,12 @@ else #line $LINENO "configure" #include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2388,6 +2408,12 @@ else #line $LINENO "configure" #include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2447,6 +2473,12 @@ do #include "confdefs.h" #include $ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2478,6 +2510,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext #line $LINENO "configure" #include "confdefs.h" $ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2763,6 +2801,12 @@ echo $ECHO_N "checking for std::advance warning... $ECHO_C" >&6 #include #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2925,6 +2969,12 @@ echo $ECHO_N "checking whether -ggdb works for long symbols... $ECHO_C" >&6 return (i1==i2); } +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -2972,6 +3022,12 @@ echo $ECHO_N "checking whether -ggdb works... $ECHO_C" >&6 #line $LINENO "configure" #include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3107,6 +3163,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu nonsense # endif +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3216,6 +3278,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3269,6 +3337,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3324,6 +3398,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3415,6 +3495,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # include # include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3464,12 +3550,16 @@ echo "${ECHO_T}-pedantic" >&6 fi + DEAL_II_USE_MT_VAL=1 + else + DEAL_II_USE_MT_VAL=0 + fi + -cat >>confdefs.h <<\_ACEOF -#define DEAL_II_USE_MT 1 +cat >>confdefs.h <<_ACEOF +#define DEAL_II_USE_MT $DEAL_II_USE_MT_VAL _ACEOF - fi @@ -3563,6 +3653,12 @@ namespace StandardExceptions }; using namespace StandardExceptions; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3684,6 +3780,12 @@ namespace StandardExceptions }; using namespace StandardExceptions; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3748,6 +3850,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu g<1> (x); }; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3810,6 +3918,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu template class T<3> ; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3877,6 +3991,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu template class T<2,1> ; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -3938,6 +4058,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu template X X::operator= (float &); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4016,6 +4142,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu }; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4084,6 +4216,12 @@ template class X<1,T> { template class X<1,int>; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4147,6 +4285,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu encapsulate(&X::bar); }; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4213,6 +4357,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu template class Y; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4280,6 +4430,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu template class Function<1>; template Function<1>::~Function(); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4345,6 +4501,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu template struct X; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4407,6 +4569,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu }; }; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4467,6 +4635,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu template <> const int T<1>::i; template <> const int T<1>::i = 1; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4539,6 +4713,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu p3 = copy (p1, p2, p3); }; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4594,6 +4774,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4634,6 +4820,12 @@ echo $ECHO_N "checking for __func__... $ECHO_C" >&6 # include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4698,6 +4890,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu class MyIterator : public std::iterator {}; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4753,6 +4951,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4811,6 +5015,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4869,6 +5079,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #include void f (const std::ostream &out); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4926,6 +5142,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #include void f (const std::ostream &out); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -4982,6 +5204,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu bool f(); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5038,6 +5266,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5099,6 +5333,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5142,6 +5382,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5189,6 +5435,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5228,6 +5480,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5289,6 +5547,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5332,6 +5596,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5379,6 +5649,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5418,6 +5694,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5480,6 +5762,12 @@ echo $ECHO_N "checking for rand_r... $ECHO_C" >&6 #include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5542,6 +5830,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu no good system; #endif +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5597,6 +5891,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #include using namespace std; +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -5662,6 +5962,12 @@ extern "C" char $ac_func (); char (*f) (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -6256,6 +6562,12 @@ echo $ECHO_N "checking for consistency of CXXFLAGSG flags... $ECHO_C" >&6 #line $LINENO "configure" #include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -6299,6 +6611,12 @@ echo $ECHO_N "checking for consistency of CXXFLAGSO flags... $ECHO_C" >&6 #line $LINENO "configure" #include "confdefs.h" +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif int main () { @@ -6539,21 +6857,6 @@ fi DEFS=-DHAVE_CONFIG_H -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -6572,6 +6875,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -6580,13 +6884,11 @@ cat >>$CONFIG_STATUS <<\_ACEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +# NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset @@ -6594,38 +6896,39 @@ else as_unset=false fi +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi +# Name of the executable. if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi - -# Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -6637,7 +6940,6 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -6651,7 +6953,7 @@ if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh - if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: @@ -6802,7 +7104,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } exec 6>&1 @@ -6819,7 +7121,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by $as_me, which was -generated by GNU Autoconf 2.54. Invocation command line was +generated by GNU Autoconf 2.53a. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6878,7 +7180,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.54, +configured by $0, generated by GNU Autoconf 2.53a, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 @@ -6898,20 +7200,17 @@ do --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift ;; + -*);; *) # This is not an option, so the user has probably given explicit # arguments. - ac_option=$1 ac_need_defaults=false;; esac - case $ac_option in + case $1 in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<_ACEOF @@ -6934,12 +7233,12 @@ Try \`$0 --help' for more information." >&2;} --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + shift + CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. @@ -7104,8 +7403,6 @@ s,@kdocversion@,$kdocversion,;t t s,@docxx@,$docxx,;t t s,@PERL@,$PERL,;t t s,@subdirs@,$subdirs,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF @@ -7229,7 +7526,7 @@ esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` @@ -7414,7 +7711,7 @@ _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail @@ -7438,7 +7735,7 @@ do mv conftest.tail conftest.defines done rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS +echo ' fi # egrep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size @@ -7656,7 +7953,7 @@ esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` diff --git a/deal.II/deal.II/source/numerics/data_out.cc b/deal.II/deal.II/source/numerics/data_out.cc index f5cdb9b2d3..5060371da4 100644 --- a/deal.II/deal.II/source/numerics/data_out.cc +++ b/deal.II/deal.II/source/numerics/data_out.cc @@ -537,16 +537,7 @@ void DataOut::build_patches (const unsigned int n_subdivisions, typedef DataOut_DoFData BaseClass; Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected()); -#ifdef DEAL_II_USE_MT - const unsigned int n_threads = n_threads_; -#else - // access this variable to avoid - // compiler warning about unused - // var: - (void)n_threads_; - const unsigned int n_threads = 1; -#endif - + const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1); // before we start the loop: // create a quadrature rule that diff --git a/deal.II/deal.II/source/numerics/data_out_faces.cc b/deal.II/deal.II/source/numerics/data_out_faces.cc index a1e252498e..2e96cf7e59 100644 --- a/deal.II/deal.II/source/numerics/data_out_faces.cc +++ b/deal.II/deal.II/source/numerics/data_out_faces.cc @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -24,11 +25,6 @@ #include #include -#ifdef DEAL_II_USE_MT -#include -#endif - - template @@ -147,16 +143,7 @@ void DataOutFaces::build_patches (const unsigned int n_subdivisions, typedef DataOut_DoFData BaseClass; Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected()); -#ifdef DEAL_II_USE_MT - const unsigned int n_threads = n_threads_; -#else - // access this variable to avoid - // compiler warning about unused - // var: - (void)n_threads_; - const unsigned int n_threads = 1; -#endif - + const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1); // before we start the loop: // create a quadrature rule that @@ -212,19 +199,18 @@ void DataOutFaces::build_patches (const unsigned int n_subdivisions, default_patch.data.reinit (n_datasets, n_q_points); this->patches.insert (this->patches.end(), n_patches, default_patch); -#ifdef DEAL_II_USE_MT - - Threads::ThreadManager thread_manager; - for (unsigned int l=0;l::build_some_patches) - .collect_args (this, thread_data[l])); - thread_manager.wait(); - + if (DEAL_II_USE_MT) + { + Threads::ThreadManager thread_manager; + for (unsigned int l=0;l::build_some_patches) + .collect_args (this, thread_data[l])); + thread_manager.wait(); + } + else // just one thread -#else - build_some_patches(thread_data[0]); -#endif + build_some_patches(thread_data[0]); }; diff --git a/deal.II/deal.II/source/numerics/data_out_rotation.cc b/deal.II/deal.II/source/numerics/data_out_rotation.cc index 92dff26e01..0653a02f3f 100644 --- a/deal.II/deal.II/source/numerics/data_out_rotation.cc +++ b/deal.II/deal.II/source/numerics/data_out_rotation.cc @@ -13,6 +13,7 @@ #include +#include #include #include #include @@ -24,10 +25,6 @@ #include #include -#ifdef DEAL_II_USE_MT -#include -#endif - #include // if necessary try to work around a bug in the IBM xlC compiler @@ -326,16 +323,7 @@ void DataOutRotation::build_patches (const unsigned int n_patches_per_circl typedef DataOut_DoFData BaseClass; Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected()); -#ifdef DEAL_II_USE_MT - const unsigned int n_threads = n_threads_; -#else - // access this variable to avoid - // compiler warning about unused - // var: - (void)n_threads_; - const unsigned int n_threads = 1; -#endif - + const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1); // before we start the loop: // create a quadrature rule that @@ -399,22 +387,22 @@ void DataOutRotation::build_patches (const unsigned int n_patches_per_circl n_q_points * (n_subdivisions+1)); this->patches.insert (this->patches.end(), n_patches, default_patch); -#ifdef DEAL_II_USE_MT - - Threads::ThreadManager thread_manager; - for (unsigned int l=0;l::build_some_patches) - .collect_args (this, thread_data[l])); - thread_manager.wait(); - - // just one thread -#else - build_some_patches(thread_data[0]); -#endif + if (DEAL_II_USE_MT) + { + Threads::ThreadManager thread_manager; + for (unsigned int l=0;l::build_some_patches) + .collect_args (this, thread_data[l])); + thread_manager.wait(); + } + else + // just one thread + build_some_patches(thread_data[0]); }; + template typename DoFHandler::cell_iterator DataOutRotation::first_cell () diff --git a/deal.II/deal.II/source/numerics/error_estimator.cc b/deal.II/deal.II/source/numerics/error_estimator.cc index e2ef71adb9..ac90fe36a0 100644 --- a/deal.II/deal.II/source/numerics/error_estimator.cc +++ b/deal.II/deal.II/source/numerics/error_estimator.cc @@ -582,6 +582,8 @@ KellyErrorEstimator::estimate (const Mapping &mapping for (unsigned int n=0; nsize() == dof_handler.n_dofs(), ExcInvalidSolutionVector()); + + Assert (n_threads_ > 0, ExcInternalError()); // if no mask given: treat all components std::vector component_mask ((component_mask_.size() == 0) ? @@ -591,12 +593,9 @@ KellyErrorEstimator::estimate (const Mapping &mapping Assert (count(component_mask.begin(), component_mask.end(), true) > 0, ExcInvalidComponentMask()); - // if NOT multithreaded, set n_threads to one - unsigned int n_threads = n_threads_; -#ifndef DEAL_II_USE_MT - n_threads = 1; -#endif - Assert (n_threads > 0, ExcInternalError()); + // if NOT multithreaded, set + // n_threads to one + const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1); const unsigned int n_solution_vectors = solutions.size(); diff --git a/deal.II/deal.II/source/numerics/time_dependent.cc b/deal.II/deal.II/source/numerics/time_dependent.cc index 7e313ed397..7fca133972 100644 --- a/deal.II/deal.II/source/numerics/time_dependent.cc +++ b/deal.II/deal.II/source/numerics/time_dependent.cc @@ -14,16 +14,13 @@ #include #include +#include #include #include #include #include #include -#ifdef DEAL_II_USE_MT -# include -#endif - #include #include #include @@ -205,27 +202,24 @@ void TimeDependent::start_sweep (const unsigned int s) void TimeDependent::end_sweep (const unsigned int n_threads) { -#ifdef DEAL_II_USE_MT - const unsigned int stride = timesteps.size() / n_threads; - Threads::ThreadManager thread_manager; - void (TimeDependent::*p) (unsigned int, unsigned int) - = &TimeDependent::end_sweep; - for (unsigned int i=0; i 1)) + { + const unsigned int stride = timesteps.size() / n_threads; + Threads::ThreadManager thread_manager; + void (TimeDependent::*p) (unsigned int, unsigned int) + = &TimeDependent::end_sweep; + for (unsigned int i=0; iGeneral
    +
  1. + Changed: Previously, we just set the preprocessor variable + DEAL_II_USE_MT, when --with-multithreading was + given as argument to ./configure. Tests in the code + therefore looked like #ifdef DEAL_II_USE_MT. This has been + changed so that the variable is always defined, but it is now equal to 1 + when multithreading was requested, and zero otherwise. The reason for + this is that you can now write if (DEAL_II_USE_MT && ...) + conditions, and need not interleave if-else clauses from regular code + and the preprocessor, if conditions involve both the state of this + preprocessor variable and the run-time state of your program. However, + this change requires that all appearances of #ifdef + DEAL_II_USE_MT be changed to #if DEAL_II_USE_MT == + 1, since the variable is now defined unconditionally. +
    + (WB 2002/11/14) +

    +
  2. New: Object files are now named according to the local defaults on the system we are running on. On Unix systems, this is diff --git a/deal.II/lac/include/lac/sparse_matrix.templates.h b/deal.II/lac/include/lac/sparse_matrix.templates.h index 689d935d5a..c55a03baf7 100644 --- a/deal.II/lac/include/lac/sparse_matrix.templates.h +++ b/deal.II/lac/include/lac/sparse_matrix.templates.h @@ -353,7 +353,10 @@ SparseMatrix::threaded_vmult (Vector &dst, const unsigned int begin_row, const unsigned int end_row) const { -#ifdef DEAL_II_USE_MT + // this function should not be called + // when not in parallel mode. + Assert (DEAL_II_USE_MT, ExcInternalError()); + const number *val_ptr = &val[cols->rowstart[begin_row]]; const unsigned int *colnum_ptr = &cols->colnums[cols->rowstart[begin_row]]; somenumber *dst_ptr = &dst(begin_row); @@ -365,11 +368,6 @@ SparseMatrix::threaded_vmult (Vector &dst, s += *val_ptr++ * src(*colnum_ptr++); *dst_ptr++ = s; }; -#else - // this function should not be called - // when not in parallel mode. - Assert (false, ExcInternalError()); -#endif }; @@ -533,7 +531,10 @@ SparseMatrix::threaded_matrix_norm_square (const Vector &v, const unsigned int end_row, somenumber *partial_sum) const { -#ifdef DEAL_II_USE_MT + // this function should not be called + // when not in parallel mode. + Assert (DEAL_II_USE_MT, ExcInternalError()); + somenumber sum = 0.; const number *val_ptr = &val[cols->rowstart[begin_row]]; const unsigned int *colnum_ptr = &cols->colnums[cols->rowstart[begin_row]]; @@ -547,11 +548,6 @@ SparseMatrix::threaded_matrix_norm_square (const Vector &v, sum += s* v(row); }; *partial_sum = sum; - -#else - // function should not have been called - Assert (false, ExcInternalError()); -#endif }; @@ -650,7 +646,10 @@ SparseMatrix::threaded_matrix_scalar_product (const Vector & const unsigned int end_row, somenumber *partial_sum) const { -#ifdef DEAL_II_USE_MT + // this function should not be called + // when not in parallel mode. + Assert (DEAL_II_USE_MT, ExcInternalError()); + somenumber sum = 0.; const number *val_ptr = &val[cols->rowstart[begin_row]]; const unsigned int *colnum_ptr = &cols->colnums[cols->rowstart[begin_row]]; @@ -664,11 +663,6 @@ SparseMatrix::threaded_matrix_scalar_product (const Vector & sum += s* u(row); }; *partial_sum = sum; - -#else - // function should not have been called - Assert (false, ExcInternalError()); -#endif }; @@ -808,7 +802,10 @@ SparseMatrix::threaded_residual (Vector &dst, const std::pair interval, somenumber *partial_norm) const { -#ifdef DEAL_II_USE_MT + // this function should not be called + // when not in parallel mode. + Assert (DEAL_II_USE_MT, ExcInternalError()); + const unsigned int begin_row = interval.first, end_row = interval.second; @@ -827,9 +824,6 @@ SparseMatrix::threaded_residual (Vector &dst, }; *partial_norm = norm; -#else - Assert (false, ExcInternalError()); -#endif }; diff --git a/deal.II/lac/include/lac/sparse_vanka.templates.h b/deal.II/lac/include/lac/sparse_vanka.templates.h index 83cf5e01af..023215631b 100644 --- a/deal.II/lac/include/lac/sparse_vanka.templates.h +++ b/deal.II/lac/include/lac/sparse_vanka.templates.h @@ -15,15 +15,12 @@ #include +#include #include #include #include #include -#ifdef DEAL_II_USE_MT -# include -#endif - #include #include @@ -71,64 +68,66 @@ template void SparseVanka::compute_inverses () { -#ifdef DEAL_II_USE_MT - const unsigned int n_inverses = count (selected.begin(), - selected.end(), - true); - - const unsigned int n_inverses_per_thread = std::max(n_inverses / n_threads, - 1U); - - // set up start and end index for - // each of the threads. note that - // we have to work somewhat to get - // this appropriate, since the - // indices for which inverses have - // to be computed may not be evenly - // distributed in the vector. as an - // extreme example consider - // numbering of DoFs by component, - // then all indices for which we - // have to do work will be - // consecutive, with other - // consecutive regions where we do - // not have to do something - std::vector > blocking (n_threads); - - unsigned int c = 0; - unsigned int thread = 0; - blocking[0].first = 0; - - for (unsigned int i=0; (im()) && (thread+1m()); + else { - if (selected[i] == true) - ++c; - if (c == n_inverses_per_thread) - { - blocking[thread].second = i; - blocking[thread+1].first = i; - ++thread; + const unsigned int n_inverses = count (selected.begin(), + selected.end(), + true); - c = 0; - }; - }; - blocking[n_threads-1].second = matrix->m(); + const unsigned int n_inverses_per_thread = std::max(n_inverses / n_threads, + 1U); + + // set up start and end index + // for each of the + // threads. note that we have + // to work somewhat to get this + // appropriate, since the + // indices for which inverses + // have to be computed may not + // be evenly distributed in the + // vector. as an extreme + // example consider numbering + // of DoFs by component, then + // all indices for which we + // have to do work will be + // consecutive, with other + // consecutive regions where we + // do not have to do something + std::vector > blocking (n_threads); - typedef void (SparseVanka::*FunPtr)(unsigned int, unsigned int); - FunPtr fun_ptr = &SparseVanka::compute_inverses; + unsigned int c = 0; + unsigned int thread = 0; + blocking[0].first = 0; - // Now spawn the threads - Threads::ThreadManager thread_manager; - for (unsigned int i=0; im()) && (thread+1m(); + + typedef void (SparseVanka::*FunPtr)(unsigned int, unsigned int); + FunPtr fun_ptr = &SparseVanka::compute_inverses; - thread_manager.wait (); + // Now spawn the threads + Threads::ThreadManager thread_manager; + for (unsigned int i=0; im()); -#endif + thread_manager.wait (); + }; }; @@ -579,36 +578,39 @@ void SparseBlockVanka::vmult (Vector &dst, else // otherwise: blocking requested { -#ifdef DEAL_II_USE_MT - // spawn threads. since - // some compilers have trouble - // finding out which - // 'encapsulate' function to - // take of all those possible - // ones if we simply drop in - // the address of an overloaded - // template member function, - // make it simpler for the - // compiler by giving it the - // correct type right away: - typedef void (SparseVanka::*mem_fun_p) - (Vector &, - const Vector &, - const std::vector *) const; - const mem_fun_p comp - = &SparseVanka::template apply_preconditioner; - Threads::ThreadManager thread_manager; - for (unsigned int block=0; block::*mem_fun_p) + (Vector &, + const Vector &, + const std::vector *) const; + const mem_fun_p comp + = &SparseVanka::template apply_preconditioner; + Threads::ThreadManager thread_manager; + for (unsigned int block=0; block Threads::ThreadManager SwappableVector::thread_manager; -#endif @@ -73,18 +71,14 @@ SwappableVector::operator= (const SwappableVector &v) kill_file (); // if in MT mode, block all other - // operations -#ifdef DEAL_II_USE_MT + // operations. if not in MT mode, + // this is a no-op lock.acquire (); -#endif Vector::operator = (v); data_is_preloaded = false; -#ifdef DEAL_II_USE_MT lock.release (); -#endif - return *this; }; @@ -107,12 +101,11 @@ void SwappableVector::swap_out (const std::string &name) Assert (this->size() != 0, ExcSizeZero()); // if in MT mode, block all other - // operations -#ifdef DEAL_II_USE_MT + // operations. if not in MT mode, + // this is a no-op lock.acquire (); -#endif - - // check that we have not called + + // check that we have not called // @p{alert} without the respective // @p{reload} function Assert (data_is_preloaded == false, ExcInternalError()); @@ -123,9 +116,7 @@ void SwappableVector::swap_out (const std::string &name) this->reinit (0); -#ifdef DEAL_II_USE_MT lock.release (); -#endif }; @@ -134,10 +125,11 @@ template void SwappableVector::reload () { // if in MT mode: synchronise with - // possibly existing @p{alert} calls -#ifdef DEAL_II_USE_MT + // possibly existing @p{alert} + // calls. if not in MT mode, this + // is a no-op lock.acquire (); -#endif + // if data was already preloaded, // then there is no more need to // load it @@ -155,9 +147,7 @@ void SwappableVector::reload () // release lock. the lock is // also released in the other // branch of the if-clause -#ifdef DEAL_II_USE_MT lock.release (); -#endif }; }; @@ -168,7 +158,8 @@ void SwappableVector::alert () { // note: this function does nothing // in non-MT mode -#ifdef DEAL_II_USE_MT + if (!DEAL_II_USE_MT) + return; // synchronise with possible other // invokations of this function and @@ -191,7 +182,6 @@ void SwappableVector::alert () .collect_args(this, true)); // note that reload_vector also // releases the lock -#endif }; @@ -209,14 +199,13 @@ void SwappableVector::reload_vector (const bool set_flag) // release the lock that was // acquired by the calling // functions -#ifdef DEAL_II_USE_MT - // set the flag if so required - if (set_flag) - data_is_preloaded = true; - lock.release (); -#else - (void)set_flag; -#endif + if (DEAL_II_USE_MT) + { + // set the flag if so required + if (set_flag) + data_is_preloaded = true; + lock.release (); + }; }; @@ -227,10 +216,9 @@ void SwappableVector::kill_file () // if in MT mode, wait for other // operations to finish first // (there should be none, but who - // knows) -#ifdef DEAL_II_USE_MT + // knows). if not in MT mode, + // this is a no-op lock.acquire(); -#endif // this is too bad: someone // requested the vector in advance, @@ -246,9 +234,7 @@ void SwappableVector::kill_file () filename = ""; }; -#ifdef DEAL_II_USE_MT lock.release (); -#endif }; -- 2.39.5