diff --git a/dune/common/Makefile.am b/dune/common/Makefile.am index b3f283bba0fe6ea0d59807cec8c7f323257265d0..866b8db6414c7bb406b62b32e3c38ca2610a8211 100644 --- a/dune/common/Makefile.am +++ b/dune/common/Makefile.am @@ -22,7 +22,6 @@ commoninclude_HEADERS = \ bigunsignedint.hh \ binaryfunctions.hh \ classname.hh \ - collectivecommunication.hh \ debugstream.hh \ deprecated.hh \ densematrix.hh \ @@ -54,10 +53,6 @@ commoninclude_HEADERS = \ math.hh \ matvectraits.hh \ misc.hh \ - mpicollectivecommunication.hh \ - mpiguard.hh \ - mpihelper.hh \ - mpitraits.hh \ nullptr.hh \ parametertree.hh \ parametertreeparser.hh \ diff --git a/dune/common/parallel/Makefile.am b/dune/common/parallel/Makefile.am index f54d903967d5d1ea1ff70906746bca646d40e7c3..df1aedd6e74805506eb1338acd3e685485d61cb0 100644 --- a/dune/common/parallel/Makefile.am +++ b/dune/common/parallel/Makefile.am @@ -3,14 +3,18 @@ SUBDIRS = test parallelincludedir = $(includedir)/dune/common/parallel -parallelinclude_HEADERS = communicator.hh \ - indexset.hh \ - indicessyncer.hh \ - interface.hh \ - localindex.hh \ - plocalindex.hh \ - remoteindices.hh \ +parallelinclude_HEADERS = communicator.hh \ + indexset.hh \ + indicessyncer.hh \ + interface.hh \ + localindex.hh \ + collectivecommunication.hh \ + mpicollectivecommunication.hh \ + mpiguard.hh \ + mpihelper.hh \ + mpitraits.hh \ + plocalindex.hh \ + remoteindices.hh \ selection.hh - include $(top_srcdir)/am/global-rules diff --git a/dune/common/collectivecommunication.hh b/dune/common/parallel/collectivecommunication.hh similarity index 99% rename from dune/common/collectivecommunication.hh rename to dune/common/parallel/collectivecommunication.hh index 667271aec5b329c34569345cca5a7df498f2edd6..8c819b9ce9c186192e4905654405307be0e19532 100644 --- a/dune/common/collectivecommunication.hh +++ b/dune/common/parallel/collectivecommunication.hh @@ -3,11 +3,11 @@ #ifndef DUNE_COLLECTIVECOMMUNICATION_HH #define DUNE_COLLECTIVECOMMUNICATION_HH -#include <iostream> -#include <complex> #include <algorithm> +#include <complex> +#include <iostream> -#include "exceptions.hh" +#include <dune/common/exceptions.hh> /*! \defgroup ParallelCommunication Parallel Communication \ingroup Common diff --git a/dune/common/mpicollectivecommunication.hh b/dune/common/parallel/mpicollectivecommunication.hh similarity index 96% rename from dune/common/mpicollectivecommunication.hh rename to dune/common/parallel/mpicollectivecommunication.hh index cef91389eac80670c2321e0033bd85d4fefd275f..c94796cb100874ba767a2dcd694c14a7ccb043a9 100644 --- a/dune/common/mpicollectivecommunication.hh +++ b/dune/common/parallel/mpicollectivecommunication.hh @@ -13,11 +13,11 @@ #include <algorithm> #include <functional> -#include "exceptions.hh" -#include "collectivecommunication.hh" -#include "binaryfunctions.hh" -#include "shared_ptr.hh" -#include "mpitraits.hh" +#include <dune/common/exceptions.hh> +#include <dune/common/binaryfunctions.hh> +#include <dune/common/parallel/collectivecommunication.hh> +#include <dune/common/parallel/mpitraits.hh> +#include <dune/common/shared_ptr.hh> #if HAVE_MPI // MPI header @@ -300,7 +300,9 @@ namespace Dune int me; int procs; }; -} // namespace dune -#endif -#endif +} // namespace Dune + +#endif // #if HAVE_MPI + +#endif // #ifndef DUNE_MPICOLLECTIVECOMMUNICATION_HH diff --git a/dune/common/mpiguard.hh b/dune/common/parallel/mpiguard.hh similarity index 96% rename from dune/common/mpiguard.hh rename to dune/common/parallel/mpiguard.hh index 3e70e1996462ac5b8868dd49778d52a7997138fa..6824adf6666dd3e23163393d3889772b5849935d 100644 --- a/dune/common/mpiguard.hh +++ b/dune/common/parallel/mpiguard.hh @@ -11,10 +11,10 @@ #ifndef DUNE_COMMON_MPIGUARD_HH #define DUNE_COMMON_MPIGUARD_HH -#include <dune/common/mpihelper.hh> -#include <dune/common/collectivecommunication.hh> -#include <dune/common/mpicollectivecommunication.hh> #include <dune/common/exceptions.hh> +#include <dune/common/parallel/collectivecommunication.hh> +#include <dune/common/parallel/mpihelper.hh> +#include <dune/common/parallel/mpicollectivecommunication.hh> namespace Dune { @@ -209,6 +209,6 @@ namespace Dune } }; -} +} // namespace Dune #endif // DUNE_COMMON_MPIGUARD_HH diff --git a/dune/common/mpihelper.hh b/dune/common/parallel/mpihelper.hh similarity index 96% rename from dune/common/mpihelper.hh rename to dune/common/parallel/mpihelper.hh index 4b77272dac860a468978a25092d161197336280e..40feec141b1c908d86a7326891193c51df27dae7 100644 --- a/dune/common/mpihelper.hh +++ b/dune/common/parallel/mpihelper.hh @@ -5,13 +5,15 @@ #define DUNE_MPIHELPER #include <cassert> -#include "collectivecommunication.hh" + +#include <dune/common/parallel/collectivecommunication.hh> +#include <dune/common/parallel/mpicollectivecommunication.hh> + #if HAVE_MPI #include "mpi.h" -#include "mpicollectivecommunication.hh" -#endif +#endif // #if HAVE_MPI -#include "stdstreams.hh" +#include <dune/common/stdstreams.hh> namespace Dune { @@ -286,5 +288,6 @@ namespace Dune #endif -} // end namespace Dune -#endif +} // namespace Dune + +#endif // #ifndef DUNE_MPIHELPER diff --git a/dune/common/mpitraits.hh b/dune/common/parallel/mpitraits.hh similarity index 100% rename from dune/common/mpitraits.hh rename to dune/common/parallel/mpitraits.hh diff --git a/dune/common/parallel/plocalindex.hh b/dune/common/parallel/plocalindex.hh index d80e6e7e6a9727968329eac4143654b1f0a7d396..a9b831c39a999844ffe72e28caa0f08758fe3ef3 100644 --- a/dune/common/parallel/plocalindex.hh +++ b/dune/common/parallel/plocalindex.hh @@ -5,11 +5,11 @@ #ifndef DUNE_PLOCALINDEX_HH #define DUNE_PLOCALINDEX_HH -#include "localindex.hh" -#include "indexset.hh" #include <iostream> -#include <dune/common/mpitraits.hh> +#include <dune/common/parallel/indexset.hh> +#include <dune/common/parallel/localindex.hh> +#include <dune/common/parallel/mpitraits.hh> namespace Dune { @@ -315,4 +315,4 @@ namespace Dune /** @} */ } // namespace Dune -#endif +#endif // #ifndef DUNE_PLOCALINDEX_HH diff --git a/dune/common/parallel/remoteindices.hh b/dune/common/parallel/remoteindices.hh index 44fd870aa972732cae5e276cba2860e6524f490f..cf0e8b6b37d52dc986fa4f4ef168f10b25dfdb64 100644 --- a/dune/common/parallel/remoteindices.hh +++ b/dune/common/parallel/remoteindices.hh @@ -4,21 +4,23 @@ #ifndef DUNE_REMOTEINDICES_HH #define DUNE_REMOTEINDICES_HH -#include "indexset.hh" +#include <algorithm> +#include <iostream> +#include <iterator> +#include <map> +#include <set> +#include <utility> + #include <dune/common/exceptions.hh> -#include "plocalindex.hh" -#include <dune/common/poolallocator.hh> #include <dune/common/container/sllist.hh> +#include <dune/common/parallel/indexset.hh> +#include <dune/common/parallel/mpitraits.hh> +#include <dune/common/parallel/plocalindex.hh> +#include <dune/common/poolallocator.hh> #include <dune/common/static_assert.hh> #include <dune/common/stdstreams.hh> -#include <map> -#include <set> -#include <utility> -#include <iostream> -#include <algorithm> -#include <iterator> + #if HAVE_MPI -#include <dune/common/mpitraits.hh> #include "mpi.h" namespace Dune @@ -1890,8 +1892,11 @@ namespace Dune } return os; } + /** @} */ -} -#endif -#endif +} // namespace Dune + +#endif // #if HAVE_MPI + +#endif // #ifndef DUNE_REMOTEINDICES_HH diff --git a/dune/common/parallel/test/Makefile.am b/dune/common/parallel/test/Makefile.am index f864a8b38bad2ba2f4eddb8d7ec9e367a806292b..3ae9357e74165fd44bfcaa98152156c231361308 100644 --- a/dune/common/parallel/test/Makefile.am +++ b/dune/common/parallel/test/Makefile.am @@ -1,6 +1,7 @@ # $Id$ -MPITESTS = indicestest indexsettest syncertest selectiontest +MPITESTS = mpicollectivecommunication mpiguardtest mpihelpertest mpihelpertest2 \ + indicestest indexsettest syncertest selectiontest # which tests where program to build and run are equal NORMALTESTS = @@ -12,6 +13,27 @@ TESTS = $(NORMALTESTS) $(MPITESTS) check_PROGRAMS = $(NORMALTESTS) $(MPITESTS) # define the programs +# +mpihelpertest_SOURCES = mpihelpertest.cc +mpihelpertest_CPPFLAGS = $(AM_CPPFLAGS) $(DUNEMPICPPFLAGS) +mpihelpertest_LDADD = $(DUNEMPILIBS) $(LDADD) +mpihelpertest_LDFLAGS = $(AM_LDFLAGS) $(DUNEMPILDFLAGS) + +mpihelpertest2_SOURCES = mpihelpertest.cc +mpihelpertest2_CPPFLAGS = $(AM_CPPFLAGS) $(DUNEMPICPPFLAGS) -DMPIHELPER_PREINITIALIZE +mpihelpertest2_LDADD = $(DUNEMPILIBS) $(LDADD) +mpihelpertest2_LDFLAGS = $(AM_LDFLAGS) $(DUNEMPILDFLAGS) + +mpicollectivecommunication_SOURCES = mpicollectivecommunication.cc +mpicollectivecommunication_CPPFLAGS = $(AM_CPPFLAGS) $(DUNEMPICPPFLAGS) +mpicollectivecommunication_LDADD = $(DUNEMPILIBS) $(LDADD) +mpicollectivecommunication_LDFLAGS = $(AM_LDFLAGS) $(DUNEMPILDFLAGS) + +mpiguardtest_SOURCES = mpiguardtest.cc +mpiguardtest_CPPFLAGS = $(AM_CPPFLAGS) $(DUNEMPICPPFLAGS) +mpiguardtest_LDADD = $(DUNEMPILIBS) $(LDADD) +mpiguardtest_LDFLAGS = $(AM_LDFLAGS) $(DUNEMPILDFLAGS) + indicestest_SOURCES = indicestest.cc indicestest_CPPFLAGS = $(AM_CPPFLAGS) \ $(DUNEMPICPPFLAGS) diff --git a/dune/common/test/mpicollectivecommunication.cc b/dune/common/parallel/test/mpicollectivecommunication.cc similarity index 92% rename from dune/common/test/mpicollectivecommunication.cc rename to dune/common/parallel/test/mpicollectivecommunication.cc index 95ff375da4b1e3dbf5a9a3e7193dc81033f3b680..5670eb6b94b5de35425a108d6caff81801a17d50 100644 --- a/dune/common/test/mpicollectivecommunication.cc +++ b/dune/common/parallel/test/mpicollectivecommunication.cc @@ -4,13 +4,11 @@ #include "config.h" #endif -#include <dune/common/mpihelper.hh> +#include <iostream> -#if HAVE_MPI -#include <dune/common/mpicollectivecommunication.hh> -#endif +#include <dune/common/parallel/mpihelper.hh> +#include <dune/common/parallel/mpicollectivecommunication.hh> -#include <iostream> int main(int argc, char** argv) { typedef Dune::MPIHelper Helper; diff --git a/dune/common/test/mpiguardtest.cc b/dune/common/parallel/test/mpiguardtest.cc similarity index 96% rename from dune/common/test/mpiguardtest.cc rename to dune/common/parallel/test/mpiguardtest.cc index 5b71fe48cf75d6e38edf124e7155c9c414f6a7b2..055b66fa5e9719489ead3e8e73d036198417de51 100644 --- a/dune/common/test/mpiguardtest.cc +++ b/dune/common/parallel/test/mpiguardtest.cc @@ -2,8 +2,8 @@ // vi: set et ts=4 sw=2 sts=2: #include <config.h> -#include <dune/common/mpihelper.hh> -#include <dune/common/mpiguard.hh> +#include <dune/common/parallel/mpiguard.hh> +#include <dune/common/parallel/mpihelper.hh> int main(int argc, char** argv) { diff --git a/dune/common/test/mpihelpertest.cc b/dune/common/parallel/test/mpihelpertest.cc similarity index 94% rename from dune/common/test/mpihelpertest.cc rename to dune/common/parallel/test/mpihelpertest.cc index f77c5e8551f416bcec17eb56cf759afc97640089..30130772a7e38178aaaf7edae11493a75c732f64 100644 --- a/dune/common/test/mpihelpertest.cc +++ b/dune/common/parallel/test/mpihelpertest.cc @@ -4,9 +4,10 @@ #include "config.h" #endif -#include <dune/common/mpihelper.hh> #include <iostream> +#include <dune/common/parallel/mpihelper.hh> + int main(int argc, char** argv) { diff --git a/dune/common/test/Makefile.am b/dune/common/test/Makefile.am index f2903ad9d4b4f387941cb2e1cfed10cd2c37d353..399730c6a776042209d02eef148eadef0348d089 100644 --- a/dune/common/test/Makefile.am +++ b/dune/common/test/Makefile.am @@ -15,10 +15,6 @@ TESTPROGS = \ iteratorfacadetest \ iteratorfacadetest2 \ lrutest \ - mpicollectivecommunication \ - mpiguardtest \ - mpihelpertest \ - mpihelpertest2 \ nullptr-test \ pathtest \ parametertreetest \ @@ -155,26 +151,6 @@ enumsettest_SOURCES=enumsettest.cc gcdlcmtest_SOURCES = gcdlcmtest.cc -mpihelpertest_SOURCES = mpihelpertest.cc -mpihelpertest_CPPFLAGS = $(AM_CPPFLAGS) $(DUNEMPICPPFLAGS) -mpihelpertest_LDADD = $(DUNEMPILIBS) $(LDADD) -mpihelpertest_LDFLAGS = $(AM_LDFLAGS) $(DUNEMPILDFLAGS) - -mpihelpertest2_SOURCES = mpihelpertest.cc -mpihelpertest2_CPPFLAGS = $(AM_CPPFLAGS) $(DUNEMPICPPFLAGS) -DMPIHELPER_PREINITIALIZE -mpihelpertest2_LDADD = $(DUNEMPILIBS) $(LDADD) -mpihelpertest2_LDFLAGS = $(AM_LDFLAGS) $(DUNEMPILDFLAGS) - -mpicollectivecommunication_SOURCES = mpicollectivecommunication.cc -mpicollectivecommunication_CPPFLAGS = $(AM_CPPFLAGS) $(DUNEMPICPPFLAGS) -mpicollectivecommunication_LDADD = $(DUNEMPILIBS) $(LDADD) -mpicollectivecommunication_LDFLAGS = $(AM_LDFLAGS) $(DUNEMPILDFLAGS) - -mpiguardtest_SOURCES = mpiguardtest.cc -mpiguardtest_CPPFLAGS = $(AM_CPPFLAGS) $(DUNEMPICPPFLAGS) -mpiguardtest_LDADD = $(DUNEMPILIBS) $(LDADD) -mpiguardtest_LDFLAGS = $(AM_LDFLAGS) $(DUNEMPILDFLAGS) - singletontest_SOURCES = singletontest.cc utilitytest_SOURCES = utilitytest.cc diff --git a/dune/common/test/lrutest.cc b/dune/common/test/lrutest.cc index 10c21280d714b8b2e6766a156024f608d75670e6..d34dccea2b4f6a5986062a5393da3b4998f7eda7 100644 --- a/dune/common/test/lrutest.cc +++ b/dune/common/test/lrutest.cc @@ -3,7 +3,7 @@ #include <assert.h> #include <iostream> #include <dune/common/lru.hh> -#include <dune/common/mpihelper.hh> +#include <dune/common/parallel/mpihelper.hh> void lru_test() {