Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
06dc55fb
Commit
06dc55fb
authored
Jun 07, 2011
by
Thomas Witkowski
Browse files
Removed UMFPACK library from AMDiS.
parent
7841be47
Changes
6
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/Global.cc
View file @
06dc55fb
...
@@ -332,7 +332,7 @@ namespace AMDiS {
...
@@ -332,7 +332,7 @@ namespace AMDiS {
}
}
void
processMemUsage
(
double
&
vm_usage
,
double
&
resident_set
)
void
processMemUsage
(
double
&
vm_usage
,
double
&
resident_set
,
bool
inMegaByte
)
{
{
using
std
::
ios_base
;
using
std
::
ios_base
;
using
std
::
ifstream
;
using
std
::
ifstream
;
...
@@ -361,8 +361,13 @@ namespace AMDiS {
...
@@ -361,8 +361,13 @@ namespace AMDiS {
// in case x86-64 is configured to use 2MB pages
// in case x86-64 is configured to use 2MB pages
long
page_size_kb
=
sysconf
(
_SC_PAGE_SIZE
)
/
1024
;
long
page_size_kb
=
sysconf
(
_SC_PAGE_SIZE
)
/
1024
;
vm_usage
=
vsize
/
1024.0
;
vm_usage
=
vsize
/
1024.0
;
resident_set
=
rss
*
page_size_kb
;
resident_set
=
rss
*
page_size_kb
;
if
(
inMegaByte
)
{
vm_usage
/=
1024.0
;
resident_set
/=
1024.0
;
}
}
}
...
...
AMDiS/src/Global.h
View file @
06dc55fb
...
@@ -109,7 +109,7 @@ namespace AMDiS {
...
@@ -109,7 +109,7 @@ namespace AMDiS {
void
waitSec
(
int
seconds
);
void
waitSec
(
int
seconds
);
void
processMemUsage
(
double
&
vm_usage
,
double
&
resident_set
);
void
processMemUsage
(
double
&
vm_usage
,
double
&
resident_set
,
bool
inMegaByte
=
true
);
/// Content comparision of two pointers. Used e.g. for find_if
/// Content comparision of two pointers. Used e.g. for find_if
template
<
typename
T
>
template
<
typename
T
>
...
...
AMDiS/src/Mesh.cc
View file @
06dc55fb
...
@@ -1213,18 +1213,19 @@ namespace AMDiS {
...
@@ -1213,18 +1213,19 @@ namespace AMDiS {
Parameters
::
get
(
name
+
"->check"
,
check
);
Parameters
::
get
(
name
+
"->check"
,
check
);
Parameters
::
get
(
name
+
"->preserve coarse dofs"
,
preserveCoarseDOFs
);
Parameters
::
get
(
name
+
"->preserve coarse dofs"
,
preserveCoarseDOFs
);
if
(
macroFilename
.
length
())
{
TEST_EXIT
(
macroFilename
.
length
())
// In parallel computations, check if a finer macro mesh is required.
(
"No mesh defined for parameter %s->macro file name !
\n
"
,
name
.
c_str
());
// In parallel computations, check if a finer macro mesh is required.
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
checkParallelMacroFile
(
macroFilename
,
periodicFilename
,
check
);
checkParallelMacroFile
(
macroFilename
,
periodicFilename
,
check
);
#endif
#endif
macroFileInfo
=
macroFileInfo
=
MacroReader
::
readMacro
(
macroFilename
,
this
,
periodicFilename
,
check
);
MacroReader
::
readMacro
(
macroFilename
,
this
,
periodicFilename
,
check
);
if
(
!
valueFilename
.
length
())
if
(
!
valueFilename
.
length
())
clearMacroFileInfo
();
clearMacroFileInfo
();
}
initialized
=
true
;
initialized
=
true
;
}
}
...
@@ -1251,11 +1252,18 @@ namespace AMDiS {
...
@@ -1251,11 +1252,18 @@ namespace AMDiS {
localAdmin
->
setNumberOfDofs
(
admin
[
0
]
->
getNumberOfDofs
());
localAdmin
->
setNumberOfDofs
(
admin
[
0
]
->
getNumberOfDofs
());
testMesh
.
addDOFAdmin
(
localAdmin
);
testMesh
.
addDOFAdmin
(
localAdmin
);
MSG
(
"START READ FILE %s
\n
"
,
macroFilename
);
MacroInfo
*
testMacroInfo
=
MacroInfo
*
testMacroInfo
=
MacroReader
::
readMacro
(
macroFilename
,
&
testMesh
,
periodicFilename
,
check
);
MacroReader
::
readMacro
(
macroFilename
,
&
testMesh
,
periodicFilename
,
check
);
testMacroInfo
->
clear
();
testMacroInfo
->
clear
();
delete
testMacroInfo
;
delete
testMacroInfo
;
MSG
(
"TEST MESH HAS %d ELEMENTS
\n
"
,
testMesh
.
getNumberOfMacros
());
MPI
::
Finalize
();
exit
(
0
);
// === Check the mesh structure. ===
// === Check the mesh structure. ===
...
...
AMDiS/src/parallel/CheckerPartitioner.cc
View file @
06dc55fb
...
@@ -25,6 +25,8 @@ namespace AMDiS {
...
@@ -25,6 +25,8 @@ namespace AMDiS {
int
nElementsPerBlock
=
(
mesh
->
getDim
()
==
2
?
2
:
6
);
int
nElementsPerBlock
=
(
mesh
->
getDim
()
==
2
?
2
:
6
);
MSG
(
"ELS_PER_BLOCK = %d
\n
"
,
nElementsPerBlock
);
TraverseStack
stack
;
TraverseStack
stack
;
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
mesh
,
0
,
Mesh
::
CALL_EL_LEVEL
);
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
mesh
,
0
,
Mesh
::
CALL_EL_LEVEL
);
while
(
elInfo
)
{
while
(
elInfo
)
{
...
@@ -33,6 +35,12 @@ namespace AMDiS {
...
@@ -33,6 +35,12 @@ namespace AMDiS {
int
elInRank
=
elIndex
/
nElementsPerBlock
;
int
elInRank
=
elIndex
/
nElementsPerBlock
;
TEST_EXIT_DBG
(
elInRank
<
mpiSize
)(
"Should not happen!
\n
"
);
TEST_EXIT_DBG
(
elInRank
<
mpiSize
)(
"Should not happen!
\n
"
);
if
(
elInRank
==
mpiRank
)
{
MSG
(
"EL %d IS MY!
\n
"
,
elIndex
);
}
else
{
MSG
(
"EL %d IS IN RANK %d
\n
"
,
elIndex
,
elInRank
);
}
elementInRank
[
elIndex
]
=
(
elInRank
==
mpiRank
);
elementInRank
[
elIndex
]
=
(
elInRank
==
mpiRank
);
partitionMap
[
elIndex
]
=
elInRank
;
partitionMap
[
elIndex
]
=
elInRank
;
...
...
AMDiS/src/parallel/PetscProblemStat.cc
View file @
06dc55fb
...
@@ -70,16 +70,11 @@ namespace AMDiS {
...
@@ -70,16 +70,11 @@ namespace AMDiS {
double
wtime
=
MPI
::
Wtime
();
double
wtime
=
MPI
::
Wtime
();
double
vm
,
rss
;
double
vm
,
rss
;
processMemUsage
(
vm
,
rss
);
processMemUsage
(
vm
,
rss
);
vm
/=
1024.0
;
rss
/=
1024.0
;
MSG
(
"STAGE 1
\n
"
);
MSG
(
"STAGE 1
\n
"
);
MSG
(
"My memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
MSG
(
"My memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
mpi
::
globalAdd
(
vm
);
mpi
::
globalAdd
(
vm
);
mpi
::
globalAdd
(
rss
);
mpi
::
globalAdd
(
rss
);
MSG
(
"Overall memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
MSG
(
"Overall memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
petscSolver
->
setMeshDistributor
(
meshDistributor
);
petscSolver
->
setMeshDistributor
(
meshDistributor
);
...
@@ -87,28 +82,20 @@ namespace AMDiS {
...
@@ -87,28 +82,20 @@ namespace AMDiS {
processMemUsage
(
vm
,
rss
);
processMemUsage
(
vm
,
rss
);
vm
/=
1024.0
;
rss
/=
1024.0
;
MSG
(
"STAGE 2
\n
"
);
MSG
(
"STAGE 2
\n
"
);
MSG
(
"My memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
MSG
(
"My memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
mpi
::
globalAdd
(
vm
);
mpi
::
globalAdd
(
vm
);
mpi
::
globalAdd
(
rss
);
mpi
::
globalAdd
(
rss
);
MSG
(
"Overall memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
MSG
(
"Overall memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
petscSolver
->
solvePetscMatrix
(
*
solution
,
adaptInfo
);
petscSolver
->
solvePetscMatrix
(
*
solution
,
adaptInfo
);
processMemUsage
(
vm
,
rss
);
processMemUsage
(
vm
,
rss
);
vm
/=
1024.0
;
rss
/=
1024.0
;
MSG
(
"STAGE 3
\n
"
);
MSG
(
"STAGE 3
\n
"
);
MSG
(
"My memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
MSG
(
"My memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
mpi
::
globalAdd
(
vm
);
mpi
::
globalAdd
(
vm
);
mpi
::
globalAdd
(
rss
);
mpi
::
globalAdd
(
rss
);
MSG
(
"Overall memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
MSG
(
"Overall memory usage is VM = %.1f MB RSS = %.1f MB
\n
"
,
vm
,
rss
);
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
06dc55fb
...
@@ -856,6 +856,10 @@ namespace AMDiS {
...
@@ -856,6 +856,10 @@ namespace AMDiS {
{
{
FUNCNAME
(
"PetscSolverFeti::fillPetscMatrix()"
);
FUNCNAME
(
"PetscSolverFeti::fillPetscMatrix()"
);
// double vm, mem;
// processMemUsage(vm, mem);
// MSG("MEM INFO 1 = %f\n", mem);
nComponents
=
vec
->
getSize
();
nComponents
=
vec
->
getSize
();
// === Create all sets and indices. ===
// === Create all sets and indices. ===
...
@@ -874,45 +878,48 @@ namespace AMDiS {
...
@@ -874,45 +878,48 @@ namespace AMDiS {
MatCreateMPIAIJ
(
PETSC_COMM_WORLD
,
MatCreateMPIAIJ
(
PETSC_COMM_WORLD
,
nRowsRankB
,
nRowsRankB
,
nRowsOverallB
,
nRowsOverallB
,
nRowsRankB
,
nRowsRankB
,
nRowsOverallB
,
nRowsOverallB
,
10
0
,
PETSC_NULL
,
10
0
,
PETSC_NULL
,
&
mat_b_b
);
3
0
,
PETSC_NULL
,
0
,
PETSC_NULL
,
&
mat_b_b
);
MatCreateMPIAIJ
(
PETSC_COMM_WORLD
,
MatCreateMPIAIJ
(
PETSC_COMM_WORLD
,
nRowsRankPrimal
,
nRowsRankPrimal
,
nRowsRankPrimal
,
nRowsRankPrimal
,
nRowsOverallPrimal
,
nRowsOverallPrimal
,
nRowsOverallPrimal
,
nRowsOverallPrimal
,
1
0
,
PETSC_NULL
,
1
0
,
PETSC_NULL
,
&
mat_primal_primal
);
3
0
,
PETSC_NULL
,
3
0
,
PETSC_NULL
,
&
mat_primal_primal
);
MatCreateMPIAIJ
(
PETSC_COMM_WORLD
,
MatCreateMPIAIJ
(
PETSC_COMM_WORLD
,
nRowsRankB
,
nRowsRankPrimal
,
nRowsRankB
,
nRowsRankPrimal
,
nRowsOverallB
,
nRowsOverallPrimal
,
nRowsOverallB
,
nRowsOverallPrimal
,
10
0
,
PETSC_NULL
,
10
0
,
PETSC_NULL
,
&
mat_b_primal
);
3
0
,
PETSC_NULL
,
3
0
,
PETSC_NULL
,
&
mat_b_primal
);
MatCreateMPIAIJ
(
PETSC_COMM_WORLD
,
MatCreateMPIAIJ
(
PETSC_COMM_WORLD
,
nRowsRankPrimal
,
nRowsRankB
,
nRowsRankPrimal
,
nRowsRankB
,
nRowsOverallPrimal
,
nRowsOverallB
,
nRowsOverallPrimal
,
nRowsOverallB
,
10
0
,
PETSC_NULL
,
10
0
,
PETSC_NULL
,
&
mat_primal_b
);
3
0
,
PETSC_NULL
,
3
0
,
PETSC_NULL
,
&
mat_primal_b
);
// === Create matrices for FETI-DP preconditioner. ===
// === Create matrices for FETI-DP preconditioner. ===
if
(
fetiPreconditioner
!=
FETI_NONE
)
if
(
fetiPreconditioner
!=
FETI_NONE
)
MatCreateSeqAIJ
(
PETSC_COMM_SELF
,
MatCreateSeqAIJ
(
PETSC_COMM_SELF
,
nRowsDual
,
nRowsDual
,
10
0
,
PETSC_NULL
,
nRowsDual
,
nRowsDual
,
3
0
,
PETSC_NULL
,
&
mat_duals_duals
);
&
mat_duals_duals
);
if
(
fetiPreconditioner
==
FETI_DIRICHLET
)
{
if
(
fetiPreconditioner
==
FETI_DIRICHLET
)
{
MatCreateSeqAIJ
(
PETSC_COMM_SELF
,
MatCreateSeqAIJ
(
PETSC_COMM_SELF
,
nRowsInterior
,
nRowsInterior
,
10
0
,
PETSC_NULL
,
nRowsInterior
,
nRowsInterior
,
3
0
,
PETSC_NULL
,
&
mat_interior_interior
);
&
mat_interior_interior
);
MatCreateSeqAIJ
(
PETSC_COMM_SELF
,
MatCreateSeqAIJ
(
PETSC_COMM_SELF
,
nRowsInterior
,
nRowsDual
,
10
0
,
PETSC_NULL
,
nRowsInterior
,
nRowsDual
,
3
0
,
PETSC_NULL
,
&
mat_interior_duals
);
&
mat_interior_duals
);
MatCreateSeqAIJ
(
PETSC_COMM_SELF
,
MatCreateSeqAIJ
(
PETSC_COMM_SELF
,
nRowsDual
,
nRowsInterior
,
10
0
,
PETSC_NULL
,
nRowsDual
,
nRowsInterior
,
3
0
,
PETSC_NULL
,
&
mat_duals_interior
);
&
mat_duals_interior
);
}
}
// processMemUsage(vm, mem);
// MSG("MEM INFO 2 = %f\n", mem);
// === Prepare traverse of sequentially created matrices. ===
// === Prepare traverse of sequentially created matrices. ===
...
@@ -1121,7 +1128,9 @@ namespace AMDiS {
...
@@ -1121,7 +1128,9 @@ namespace AMDiS {
}
}
}
}
}
}
// processMemUsage(vm, mem);
// MSG("MEM INFO 3 = %f\n", mem);
// === Start global assembly procedure. ===
// === Start global assembly procedure. ===
...
@@ -1137,6 +1146,8 @@ namespace AMDiS {
...
@@ -1137,6 +1146,8 @@ namespace AMDiS {
MatAssemblyBegin
(
mat_primal_b
,
MAT_FINAL_ASSEMBLY
);
MatAssemblyBegin
(
mat_primal_b
,
MAT_FINAL_ASSEMBLY
);
MatAssemblyEnd
(
mat_primal_b
,
MAT_FINAL_ASSEMBLY
);
MatAssemblyEnd
(
mat_primal_b
,
MAT_FINAL_ASSEMBLY
);
// processMemUsage(vm, mem);
// MSG("MEM INFO 4 = %f\n", mem);
// === Start global assembly procedure for preconditioner matrices. ===
// === Start global assembly procedure for preconditioner matrices. ===
...
@@ -1157,6 +1168,9 @@ namespace AMDiS {
...
@@ -1157,6 +1168,9 @@ namespace AMDiS {
}
}
// processMemUsage(vm, mem);
// MSG("MEM INFO 5 = %f\n", mem);
// === Create and fill PETSc's right hand side vectors. ===
// === Create and fill PETSc's right hand side vectors. ===
VecCreate
(
PETSC_COMM_WORLD
,
&
f_b
);
VecCreate
(
PETSC_COMM_WORLD
,
&
f_b
);
...
@@ -1196,20 +1210,31 @@ namespace AMDiS {
...
@@ -1196,20 +1210,31 @@ namespace AMDiS {
VecAssemblyBegin
(
f_primal
);
VecAssemblyBegin
(
f_primal
);
VecAssemblyEnd
(
f_primal
);
VecAssemblyEnd
(
f_primal
);
// processMemUsage(vm, mem);
// MSG("MEM INFO 6 = %f\n", mem);
// === Create and fill PETSc matrix for Lagrange constraints. ===
// === Create and fill PETSc matrix for Lagrange constraints. ===
createMatLagrange
();
createMatLagrange
();
// processMemUsage(vm, mem);
// MSG("MEM INFO 7 = %f\n", mem);
// === Create PETSc solver for the Schur complement on primal variables. ===
// === Create PETSc solver for the Schur complement on primal variables. ===
createSchurPrimalKsp
();
createSchurPrimalKsp
();
// processMemUsage(vm, mem);
// MSG("MEM INFO 8 = %f\n", mem);
// === Create PETSc solver for the FETI-DP operator. ===
// === Create PETSc solver for the FETI-DP operator. ===
createFetiKsp
();
createFetiKsp
();
// processMemUsage(vm, mem);
// MSG("MEM INFO 9 = %f\n", mem);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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