From dc8f0fc270012baf4b1e69770471c67ee0410a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Kl=C3=B6fkorn?= <robertk@mathematik.uni-stuttgart.de> Date: Mon, 5 Jul 2010 14:21:03 +0000 Subject: [PATCH] sizes also parallel. git-svn-id: https://dune.mathematik.uni-freiburg.de/svn/alugrid/trunk@1286 0d966ed9-3843-0410-af09-ebfb50bd7c74 --- misc/examples/Makefile.am | 3 ++- misc/examples/sizes.cc | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/misc/examples/Makefile.am b/misc/examples/Makefile.am index c4677acd8..2ec837559 100644 --- a/misc/examples/Makefile.am +++ b/misc/examples/Makefile.am @@ -10,11 +10,12 @@ CXX=mpiCC # work arround for automake versions < 1.8 SOURCE_DIR=../../src AM_CPPFLAGS = $(ALL_PKG_CPPFLAGS) $(MPI_CPPFLAGS) -I$(SOURCE_DIR) -I$(SOURCE_DIR)/serial -I$(SOURCE_DIR)/parallel -I$(SOURCE_DIR)/duneinterface +LDADD = $(PARTY_LDFLAGS) $(PARTY_LIBS) $(PARMETIS_LDFLAGS) $(PARMETIS_LIBS) $(METIS_LDFLAGS) $(METIS_LIBS) # headers to install noinst_PROGRAMS = loadlb sizes # example sizes # adapt #example_SOURCES = example.cc $(SOURCE_DIR)/alugrid_serial.cc -sizes_SOURCES = sizes.cc $(SOURCE_DIR)/alugrid_serial.cc +sizes_SOURCES = sizes.cc $(SOURCE_DIR)/alugrid_serial.cc $(SOURCE_DIR)/alugrid_parallel.cc #adapt_SOURCES = adapt.cc $(SOURCE_DIR)/alugrid_2d.cc $(SOURCE_DIR)/alugrid_serial.cc loadlb_SOURCES = loadlb.cc $(SOURCE_DIR)/alugrid_serial.cc $(SOURCE_DIR)/alugrid_parallel.cc loadlb_LDADD = $(PARTY_LDFLAGS) $(PARTY_LIBS) $(PARMETIS_LDFLAGS) $(PARMETIS_LIBS) $(METIS_LDFLAGS) $(METIS_LIBS) diff --git a/misc/examples/sizes.cc b/misc/examples/sizes.cc index 9a6c0565a..a2b36ea79 100644 --- a/misc/examples/sizes.cc +++ b/misc/examples/sizes.cc @@ -8,17 +8,20 @@ // //*********************************************************************** #include <iostream> +#include <mpi.h> + using namespace std; //#define DONT_USE_ALUGRID_ALLOC // include serial part of ALUGrid -#include <alugrid_serial.h> -//#include <alugrid_parallel.h> +//#include <alugrid_serial.h> +#include <alugrid_parallel.h> using namespace ALUGridSpace; // refine grid globally, i.e. mark all elements and then call adapt -void globalRefine(GitterBasisImpl* grid, int refcount) { +template <class GitterType> +void globalRefine(GitterType* grid, int refcount) { for (int count=refcount ; count > 0; count--) { cout << "Refine global: run " << refcount-count << endl; @@ -84,7 +87,7 @@ void levelwalk(GitterBasisImpl* grid, int level) { // exmaple on read grid, refine global and print again int main (int argc, char ** argv, const char ** envp) { - //MPI_Init(&argc,&argv); + MPI_Init(&argc,&argv); int mxl = 0; if (argc < 2) @@ -105,9 +108,9 @@ int main (int argc, char ** argv, const char ** envp) cout << "-----------------------------------------------\n"; { - //MpAccessMPI a (MPI_COMM_WORLD); - //GitterDunePll grid(macroname.c_str(),a); - GitterDuneImpl grid(macroname.c_str()); + MpAccessMPI a (MPI_COMM_WORLD); + GitterDunePll grid(macroname.c_str(),a); + //GitterDuneImpl grid(macroname.c_str()); cout << "Grid generated! \n"; grid.printsize(); @@ -122,7 +125,7 @@ int main (int argc, char ** argv, const char ** envp) cin.get(); } - //MPI_Finalize(); + MPI_Finalize(); return 0; } -- GitLab