Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
amdis
Commits
90357cd5
Commit
90357cd5
authored
Apr 20, 2012
by
Thomas Witkowski
Browse files
Added flags for compiling with Intel C++ compiler. Fixed some real compiler warnings.
parent
27235c55
Changes
23
Hide whitespace changes
Inline
Side-by-side
AMDiS/CMakeLists.txt
View file @
90357cd5
...
...
@@ -31,7 +31,11 @@ if(CMAKE_BUILD_TYPE STREQUAL "")
set
(
CMAKE_BUILD_TYPE
"Release"
)
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"
)
option
(
USE_PETSC_DEV false
)
option
(
ENABLE_ZOLTAN false
)
...
...
@@ -39,15 +43,6 @@ option(ENABLE_UMFPACK "Use of UMFPACK solver" false)
option
(
ENABLE_PNG
"use png reader/writer"
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
)
if
(
Boost_FOUND
)
list
(
APPEND AMDIS_INCLUDE_DIRS
${
Boost_INCLUDE_DIR
}
)
...
...
AMDiS/src/DOFMatrix.h
View file @
90357cd5
...
...
@@ -262,12 +262,14 @@ namespace AMDiS {
inserter
=
0
;
}
#if 0
/// Returns whether restriction should be performed after coarsening
/// (false by default)
virtual bool coarseRestrict()
{
return false;
}
#endif
/// Returns const \ref rowFeSpace
const
FiniteElemSpace
*
getRowFeSpace
()
const
...
...
AMDiS/src/ProblemInstat.h
View file @
90357cd5
...
...
@@ -93,7 +93,8 @@ namespace AMDiS {
}
/// Implementation of ProblemTimeInterface::closeTimestep().
virtual
void
closeTimestep
()
{}
virtual
void
closeTimestep
(
AdaptInfo
*
adaptInfo
)
{}
/// Returns \ref name.
inline
std
::
string
getName
()
...
...
AMDiS/src/ProblemInterpol.cc
View file @
90357cd5
...
...
@@ -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
());
for
(
int
i
=
0
;
i
<
size
;
i
++
)
...
...
@@ -45,7 +45,7 @@ namespace AMDiS {
}
void
ProblemInterpol
::
estimate
(
AdaptInfo
*
adaptInfo
,
double
)
void
ProblemInterpol
::
estimate
(
AdaptInfo
*
adaptInfo
)
{
FUNCNAME
(
"ProblemIterpolVec::estimate()"
);
...
...
AMDiS/src/ProblemInterpol.h
View file @
90357cd5
...
...
@@ -50,13 +50,18 @@ namespace AMDiS {
virtual
void
buildbeforeCoarsen
(
AdaptInfo
*
adaptInfo
,
Flag
)
{}
/// 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.
virtual
void
solve
(
AdaptInfo
*
adaptInfo
);
virtual
void
solve
(
AdaptInfo
*
adaptInfo
,
bool
createMatrixData
=
true
,
bool
storeMatrixData
=
false
);
/// True H1 or L2 error is calculated.
virtual
void
estimate
(
AdaptInfo
*
adaptInfo
,
double
);
virtual
void
estimate
(
AdaptInfo
*
adaptInfo
);
protected:
/// Function to interpolate.
...
...
AMDiS/src/io/GNUPlotWriter.cc
View file @
90357cd5
...
...
@@ -31,7 +31,9 @@ namespace AMDiS {
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"
);
Mesh
*
mesh
=
feSpace_
->
getMesh
();
...
...
AMDiS/src/io/GNUPlotWriter.h
View file @
90357cd5
...
...
@@ -43,7 +43,10 @@ namespace AMDiS {
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:
/// Contains the mesh
...
...
AMDiS/src/nonlin/ProblemNonLin.cc
View file @
90357cd5
...
...
@@ -19,7 +19,7 @@
namespace
AMDiS
{
void
ProblemNonLin
::
initialize
(
Flag
initFlag
,
ProblemStat
*
adoptProblem
/*= NULL*/
,
ProblemStat
Seq
*
adoptProblem
/*= NULL*/
,
Flag
adoptFlag
/*= INIT_NOTHING*/
)
{
FUNCNAME
(
"ProblemNonLin::initialize()"
);
...
...
AMDiS/src/nonlin/ProblemNonLin.h
View file @
90357cd5
...
...
@@ -77,7 +77,7 @@ namespace AMDiS {
/// Initialization of the problem.
virtual
void
initialize
(
Flag
initFlag
,
ProblemStat
*
adoptProblem
=
NULL
,
ProblemStat
Seq
*
adoptProblem
=
NULL
,
Flag
adoptFlag
=
INIT_NOTHING
);
/// Used in \ref initialize().
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
90357cd5
...
...
@@ -969,7 +969,7 @@ namespace AMDiS {
// (static_cast<double>(maxDofs - avrgDofs) / avrgDofs) * 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 {
{
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
)
if
(
it
->
second
.
global
==
dof
)
return
it
->
first
;
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
90357cd5
...
...
@@ -225,6 +225,12 @@ namespace AMDiS {
return
dofMap
[
feSpace
][
dof
].
local
;
}
/// Returns the DOF mapping object, \ref dofMap.
inline
ParallelDofMapping
&
getDofMap
()
{
return
dofMap
;
}
/// Returns the periodic mapping handler, \ref periodicMap.
inline
PeriodicMap
&
getPeriodicMap
()
{
...
...
@@ -555,6 +561,7 @@ namespace AMDiS {
/// macro element.
map
<
int
,
int
>
partitionMap
;
/// Mapping object to map from local DOF indices to global ones.
ParallelDofMapping
dofMap
;
/// Database to store and query all sub-objects of all elements of the
...
...
AMDiS/src/parallel/MeshPartitioner.h
View file @
90357cd5
...
...
@@ -107,11 +107,7 @@ namespace AMDiS {
boxPartitioning
=
b
;
}
#if 0
void setLocalGlobalDofMap(map<DegreeOfFreedom, DegreeOfFreedom> *m)
#else
void
setLocalGlobalDofMap
(
map
<
DegreeOfFreedom
,
MultiIndex
>
*
m
)
#endif
void
setLocalGlobalDofMap
(
DofMap
*
m
)
{
mapLocalGlobal
=
m
;
}
...
...
@@ -173,7 +169,7 @@ namespace AMDiS {
/// macro element index the box number it belongs to.
map
<
int
,
int
>
elInBox
;
map
<
DegreeOfFreedom
,
MultiIndex
>
*
mapLocalGlobal
;
DofMap
*
mapLocalGlobal
;
map
<
int
,
vector
<
int
>
>
elNeighbours
;
...
...
AMDiS/src/parallel/ParMetisPartitioner.cc
View file @
90357cd5
...
...
@@ -29,7 +29,7 @@ namespace AMDiS {
ParMetisMesh
::
ParMetisMesh
(
Mesh
*
mesh
,
MPI
::
Intracomm
*
comm
,
std
::
map
<
int
,
bool
>&
elementInRank
,
map
<
DegreeOfFreedom
,
MultiIndex
>
*
mapLocalGlobal
)
DofMap
*
mapLocalGlobal
)
:
dim
(
mesh
->
getDim
()),
nElements
(
0
),
mpiComm
(
comm
)
...
...
AMDiS/src/parallel/ParMetisPartitioner.h
View file @
90357cd5
...
...
@@ -44,7 +44,7 @@ namespace AMDiS {
public:
ParMetisMesh
(
Mesh
*
mesh
,
MPI
::
Intracomm
*
comm
,
map
<
int
,
bool
>&
elementInRank
,
map
<
DegreeOfFreedom
,
MultiIndex
>
*
mapLocalGlobal
);
DofMap
*
mapLocalGlobal
);
~
ParMetisMesh
();
...
...
AMDiS/src/parallel/ParallelDebug.cc
View file @
90357cd5
...
...
@@ -640,20 +640,21 @@ namespace AMDiS {
cout
<<
"====== DOF MAP LOCAL -> GLOBAL ====== "
<<
endl
;
map
<
DegreeOfFreedom
,
MultiIndex
>
&
dofMap
=
pdb
.
dofMap
[
feSpace
].
getMap
();
for
(
map
<
DegreeOfFreedom
,
MultiIndex
>::
iterator
it
=
dofMap
.
begin
();
it
!=
dofMap
.
end
();
++
it
)
{
DofMap
&
dofMap
=
pdb
.
dofMap
[
feSpace
].
getMap
();
for
(
DofMap
::
iterator
it
=
dofMap
.
begin
();
it
!=
dofMap
.
end
();
++
it
)
{
cout
<<
"DOF "
<<
it
->
first
<<
" "
<<
it
->
second
.
global
<<
"
\n
"
;
WorldVector
<
double
>
coords
;
pdb
.
mesh
->
getDofIndexCoords
(
it
->
first
,
feSpace
,
coords
);
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
())
if
(
it
->
first
==
rit
.
getDofIndex
())
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
())
if
(
it
->
first
==
rit
.
getDofIndex
())
cout
<<
"RECV DOF FROM "
<<
rit
.
getRank
()
<<
endl
;
...
...
AMDiS/src/parallel/ParallelDofMapping.cc
View file @
90357cd5
...
...
@@ -32,7 +32,7 @@ namespace AMDiS {
{
// === 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
)
it
->
second
.
local
=
nRankDofs
++
;
...
...
@@ -55,7 +55,7 @@ namespace AMDiS {
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
;
}
...
...
@@ -255,6 +255,21 @@ namespace AMDiS {
computeMatIndex
();
}
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
()
{
...
...
@@ -274,9 +289,8 @@ namespace AMDiS {
// Traverse all DOFs of the FE space and create for all rank owned DOFs
// a matrix index.
map
<
DegreeOfFreedom
,
MultiIndex
>&
dofMap
=
data
[
feSpaces
[
i
]].
getMap
();
typedef
map
<
DegreeOfFreedom
,
MultiIndex
>::
iterator
ItType
;
for
(
ItType
it
=
dofMap
.
begin
();
it
!=
dofMap
.
end
();
++
it
)
{
DofMap
&
dofMap
=
data
[
feSpaces
[
i
]].
getMap
();
for
(
DofMap
::
iterator
it
=
dofMap
.
begin
();
it
!=
dofMap
.
end
();
++
it
)
{
if
(
data
[
feSpaces
[
i
]].
isRankDof
(
it
->
first
))
{
int
globalMatIndex
=
it
->
second
.
local
+
offset
;
dofToMatIndex
.
add
(
i
,
it
->
first
,
globalMatIndex
);
...
...
AMDiS/src/parallel/ParallelDofMapping.h
View file @
90357cd5
...
...
@@ -35,14 +35,6 @@ namespace AMDiS {
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
* 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
...
...
@@ -183,7 +175,7 @@ namespace AMDiS {
}
/// Returns the raw data of the mapping.
map
<
DegreeOfFreedom
,
MultiIndex
>
&
getMap
()
DofMap
&
getMap
()
{
return
dofMap
;
}
...
...
@@ -237,7 +229,7 @@ namespace AMDiS {
const
FiniteElemSpace
*
feSpace
;
/// 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.
std
::
set
<
DegreeOfFreedom
>
nonRankDofs
;
...
...
@@ -348,6 +340,9 @@ namespace AMDiS {
/// Update the mapping.
void
update
();
/// Update the mapping.
void
update
(
vector
<
const
FiniteElemSpace
*>&
feSpaces
);
/// Returns the global matrix index of a given DOF for a given
/// component number.
inline
int
getMatIndex
(
int
ithComponent
,
DegreeOfFreedom
d
)
...
...
AMDiS/src/parallel/ParallelTypes.h
View file @
90357cd5
...
...
@@ -70,7 +70,15 @@ namespace AMDiS {
/// need to have a periodic DOF mapping for each FE space.
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
;
}
...
...
AMDiS/src/parallel/PetscSolver.cc
View file @
90357cd5
...
...
@@ -20,6 +20,7 @@ namespace AMDiS {
PetscSolver
::
PetscSolver
()
:
meshDistributor
(
NULL
),
dofMap
(
NULL
),
mpiRank
(
-
1
),
kspPrefix
(
""
),
removeRhsNullSpace
(
false
)
...
...
AMDiS/src/parallel/PetscSolver.h
View file @
90357cd5
...
...
@@ -53,6 +53,7 @@ namespace AMDiS {
void
setMeshDistributor
(
MeshDistributor
*
m
)
{
meshDistributor
=
m
;
dofMap
=
&
(
meshDistributor
->
getDofMap
());
mpiRank
=
meshDistributor
->
getMpiRank
();
mpiComm
=
meshDistributor
->
getMpiComm
();
mpiSelfComm
=
PETSC_COMM_SELF
;
...
...
@@ -138,7 +139,9 @@ namespace AMDiS {
protected:
MeshDistributor
*
meshDistributor
;
ParallelDofMapping
*
dofMap
;
int
mpiRank
;
MPI
::
Intracomm
mpiComm
;
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment