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.])
])
#include <vector>
#include <iterator>
-#ifdef DEAL_II_USE_MT
+#if DEAL_II_USE_MT == 1
# if defined(DEAL_II_USE_MT_ACE)
# include <ace/Thread_Manager.h>
# include <ace/Synch.h>
};
-#ifdef DEAL_II_USE_MT
+#if DEAL_II_USE_MT == 1
# if defined(DEAL_II_USE_MT_ACE)
/**
* In multithread mode with ACE
-#ifdef DEAL_II_USE_MT
+#if DEAL_II_USE_MT == 1
#if defined(__linux__)
};
-#ifndef DEAL_II_USE_MT
+#if DEAL_II_USE_MT != 1
void DummyThreadManager::spawn (const FunPtr fun_ptr,
void * fun_data,
int /*flags*/) const
// 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,
#! /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. ##
## --------------------- ##
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
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\(//\)$' \| \
/^X\/\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
-
# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
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=:
IFS=" $as_nl"
# CDPATH.
-$as_unset CDPATH
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
# Name of the host.
# Initializations.
#
ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
cross_compiling=no
subdirs=
MFLAGS=
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=
{ (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
# 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`
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 $@
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
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
# Save into config.log some information that might help in debugging.
{
echo
-
cat <<\_ASBOX
## ---------------- ##
## Cache variables. ##
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
## ----------- ##
## ----------- ##
_ASBOX
echo
- sed "/^$/d" confdefs.h | sort
+ sed "/^$/d" confdefs.h
echo
fi
test "$ac_signal" != 0 &&
-
ac_config_headers="$ac_config_headers base/include/base/config.h"
# 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
#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
# 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
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
# 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" : '[^.]*\(\..*\)'`
#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
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 ()
{
#include "confdefs.h"
#include <stdlib.h>
$ac_declaration
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#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 ()
{
#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include "confdefs.h"
#include <stdlib.h>
$ac_declaration
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#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 ()
{
#include <map>
#include <vector>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
return (i1==i2);
}
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
nonsense
# endif
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
# include <pthread.h>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
# include <pthread.h>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
# include <pthread.h>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
# include <ace/Thread_Manager.h>
# include <ace/Synch.h>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
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
};
using namespace StandardExceptions;
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
};
using namespace StandardExceptions;
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
g<1> (x);
};
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
template class T<3> ;
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
template class T<2,1> ;
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
template X X::operator=<float> (float &);
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
};
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
template class X<1,int>;
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
encapsulate(&X::bar);
};
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
template class Y<const X>;
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
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 ()
{
template struct X<TT>;
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
};
};
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
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 ()
{
p3 = copy (p1, p2, p3);
};
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
# include <iostream>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
# include <iostream>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
class MyIterator : public std::iterator<std::bidirectional_iterator_tag,int>
{};
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <sstream>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <limits>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <ostream>
void f (const std::ostream &out);
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <iosfwd>
void f (const std::ostream &out);
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
bool f();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <sys/resource.h>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <cmath>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <cmath>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <cmath>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <cmath>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <cmath>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <cmath>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <cmath>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <cmath>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <cstdlib>
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
no good system;
#endif
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#include <errno.h>
using namespace std;
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
char $ac_func ();
char (*f) ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
#line $LINENO "configure"
#include "confdefs.h"
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
int
main ()
{
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
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
+
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
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
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\(//\)$' \| \
/^X\/\(\/\).*/{ s//\1/; q; }
s/.*/./; q'`
-
# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
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=:
IFS=" $as_nl"
# CDPATH.
-$as_unset CDPATH
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
exec 6>&1
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
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
--*=*)
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
--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.
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
# 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`
# 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
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
# 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`
typedef DataOut_DoFData<dim,dim> 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
#include <base/quadrature_lib.h>
+#include <base/thread_management.h>
#include <lac/vector.h>
#include <lac/block_vector.h>
#include <numerics/data_out_faces.h>
#include <fe/fe_values.h>
#include <fe/mapping_q1.h>
-#ifdef DEAL_II_USE_MT
-#include <base/thread_management.h>
-#endif
-
-
template <int dim>
typedef DataOut_DoFData<dim,dim+1> 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
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<n_threads;++l)
- Threads::spawn (thread_manager,
- Threads::encapsulate (&DataOutFaces<dim>::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<n_threads;++l)
+ Threads::spawn (thread_manager,
+ Threads::encapsulate (&DataOutFaces<dim>::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]);
};
#include <base/quadrature_lib.h>
+#include <base/thread_management.h>
#include <lac/vector.h>
#include <lac/block_vector.h>
#include <numerics/data_out_rotation.h>
#include <fe/fe_values.h>
#include <fe/mapping_q1.h>
-#ifdef DEAL_II_USE_MT
-#include <base/thread_management.h>
-#endif
-
#include <cmath>
// if necessary try to work around a bug in the IBM xlC compiler
typedef DataOut_DoFData<dim,dim+1> 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
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<n_threads;++l)
- Threads::spawn (thread_manager,
- Threads::encapsulate (&DataOutRotation<dim>::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<n_threads;++l)
+ Threads::spawn (thread_manager,
+ Threads::encapsulate (&DataOutRotation<dim>::build_some_patches)
+ .collect_args (this, thread_data[l]));
+ thread_manager.wait();
+ }
+ else
+ // just one thread
+ build_some_patches(thread_data[0]);
};
+
template <int dim>
typename DoFHandler<dim>::cell_iterator
DataOutRotation<dim>::first_cell ()
for (unsigned int n=0; n<solutions.size(); ++n)
Assert (solutions[n]->size() == dof_handler.n_dofs(),
ExcInvalidSolutionVector());
+
+ Assert (n_threads_ > 0, ExcInternalError());
// if no mask given: treat all components
std::vector<bool> component_mask ((component_mask_.size() == 0) ?
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();
#include <numerics/time_dependent.h>
#include <base/memory_consumption.h>
+#include <base/thread_management.h>
#include <grid/tria.h>
#include <grid/tria_accessor.h>
#include <grid/tria_iterator.h>
#include <grid/grid_refinement.h>
#include <lac/vector.h>
-#ifdef DEAL_II_USE_MT
-# include <base/thread_management.h>
-#endif
-
#include <functional>
#include <algorithm>
#include <numeric>
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<n_threads; ++i)
- Threads::spawn (thread_manager,
- Threads::encapsulate (p)
- .collect_args (this, i*stride,
- (i == n_threads-1 ?
- timesteps.size() :
- (i+1)*stride)));
- thread_manager.wait();
-
-#else
- // ignore this parameter, but don't
- // let the compiler warn
- (void) n_threads;
- // now do the work
- end_sweep (0, timesteps.size());
-#endif
+ if (DEAL_II_USE_MT && (n_threads > 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; i<n_threads; ++i)
+ Threads::spawn (thread_manager,
+ Threads::encapsulate (p)
+ .collect_args (this, i*stride,
+ (i == n_threads-1 ?
+ timesteps.size() :
+ (i+1)*stride)));
+ thread_manager.wait();
+ }
+ else
+ // now do the work
+ end_sweep (0, timesteps.size());
}
<h3>General</h3>
<ol>
+ <li> <p>
+ Changed: Previously, we just set the preprocessor variable
+ <code>DEAL_II_USE_MT</code>, when <code>--with-multithreading</code> was
+ given as argument to <code>./configure</code>. Tests in the code
+ therefore looked like <code>#ifdef DEAL_II_USE_MT</code>. 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 <code>if (DEAL_II_USE_MT && ...)</code>
+ 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 <code>#ifdef
+ DEAL_II_USE_MT</code> be changed to <code>#if DEAL_II_USE_MT ==
+ 1</code>, since the variable is now defined unconditionally.
+ <br>
+ (WB 2002/11/14)
+ </p>
+
<li> <p>
New: Object files are now named according to the local defaults
on the system we are running on. On Unix systems, this is
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);
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
};
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]];
sum += s* v(row);
};
*partial_sum = sum;
-
-#else
- // function should not have been called
- Assert (false, ExcInternalError());
-#endif
};
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]];
sum += s* u(row);
};
*partial_sum = sum;
-
-#else
- // function should not have been called
- Assert (false, ExcInternalError());
-#endif
};
const std::pair<unsigned int, unsigned int> 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;
};
*partial_norm = norm;
-#else
- Assert (false, ExcInternalError());
-#endif
};
#include <base/memory_consumption.h>
+#include <base/thread_management.h>
#include <lac/sparse_vanka.h>
#include <lac/full_matrix.h>
#include <lac/sparse_matrix.h>
#include <lac/vector.h>
-#ifdef DEAL_II_USE_MT
-# include <base/thread_management.h>
-#endif
-
#include <algorithm>
#include <map>
void
SparseVanka<number>::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<std::pair<unsigned int, unsigned int> > blocking (n_threads);
-
- unsigned int c = 0;
- unsigned int thread = 0;
- blocking[0].first = 0;
-
- for (unsigned int i=0; (i<matrix->m()) && (thread+1<n_threads); ++i)
+ if (!DEAL_II_USE_MT)
+ compute_inverses (0, matrix->m());
+ 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<std::pair<unsigned int, unsigned int> > blocking (n_threads);
- typedef void (SparseVanka<number>::*FunPtr)(unsigned int, unsigned int);
- FunPtr fun_ptr = &SparseVanka<number>::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; i<n_threads; ++i)
- Threads::spawn (thread_manager,
- Threads::encapsulate (fun_ptr)
- .collect_args (this, blocking[i].first, blocking[i].second));
+ for (unsigned int i=0; (i<matrix->m()) && (thread+1<n_threads); ++i)
+ {
+ if (selected[i] == true)
+ ++c;
+ if (c == n_inverses_per_thread)
+ {
+ blocking[thread].second = i;
+ blocking[thread+1].first = i;
+ ++thread;
+
+ c = 0;
+ };
+ };
+ blocking[n_threads-1].second = matrix->m();
+
+ typedef void (SparseVanka<number>::*FunPtr)(unsigned int, unsigned int);
+ FunPtr fun_ptr = &SparseVanka<number>::compute_inverses;
- thread_manager.wait ();
+ // Now spawn the threads
+ Threads::ThreadManager thread_manager;
+ for (unsigned int i=0; i<n_threads; ++i)
+ Threads::spawn (thread_manager,
+ Threads::encapsulate (fun_ptr)
+ .collect_args (this, blocking[i].first, blocking[i].second));
-#else
- compute_inverses (0, matrix->m());
-#endif
+ thread_manager.wait ();
+ };
};
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<number>::*mem_fun_p)
- (Vector<number2> &,
- const Vector<number2> &,
- const std::vector<bool> *) const;
- const mem_fun_p comp
- = &SparseVanka<number>::template apply_preconditioner<number2>;
- Threads::ThreadManager thread_manager;
- for (unsigned int block=0; block<n_blocks; ++block)
- Threads::spawn (thread_manager,
- Threads::encapsulate (comp)
- .collect_args (this, dst, src, &dof_masks[block]));
-
- thread_manager.wait ();
-#else
- for (unsigned int block=0; block<n_blocks; ++block)
- apply_preconditioner (dst, src,
- &dof_masks[block]);
-#endif
+ if (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<number>::*mem_fun_p)
+ (Vector<number2> &,
+ const Vector<number2> &,
+ const std::vector<bool> *) const;
+ const mem_fun_p comp
+ = &SparseVanka<number>::template apply_preconditioner<number2>;
+ Threads::ThreadManager thread_manager;
+ for (unsigned int block=0; block<n_blocks; ++block)
+ Threads::spawn (thread_manager,
+ Threads::encapsulate (comp)
+ .collect_args (this, dst, src, &dof_masks[block]));
+
+ thread_manager.wait ();
+ }
+ else
+ for (unsigned int block=0; block<n_blocks; ++block)
+ apply_preconditioner (dst, src,
+ &dof_masks[block]);
}
}
-#ifdef DEAL_II_USE_MT
// allocate static variable
template <typename number>
Threads::ThreadManager SwappableVector<number>::thread_manager;
-#endif
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<number>::operator = (v);
data_is_preloaded = false;
-#ifdef DEAL_II_USE_MT
lock.release ();
-#endif
-
return *this;
};
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());
this->reinit (0);
-#ifdef DEAL_II_USE_MT
lock.release ();
-#endif
};
void SwappableVector<number>::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
// release lock. the lock is
// also released in the other
// branch of the if-clause
-#ifdef DEAL_II_USE_MT
lock.release ();
-#endif
};
};
{
// 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
.collect_args(this, true));
// note that reload_vector also
// releases the lock
-#endif
};
// 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 ();
+ };
};
// 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,
filename = "";
};
-#ifdef DEAL_II_USE_MT
lock.release ();
-#endif
};