Commit 90357cd5 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Added flags for compiling with Intel C++ compiler. Fixed some real compiler warnings.

parent 27235c55
...@@ -31,7 +31,11 @@ if(CMAKE_BUILD_TYPE STREQUAL "") ...@@ -31,7 +31,11 @@ if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")
endif() endif()
#option(ENABLE_INTEL "use intel compiler" false) if(CMAKE_CXX_COMPILER MATCHES ".*icpc")
Message("Compiler: Intel")
set(CMAKE_CXX_FLAGS "-diag-disable 654 -diag-disable 858")
endif()
SET(ENABLE_PARALLEL_DOMAIN "OFF" CACHE STRING "use parallel domain decomposition. please set to one of: PMTL, PETSC, OFF" ) SET(ENABLE_PARALLEL_DOMAIN "OFF" CACHE STRING "use parallel domain decomposition. please set to one of: PMTL, PETSC, OFF" )
option(USE_PETSC_DEV false) option(USE_PETSC_DEV false)
option(ENABLE_ZOLTAN false) option(ENABLE_ZOLTAN false)
...@@ -39,15 +43,6 @@ option(ENABLE_UMFPACK "Use of UMFPACK solver" false) ...@@ -39,15 +43,6 @@ option(ENABLE_UMFPACK "Use of UMFPACK solver" false)
option(ENABLE_PNG "use png reader/writer" false) option(ENABLE_PNG "use png reader/writer" false)
option(ENABLE_BDDCML "Use of BDDCML library" false) option(ENABLE_BDDCML "Use of BDDCML library" false)
if(ENABLE_INTEL)
Message("please set the icc manually")
INCLUDE (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(icc "intel C compiler")
CMAKE_FORCE_CXX_COMPILER(icpc "intel C++ compiler")
#SET(CMAKE_C_COMPILER "icc")
endif(ENABLE_INTEL)
find_package(Boost 1.42 REQUIRED) find_package(Boost 1.42 REQUIRED)
if(Boost_FOUND) if(Boost_FOUND)
list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
......
...@@ -262,12 +262,14 @@ namespace AMDiS { ...@@ -262,12 +262,14 @@ namespace AMDiS {
inserter= 0; inserter= 0;
} }
#if 0
/// Returns whether restriction should be performed after coarsening /// Returns whether restriction should be performed after coarsening
/// (false by default) /// (false by default)
virtual bool coarseRestrict() virtual bool coarseRestrict()
{ {
return false; return false;
} }
#endif
/// Returns const \ref rowFeSpace /// Returns const \ref rowFeSpace
const FiniteElemSpace* getRowFeSpace() const const FiniteElemSpace* getRowFeSpace() const
......
...@@ -93,7 +93,8 @@ namespace AMDiS { ...@@ -93,7 +93,8 @@ namespace AMDiS {
} }
/// Implementation of ProblemTimeInterface::closeTimestep(). /// Implementation of ProblemTimeInterface::closeTimestep().
virtual void closeTimestep() {} virtual void closeTimestep(AdaptInfo *adaptInfo)
{}
/// Returns \ref name. /// Returns \ref name.
inline std::string getName() inline std::string getName()
......
...@@ -35,7 +35,7 @@ namespace AMDiS { ...@@ -35,7 +35,7 @@ namespace AMDiS {
} }
void ProblemInterpol::solve(AdaptInfo *adaptInfo) void ProblemInterpol::solve(AdaptInfo *adaptInfo, bool, bool)
{ {
int size = static_cast<int>(meshes.size()); int size = static_cast<int>(meshes.size());
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)
...@@ -45,7 +45,7 @@ namespace AMDiS { ...@@ -45,7 +45,7 @@ namespace AMDiS {
} }
void ProblemInterpol::estimate(AdaptInfo *adaptInfo, double) void ProblemInterpol::estimate(AdaptInfo *adaptInfo)
{ {
FUNCNAME("ProblemIterpolVec::estimate()"); FUNCNAME("ProblemIterpolVec::estimate()");
......
...@@ -50,13 +50,18 @@ namespace AMDiS { ...@@ -50,13 +50,18 @@ namespace AMDiS {
virtual void buildbeforeCoarsen(AdaptInfo *adaptInfo, Flag) {} virtual void buildbeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}
/// No system assemblage. /// No system assemblage.
virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag) {} virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag,
bool assembleMatrix = true,
bool assembleVector = true)
{}
/// No equation system ins solved. Instead fct is interpolated to uh. /// No equation system ins solved. Instead fct is interpolated to uh.
virtual void solve(AdaptInfo *adaptInfo); virtual void solve(AdaptInfo *adaptInfo,
bool createMatrixData = true,
bool storeMatrixData = false);
/// True H1 or L2 error is calculated. /// True H1 or L2 error is calculated.
virtual void estimate(AdaptInfo *adaptInfo, double); virtual void estimate(AdaptInfo *adaptInfo);
protected: protected:
/// Function to interpolate. /// Function to interpolate.
......
...@@ -31,7 +31,9 @@ namespace AMDiS { ...@@ -31,7 +31,9 @@ namespace AMDiS {
filename = fn; filename = fn;
} }
void GNUPlotWriter::writeFiles(AdaptInfo *adaptInfo, bool force)
void GNUPlotWriter::writeFiles(AdaptInfo *adaptInfo, bool force,
int, Flag, bool (*)(ElInfo*))
{ {
DOFVector<WorldVector<double> > coords(feSpace_, "coords"); DOFVector<WorldVector<double> > coords(feSpace_, "coords");
Mesh *mesh = feSpace_->getMesh(); Mesh *mesh = feSpace_->getMesh();
......
...@@ -43,7 +43,10 @@ namespace AMDiS { ...@@ -43,7 +43,10 @@ namespace AMDiS {
virtual ~GNUPlotWriter() {} virtual ~GNUPlotWriter() {}
/// ///
virtual void writeFiles(AdaptInfo *adaptInfo, bool force); virtual void writeFiles(AdaptInfo *adaptInfo, bool force,
int level = -1,
Flag traverseFlag = Mesh::CALL_LEAF_EL,
bool (*writeElem)(ElInfo*) = NULL);
protected: protected:
/// Contains the mesh /// Contains the mesh
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
namespace AMDiS { namespace AMDiS {
void ProblemNonLin::initialize(Flag initFlag, void ProblemNonLin::initialize(Flag initFlag,
ProblemStat *adoptProblem /*= NULL*/, ProblemStatSeq *adoptProblem /*= NULL*/,
Flag adoptFlag /*= INIT_NOTHING*/) Flag adoptFlag /*= INIT_NOTHING*/)
{ {
FUNCNAME("ProblemNonLin::initialize()"); FUNCNAME("ProblemNonLin::initialize()");
......
...@@ -77,7 +77,7 @@ namespace AMDiS { ...@@ -77,7 +77,7 @@ namespace AMDiS {
/// Initialization of the problem. /// Initialization of the problem.
virtual void initialize(Flag initFlag, virtual void initialize(Flag initFlag,
ProblemStat *adoptProblem = NULL, ProblemStatSeq *adoptProblem = NULL,
Flag adoptFlag = INIT_NOTHING); Flag adoptFlag = INIT_NOTHING);
/// Used in \ref initialize(). /// Used in \ref initialize().
......
...@@ -969,7 +969,7 @@ namespace AMDiS { ...@@ -969,7 +969,7 @@ namespace AMDiS {
// (static_cast<double>(maxDofs - avrgDofs) / avrgDofs) * 100.0; // (static_cast<double>(maxDofs - avrgDofs) / avrgDofs) * 100.0;
double imbalance1 = (static_cast<double>(maxDofs) / minDofs - 1.0) * 100.0; double imbalance1 = (static_cast<double>(maxDofs) / minDofs - 1.0) * 100.0;
MSG("Imbalancing factor: %.1f\%\n", imbalance1); MSG("Imbalancing factor: %.1f\n", imbalance1);
} }
} }
...@@ -2264,7 +2264,7 @@ namespace AMDiS { ...@@ -2264,7 +2264,7 @@ namespace AMDiS {
{ {
FUNCNAME("MeshDistributor::mapGlobalToLocal()"); FUNCNAME("MeshDistributor::mapGlobalToLocal()");
for (map<DegreeOfFreedom, MultiIndex>::iterator it = dofMap[feSpace].getMap().begin(); for (DofMap::iterator it = dofMap[feSpace].getMap().begin();
it != dofMap[feSpace].getMap().end(); ++it) it != dofMap[feSpace].getMap().end(); ++it)
if (it->second.global == dof) if (it->second.global == dof)
return it->first; return it->first;
......
...@@ -225,6 +225,12 @@ namespace AMDiS { ...@@ -225,6 +225,12 @@ namespace AMDiS {
return dofMap[feSpace][dof].local; return dofMap[feSpace][dof].local;
} }
/// Returns the DOF mapping object, \ref dofMap.
inline ParallelDofMapping& getDofMap()
{
return dofMap;
}
/// Returns the periodic mapping handler, \ref periodicMap. /// Returns the periodic mapping handler, \ref periodicMap.
inline PeriodicMap& getPeriodicMap() inline PeriodicMap& getPeriodicMap()
{ {
...@@ -555,6 +561,7 @@ namespace AMDiS { ...@@ -555,6 +561,7 @@ namespace AMDiS {
/// macro element. /// macro element.
map<int, int> partitionMap; map<int, int> partitionMap;
/// Mapping object to map from local DOF indices to global ones.
ParallelDofMapping dofMap; ParallelDofMapping dofMap;
/// Database to store and query all sub-objects of all elements of the /// Database to store and query all sub-objects of all elements of the
......
...@@ -107,11 +107,7 @@ namespace AMDiS { ...@@ -107,11 +107,7 @@ namespace AMDiS {
boxPartitioning = b; boxPartitioning = b;
} }
#if 0 void setLocalGlobalDofMap(DofMap *m)
void setLocalGlobalDofMap(map<DegreeOfFreedom, DegreeOfFreedom> *m)
#else
void setLocalGlobalDofMap(map<DegreeOfFreedom, MultiIndex> *m)
#endif
{ {
mapLocalGlobal = m; mapLocalGlobal = m;
} }
...@@ -173,7 +169,7 @@ namespace AMDiS { ...@@ -173,7 +169,7 @@ namespace AMDiS {
/// macro element index the box number it belongs to. /// macro element index the box number it belongs to.
map<int, int> elInBox; map<int, int> elInBox;
map<DegreeOfFreedom, MultiIndex> *mapLocalGlobal; DofMap *mapLocalGlobal;
map<int, vector<int> > elNeighbours; map<int, vector<int> > elNeighbours;
......
...@@ -29,7 +29,7 @@ namespace AMDiS { ...@@ -29,7 +29,7 @@ namespace AMDiS {
ParMetisMesh::ParMetisMesh(Mesh *mesh, MPI::Intracomm *comm, ParMetisMesh::ParMetisMesh(Mesh *mesh, MPI::Intracomm *comm,
std::map<int, bool>& elementInRank, std::map<int, bool>& elementInRank,
map<DegreeOfFreedom, MultiIndex> *mapLocalGlobal) DofMap *mapLocalGlobal)
: dim(mesh->getDim()), : dim(mesh->getDim()),
nElements(0), nElements(0),
mpiComm(comm) mpiComm(comm)
......
...@@ -44,7 +44,7 @@ namespace AMDiS { ...@@ -44,7 +44,7 @@ namespace AMDiS {
public: public:
ParMetisMesh(Mesh *mesh, MPI::Intracomm *comm, ParMetisMesh(Mesh *mesh, MPI::Intracomm *comm,
map<int, bool>& elementInRank, map<int, bool>& elementInRank,
map<DegreeOfFreedom, MultiIndex> *mapLocalGlobal); DofMap *mapLocalGlobal);
~ParMetisMesh(); ~ParMetisMesh();
......
...@@ -640,20 +640,21 @@ namespace AMDiS { ...@@ -640,20 +640,21 @@ namespace AMDiS {
cout << "====== DOF MAP LOCAL -> GLOBAL ====== " << endl; cout << "====== DOF MAP LOCAL -> GLOBAL ====== " << endl;
map<DegreeOfFreedom, MultiIndex> &dofMap = pdb.dofMap[feSpace].getMap(); DofMap &dofMap = pdb.dofMap[feSpace].getMap();
for (map<DegreeOfFreedom, MultiIndex>::iterator it = dofMap.begin(); for (DofMap::iterator it = dofMap.begin(); it != dofMap.end(); ++it) {
it != dofMap.end(); ++it) {
cout << "DOF " << it->first << " " << it->second.global << "\n"; cout << "DOF " << it->first << " " << it->second.global << "\n";
WorldVector<double> coords; WorldVector<double> coords;
pdb.mesh->getDofIndexCoords(it->first, feSpace, coords); pdb.mesh->getDofIndexCoords(it->first, feSpace, coords);
coords.print(); coords.print();
for (DofComm::Iterator rit(pdb.sendDofs, feSpace); !rit.end(); rit.nextRank()) for (DofComm::Iterator rit(pdb.sendDofs, feSpace);
!rit.end(); rit.nextRank())
for (; !rit.endDofIter(); rit.nextDof()) for (; !rit.endDofIter(); rit.nextDof())
if (it->first == rit.getDofIndex()) if (it->first == rit.getDofIndex())
cout << "SEND DOF TO " << rit.getRank() << endl; cout << "SEND DOF TO " << rit.getRank() << endl;
for (DofComm::Iterator rit(pdb.recvDofs, feSpace); !rit.end(); rit.nextRank()) for (DofComm::Iterator rit(pdb.recvDofs, feSpace);
!rit.end(); rit.nextRank())
for (; !rit.endDofIter(); rit.nextDof()) for (; !rit.endDofIter(); rit.nextDof())
if (it->first == rit.getDofIndex()) if (it->first == rit.getDofIndex())
cout << "RECV DOF FROM " << rit.getRank() << endl; cout << "RECV DOF FROM " << rit.getRank() << endl;
......
...@@ -32,7 +32,7 @@ namespace AMDiS { ...@@ -32,7 +32,7 @@ namespace AMDiS {
{ {
// === Compute local indices for all rank owned DOFs. === // === Compute local indices for all rank owned DOFs. ===
for (map<DegreeOfFreedom, MultiIndex>::iterator it = dofMap.begin(); it != dofMap.end(); ++it) for (DofMap::iterator it = dofMap.begin(); it != dofMap.end(); ++it)
if (it->second.local == -1 && nonRankDofs.count(it->first) == 0) if (it->second.local == -1 && nonRankDofs.count(it->first) == 0)
it->second.local = nRankDofs++; it->second.local = nRankDofs++;
...@@ -55,7 +55,7 @@ namespace AMDiS { ...@@ -55,7 +55,7 @@ namespace AMDiS {
void FeSpaceDofMap::computeGlobalMapping() void FeSpaceDofMap::computeGlobalMapping()
{ {
for (map<DegreeOfFreedom, MultiIndex>::iterator it = dofMap.begin(); it != dofMap.end(); ++it) for (DofMap::iterator it = dofMap.begin(); it != dofMap.end(); ++it)
it->second.global = it->second.local + rStartDofs; it->second.global = it->second.local + rStartDofs;
} }
...@@ -256,6 +256,21 @@ namespace AMDiS { ...@@ -256,6 +256,21 @@ namespace AMDiS {
} }
void ParallelDofMapping::update(vector<const FiniteElemSpace*>& fe)
{
FUNCNAME("ParallelDofMapping::update()");
for (vector<const FiniteElemSpace*>::iterator it = fe.begin();
it != fe.end(); ++it)
if (find(feSpacesUnique.begin(), feSpacesUnique.end(), *it) ==
feSpacesUnique.end())
ERROR_EXIT("Wrong FE space!\n");
feSpaces = fe;
update();
}
void ParallelDofMapping::computeMatIndex() void ParallelDofMapping::computeMatIndex()
{ {
FUNCNAME("ParallelDofMapping::computeMatIndex()"); FUNCNAME("ParallelDofMapping::computeMatIndex()");
...@@ -274,9 +289,8 @@ namespace AMDiS { ...@@ -274,9 +289,8 @@ namespace AMDiS {
// Traverse all DOFs of the FE space and create for all rank owned DOFs // Traverse all DOFs of the FE space and create for all rank owned DOFs
// a matrix index. // a matrix index.
map<DegreeOfFreedom, MultiIndex>& dofMap = data[feSpaces[i]].getMap(); DofMap& dofMap = data[feSpaces[i]].getMap();
typedef map<DegreeOfFreedom, MultiIndex>::iterator ItType; for (DofMap::iterator it = dofMap.begin(); it != dofMap.end(); ++it) {
for (ItType it = dofMap.begin(); it != dofMap.end(); ++it) {
if (data[feSpaces[i]].isRankDof(it->first)) { if (data[feSpaces[i]].isRankDof(it->first)) {
int globalMatIndex = it->second.local + offset; int globalMatIndex = it->second.local + offset;
dofToMatIndex.add(i, it->first, globalMatIndex); dofToMatIndex.add(i, it->first, globalMatIndex);
......
...@@ -35,14 +35,6 @@ namespace AMDiS { ...@@ -35,14 +35,6 @@ namespace AMDiS {
using namespace std; using namespace std;
/// Is used if a DOF index is mapped to multiple indices, i.e., to both, a local
/// and a global one.
struct MultiIndex
{
int local, global;
};
/** \brief /** \brief
* Is used to store matrix indices to all DOFs in rank's subdomain. Thus, the * Is used to store matrix indices to all DOFs in rank's subdomain. Thus, the
* class defines a mapping from component number and DOF index to a global * class defines a mapping from component number and DOF index to a global
...@@ -183,7 +175,7 @@ namespace AMDiS { ...@@ -183,7 +175,7 @@ namespace AMDiS {
} }
/// Returns the raw data of the mapping. /// Returns the raw data of the mapping.
map<DegreeOfFreedom, MultiIndex>& getMap() DofMap& getMap()
{ {
return dofMap; return dofMap;
} }
...@@ -237,7 +229,7 @@ namespace AMDiS { ...@@ -237,7 +229,7 @@ namespace AMDiS {
const FiniteElemSpace *feSpace; const FiniteElemSpace *feSpace;
/// Mapping data from DOF indices to local and global indices. /// Mapping data from DOF indices to local and global indices.
map<DegreeOfFreedom, MultiIndex> dofMap; DofMap dofMap;
/// Set of all DOFs that are in mapping but are not owned by the rank. /// Set of all DOFs that are in mapping but are not owned by the rank.
std::set<DegreeOfFreedom> nonRankDofs; std::set<DegreeOfFreedom> nonRankDofs;
...@@ -348,6 +340,9 @@ namespace AMDiS { ...@@ -348,6 +340,9 @@ namespace AMDiS {
/// Update the mapping. /// Update the mapping.
void update(); void update();
/// Update the mapping.
void update(vector<const FiniteElemSpace*>& feSpaces);
/// Returns the global matrix index of a given DOF for a given /// Returns the global matrix index of a given DOF for a given
/// component number. /// component number.
inline int getMatIndex(int ithComponent, DegreeOfFreedom d) inline int getMatIndex(int ithComponent, DegreeOfFreedom d)
......
...@@ -70,6 +70,14 @@ namespace AMDiS { ...@@ -70,6 +70,14 @@ namespace AMDiS {
/// need to have a periodic DOF mapping for each FE space. /// need to have a periodic DOF mapping for each FE space.
typedef std::map<const FiniteElemSpace*, PeriodicDofMap> PeriodicDofMapFeSpace; typedef std::map<const FiniteElemSpace*, PeriodicDofMap> PeriodicDofMapFeSpace;
/// Is used if a DOF index is mapped to multiple indices, i.e., to both, a local
/// and a global one.
struct MultiIndex
{
int local, global;
};
typedef std::map<DegreeOfFreedom, MultiIndex> DofMap;
typedef vector<MeshStructure> MeshCodeVec; typedef vector<MeshStructure> MeshCodeVec;
} }
......
...@@ -20,6 +20,7 @@ namespace AMDiS { ...@@ -20,6 +20,7 @@ namespace AMDiS {
PetscSolver::PetscSolver() PetscSolver::PetscSolver()
: meshDistributor(NULL), : meshDistributor(NULL),
dofMap(NULL),
mpiRank(-1), mpiRank(-1),
kspPrefix(""), kspPrefix(""),
removeRhsNullSpace(false) removeRhsNullSpace(false)
......
...@@ -53,6 +53,7 @@ namespace AMDiS { ...@@ -53,6 +53,7 @@ namespace AMDiS {
void setMeshDistributor(MeshDistributor *m) void setMeshDistributor(MeshDistributor *m)
{ {
meshDistributor = m; meshDistributor = m;
dofMap = &(meshDistributor->getDofMap());
mpiRank = meshDistributor->getMpiRank(); mpiRank = meshDistributor->getMpiRank();
mpiComm = meshDistributor->getMpiComm(); mpiComm = meshDistributor->getMpiComm();
mpiSelfComm = PETSC_COMM_SELF; mpiSelfComm = PETSC_COMM_SELF;
...@@ -139,6 +140,8 @@ namespace AMDiS { ...@@ -139,6 +140,8 @@ namespace AMDiS {
protected: protected:
MeshDistributor *meshDistributor; MeshDistributor *meshDistributor;
ParallelDofMapping *dofMap;
int mpiRank; int mpiRank;
MPI::Intracomm mpiComm; MPI::Intracomm mpiComm;
......
Supports Markdown
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