Commit aee5a801 authored by Thomas Witkowski's avatar Thomas Witkowski

Zoltan is now optional.

parent 479286fc
......@@ -111,8 +111,6 @@ ENABLE_MKL_FALSE = @ENABLE_MKL_FALSE@
ENABLE_MKL_TRUE = @ENABLE_MKL_TRUE@
ENABLE_UMFPACK_FALSE = @ENABLE_UMFPACK_FALSE@
ENABLE_UMFPACK_TRUE = @ENABLE_UMFPACK_TRUE@
ENABLE_ZOLTAN_FALSE = @ENABLE_ZOLTAN_FALSE@
ENABLE_ZOLTAN_TRUE = @ENABLE_ZOLTAN_TRUE@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
......@@ -149,7 +147,10 @@ USE_PARALLEL_AMDIS_FALSE = @USE_PARALLEL_AMDIS_FALSE@
USE_PARALLEL_AMDIS_TRUE = @USE_PARALLEL_AMDIS_TRUE@
USE_PARALLEL_DOMAIN_AMDIS_FALSE = @USE_PARALLEL_DOMAIN_AMDIS_FALSE@
USE_PARALLEL_DOMAIN_AMDIS_TRUE = @USE_PARALLEL_DOMAIN_AMDIS_TRUE@
USE_ZOLTAN_FALSE = @USE_ZOLTAN_FALSE@
USE_ZOLTAN_TRUE = @USE_ZOLTAN_TRUE@
VERSION = @VERSION@
ZOLTAN_DIR = @ZOLTAN_DIR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
......
This diff is collapsed.
......@@ -66,6 +66,10 @@ if test $marmot != false ; then
AC_SUBST(CC, marmotcc)
fi
AC_ARG_WITH(zoltan, [ --with-zoltan=ZOLTAN_DIR], zoltandir=$withval, petscdir=no)
AC_SUBST(ZOLTAN_DIR, $zoltandir)
AM_CONDITIONAL(USE_ZOLTAN, test $zoltandir != no)
AC_ARG_WITH(petsc, [ --with-petsc=PETSC_DIR], petscdir=$withval, petscdir=no)
AC_SUBST(PETSC_DIR, $petscdir)
......@@ -86,7 +90,6 @@ AC_ARG_ENABLE(parallel-domain,
*) AC_MSG_ERROR(bad value${enableval} for --enable-parallel-domain) ;;
esac],[paralleldomain=false])
AM_CONDITIONAL(USE_PARALLEL_DOMAIN_AMDIS, test $paralleldomain = true)
AM_CONDITIONAL(ENABLE_ZOLTAN, test $paralleldomain = true)
AC_ARG_ENABLE(umfpack,
[ --enable-umfpack Compile with the UMFPACK direct solver library],
......
......@@ -44,7 +44,7 @@ available_tags=" CXX F77"
# ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host deimos103:
# Libtool was configured on host deimos101:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
......@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
# End:
# ### BEGIN LIBTOOL TAG CONFIG: CXX
# Libtool was configured on host deimos103:
# Libtool was configured on host deimos101:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
......@@ -7065,7 +7065,7 @@ include_expsyms=""
# ### BEGIN LIBTOOL TAG CONFIG: F77
# Libtool was configured on host deimos103:
# Libtool was configured on host deimos101:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
......
......@@ -22,14 +22,19 @@ if USE_PARALLEL_DOMAIN_AMDIS
parallel/ParMetisPartitioner.cc \
parallel/PetscSolver.cc \
parallel/PetscSolverSchur.cc \
parallel/StdMpi.cc \
parallel/ZoltanPartitioner.cc
parallel/StdMpi.cc
libamdis_la_CXXFLAGS += -DHAVE_PARALLEL_DOMAIN_AMDIS=1
AMDIS_INCLUDES += -I$(PARMETIS_DIR)
AMDIS_INCLUDES += -I$(PETSC_DIR)/include -I$(PETSC_DIR)/$(PETSC_ARCH)/include
AMDIS_INCLUDES += -I$(LIB_DIR)/zoltan_build/include
endif
if USE_ZOLTAN
libamdis_la_CXXFLAGS += -DHAVE_ZOLTAN
PARALLEL_AMDIS_SOURCES += parallel/ZoltanPartitioner.cc
endif
if ENABLE_UMFPACK
libamdis_la_CXXFLAGS += -DHAVE_UMFPACK=1 -DMTL_HAS_UMFPACK
AMDIS_INCLUDES += -I$(LIB_DIR)/UFconfig \
......
......@@ -48,25 +48,26 @@ host_triplet = @host@
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ parallel/ParMetisPartitioner.cc \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ parallel/PetscSolver.cc \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ parallel/PetscSolverSchur.cc \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ parallel/StdMpi.cc \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ parallel/ZoltanPartitioner.cc
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ parallel/StdMpi.cc
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@am__append_2 = -DHAVE_PARALLEL_DOMAIN_AMDIS=1
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@am__append_3 = -I$(PARMETIS_DIR) \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ -I$(PETSC_DIR)/include \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ -I$(PETSC_DIR)/$(PETSC_ARCH)/include \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ -I$(LIB_DIR)/zoltan_build/include
@ENABLE_UMFPACK_TRUE@am__append_4 = -DHAVE_UMFPACK=1 -DMTL_HAS_UMFPACK
@ENABLE_UMFPACK_TRUE@am__append_5 = -I$(LIB_DIR)/UFconfig \
@USE_ZOLTAN_TRUE@am__append_4 = -DHAVE_ZOLTAN
@USE_ZOLTAN_TRUE@am__append_5 = parallel/ZoltanPartitioner.cc
@ENABLE_UMFPACK_TRUE@am__append_6 = -DHAVE_UMFPACK=1 -DMTL_HAS_UMFPACK
@ENABLE_UMFPACK_TRUE@am__append_7 = -I$(LIB_DIR)/UFconfig \
@ENABLE_UMFPACK_TRUE@ -I$(LIB_DIR)/AMD/Include \
@ENABLE_UMFPACK_TRUE@ -I$(LIB_DIR)/UMFPACK/Include
@ENABLE_MKL_TRUE@am__append_6 = -DHAVE_MKL=1 -I${MKL_INC}
@ENABLE_DUNE_TRUE@am__append_7 = -DHAVE_DUNE=1
@ENABLE_DUNE_TRUE@am__append_8 = -I$(DUNE_DIR)
@ENABLE_BOOST_TRUE@am__append_9 = -DHAVE_BOOST=1
@AMDIS_DEBUG_TRUE@am__append_10 = -g -O0 -Wall -DDEBUG=1 $(OPENMP_FLAG) $(INCLUDES) #-pedantic
@AMDIS_DEBUG_FALSE@am__append_11 = -O3 -Wall -DDEBUG=0 -DNDEBUG $(OPENMP_FLAG) -ftemplate-depth-100 $(INCLUDES) #-pedantic
@ENABLE_MKL_TRUE@am__append_8 = -DHAVE_MKL=1 -I${MKL_INC}
@ENABLE_DUNE_TRUE@am__append_9 = -DHAVE_DUNE=1
@ENABLE_DUNE_TRUE@am__append_10 = -I$(DUNE_DIR)
@ENABLE_BOOST_TRUE@am__append_11 = -DHAVE_BOOST=1
@AMDIS_DEBUG_TRUE@am__append_12 = -g -O0 -Wall -DDEBUG=1 $(OPENMP_FLAG) $(INCLUDES) #-pedantic
@AMDIS_DEBUG_FALSE@am__append_13 = -O3 -Wall -DDEBUG=0 -DNDEBUG $(OPENMP_FLAG) -ftemplate-depth-100 $(INCLUDES) #-pedantic
subdir = src
DIST_COMMON = $(nobase_include_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in AUTHORS NEWS
......@@ -138,10 +139,10 @@ am__libamdis_la_SOURCES_DIST = parallel/ElementObjectData.cc \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ libamdis_la-ParMetisPartitioner.lo \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ libamdis_la-PetscSolver.lo \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ libamdis_la-PetscSolverSchur.lo \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ libamdis_la-StdMpi.lo \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ libamdis_la-ZoltanPartitioner.lo
am__objects_2 = $(am__objects_1)
am_libamdis_la_OBJECTS = $(am__objects_2) libamdis_la-AdaptBase.lo \
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@ libamdis_la-StdMpi.lo
@USE_ZOLTAN_TRUE@am__objects_2 = libamdis_la-ZoltanPartitioner.lo
am__objects_3 = $(am__objects_1) $(am__objects_2)
am_libamdis_la_OBJECTS = $(am__objects_3) libamdis_la-AdaptBase.lo \
libamdis_la-AdaptInfo.lo libamdis_la-AdaptInstationary.lo \
libamdis_la-AdaptStationary.lo libamdis_la-Assembler.lo \
libamdis_la-BasisFunction.lo libamdis_la-Boundary.lo \
......@@ -291,8 +292,6 @@ ENABLE_MKL_FALSE = @ENABLE_MKL_FALSE@
ENABLE_MKL_TRUE = @ENABLE_MKL_TRUE@
ENABLE_UMFPACK_FALSE = @ENABLE_UMFPACK_FALSE@
ENABLE_UMFPACK_TRUE = @ENABLE_UMFPACK_TRUE@
ENABLE_ZOLTAN_FALSE = @ENABLE_ZOLTAN_FALSE@
ENABLE_ZOLTAN_TRUE = @ENABLE_ZOLTAN_TRUE@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
......@@ -329,7 +328,10 @@ USE_PARALLEL_AMDIS_FALSE = @USE_PARALLEL_AMDIS_FALSE@
USE_PARALLEL_AMDIS_TRUE = @USE_PARALLEL_AMDIS_TRUE@
USE_PARALLEL_DOMAIN_AMDIS_FALSE = @USE_PARALLEL_DOMAIN_AMDIS_FALSE@
USE_PARALLEL_DOMAIN_AMDIS_TRUE = @USE_PARALLEL_DOMAIN_AMDIS_TRUE@
USE_ZOLTAN_FALSE = @USE_ZOLTAN_FALSE@
USE_ZOLTAN_TRUE = @USE_ZOLTAN_TRUE@
VERSION = @VERSION@
ZOLTAN_DIR = @ZOLTAN_DIR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
......@@ -377,11 +379,11 @@ lib_LTLIBRARIES = libamdis.la libcompositeFEM.la libreinit.la
LIB_DIR = ../lib
PARALLEL_DIR = $(SOURCE_DIR)
PARMETIS_DIR = ../lib/ParMetis-3.1
AMDIS_INCLUDES = $(am__append_3) $(am__append_5) $(am__append_8)
AMDIS_INCLUDES = $(am__append_3) $(am__append_7) $(am__append_10)
libamdis_la_CXXFLAGS = $(am__append_2) $(am__append_4) $(am__append_6) \
$(am__append_7) $(am__append_9) $(am__append_10) \
$(am__append_11)
PARALLEL_AMDIS_SOURCES = $(am__append_1)
$(am__append_8) $(am__append_9) $(am__append_11) \
$(am__append_12) $(am__append_13)
PARALLEL_AMDIS_SOURCES = $(am__append_1) $(am__append_5)
PARALLEL_INCLUDES =
TEMPLATE_INCLUDES = -I../lib/mtl4
INCLUDES = $(AMDIS_INCLUDES) $(PARALLEL_INCLUDES) $(TEMPLATE_INCLUDES)
......
......@@ -17,7 +17,6 @@
#include <stdint.h>
#include <boost/lexical_cast.hpp>
#include <boost/filesystem.hpp>
#include <zoltan_cpp.h>
#include "parallel/MeshDistributor.h"
#include "parallel/MeshManipulation.h"
......@@ -104,8 +103,13 @@ namespace AMDiS {
if (partStr == "parmetis")
partitioner = new ParMetisPartitioner(&mpiComm);
if (partStr == "zoltan")
if (partStr == "zoltan") {
#ifdef HAVE_ZOLTAN
partitioner = new ZoltanPartitioner(&mpiComm);
#else
ERROR_EXIT("AMDiS was compiled without Zoltan support. There you cannot make use of it!\n");
#endif
}
if (partStr == "simple")
partitioner = new SimplePartitioner(&mpiComm);
......@@ -128,10 +132,12 @@ namespace AMDiS {
TEST_EXIT(feSpace)("No FE space has been defined for the mesh distributor!\n");
TEST_EXIT(mesh)("No mesh has been defined for the mesh distributor!\n");
#ifdef HAVE_ZOLTAN
int a = 0;
char *b = NULL;
float zoltanVersion = 0.0;
Zoltan_Initialize(a, &b, &zoltanVersion);
#endif
elObjects.setFeSpace(feSpace);
......
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.
#include <vector>
#include <set>
#include "parallel/PetscSolverSchur.h"
namespace AMDiS {
void PetscSolverSchur::providePetscSolver(KSP &solver, PC &pc)
{
FUNCNAME("PetscSolver::providePetscSolver()");
typedef map<int, DofContainer> RankToDofContainer;
typedef map<DegreeOfFreedom, bool> DofIndexToBool;
std::set<DegreeOfFreedom> boundaryDofsSet;
std::set<DegreeOfFreedom> boundaryLocalDofs;
RankToDofContainer& sendDofs = meshDistributor->getSendDofs();
for (RankToDofContainer::iterator rankIt = sendDofs.begin();
rankIt != sendDofs.end(); ++rankIt)
for (DofContainer::iterator dofIt = rankIt->second.begin();
dofIt != rankIt->second.end(); ++dofIt) {
boundaryLocalDofs.insert(**dofIt);
for (int i = 0; i < nComponents; i++)
boundaryDofsSet.insert(meshDistributor->mapLocalToGlobal(**dofIt) * nComponents + i);
}
vector<DegreeOfFreedom> boundaryDofs(boundaryDofsSet.begin(),
boundaryDofsSet.end());
std::set<DegreeOfFreedom> otherBoundaryLocalDofs;
RankToDofContainer& recvDofs = meshDistributor->getRecvDofs();
for (RankToDofContainer::iterator rankIt = recvDofs.begin();
rankIt != recvDofs.end(); ++rankIt)
for (DofContainer::iterator dofIt = rankIt->second.begin();
dofIt != rankIt->second.end(); ++dofIt)
otherBoundaryLocalDofs.insert(**dofIt);
std::set<DegreeOfFreedom> interiorDofsSet;
DofIndexToBool& isRankDof = meshDistributor->getIsRankDof();
for (DofIndexToBool::iterator dofIt = isRankDof.begin();
dofIt != isRankDof.end(); ++dofIt)
if (dofIt->second &&
boundaryLocalDofs.count(dofIt->first) == 0 &&
otherBoundaryLocalDofs.count(dofIt->first) == 0)
for (int i = 0; i < nComponents; i++)
interiorDofsSet.insert(meshDistributor->mapLocalToGlobal(dofIt->first) * nComponents + i);
vector<DegreeOfFreedom> interiorDofs(interiorDofsSet.begin(),
interiorDofsSet.end());
IS interiorIs;
ISCreateGeneral(PETSC_COMM_WORLD, interiorDofs.size(), &(interiorDofs[0]),
PETSC_COPY_VALUES, &interiorIs);
PCFieldSplitSetIS(pc, "interior", interiorIs);
IS boundaryIs;
ISCreateGeneral(PETSC_COMM_WORLD, boundaryDofs.size(), &(boundaryDofs[0]),
PETSC_COPY_VALUES, &boundaryIs);
PCFieldSplitSetIS(pc, "boundary", boundaryIs);
KSPCreate(PETSC_COMM_WORLD, &solver);
KSPGetPC(solver, &pc);
PCSetType(pc, PCFIELDSPLIT);
KSPSetOperators(solver, petscMatrix, petscMatrix, SAME_NONZERO_PATTERN);
KSPSetTolerances(solver, 0.0, 1e-8, PETSC_DEFAULT, PETSC_DEFAULT);
KSPSetFromOptions(solver);
PCSetFromOptions(pc);
}
}
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// == http://www.amdis-fem.org ==
// == ==
// ============================================================================
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.
/** \file PetscSolver.h */
#ifndef AMDIS_PETSC_SOLVER_SCHUR_H
#define AMDIS_PETSC_SOLVER_SCHUR_H
#include "AMDiS_fwd.h"
#include "PetscSolver.h"
namespace AMDiS {
class PetscSolverSchur : public PetscSolver
{
public:
PetscSolverSchur(std::string nameStr,
ProblemIterationInterface *problemIteration = NULL)
: PetscSolver(nameStr, problemIteration)
{}
~PetscSolverSchur()
{}
private:
/// Creates the fieldsplit preconditioner to solve the Schur complement system.
void providePetscSolver(KSP &solver, PC &pc);
};
} //namespace AMDiS
#endif
......@@ -23,6 +23,8 @@
#ifndef AMDIS_ZOLTAN_PARTITIONER_H
#define AMDIS_ZOLTAN_PARTITIONER_H
#ifdef HAVE_ZOLTAN
#include <zoltan_cpp.h>
#include <set>
#include "AMDiS_fwd.h"
......@@ -163,4 +165,6 @@ namespace AMDiS {
}
#endif // HAVE_ZOLTAN
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment