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
d464d6e6
Commit
d464d6e6
authored
Dec 05, 2011
by
Naumann, Andreas
Browse files
timings for mtl4 solver
parent
2e196286
Changes
7
Show whitespace changes
Inline
Side-by-side
AMDiS/CMakeLists.txt
View file @
d464d6e6
...
...
@@ -141,6 +141,7 @@ SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${
SOURCE_DIR
}
/SubQuadrature.cc
${
SOURCE_DIR
}
/SurfaceQuadrature.cc
${
SOURCE_DIR
}
/Tetrahedron.cc
${
SOURCE_DIR
}
/Timer.cc
${
SOURCE_DIR
}
/Traverse.cc
${
SOURCE_DIR
}
/Triangle.cc
${
SOURCE_DIR
}
/VertexVector.cc
...
...
AMDiS/src/ITL_OEMSolver.h
View file @
d464d6e6
...
...
@@ -51,6 +51,14 @@ namespace AMDiS {
ITL_OEMSolver
(
std
::
string
name
)
:
MTL4Solver
<
MTLTypes
::
MTLMatrix
,
MTLTypes
::
MTLVector
,
ITL_OEMSolver_runner
<
ITLSolver
,
MTLTypes
::
MTLMatrix
,
MTLTypes
::
MTLVector
>
>
(
name
)
{}
int
solveSystem
(
const
SolverMatrix
<
Matrix
<
DOFMatrix
*>
>&
A
,
SystemVector
&
x
,
SystemVector
&
b
,
VectorialMapper
&
m
)
{
return
MTL4Solver
<
MTLTypes
::
MTLMatrix
,
MTLTypes
::
MTLVector
,
ITL_OEMSolver_runner
<
ITLSolver
,
MTLTypes
::
MTLMatrix
,
MTLTypes
::
MTLVector
>
>::
solve
(
A
,
x
,
b
,
m
);
}
~
ITL_OEMSolver
()
{}
...
...
@@ -87,6 +95,14 @@ namespace AMDiS {
}
int
solveSystem
(
const
SolverMatrix
<
Matrix
<
DOFMatrix
*>
>&
A
,
SystemVector
&
x
,
SystemVector
&
b
,
VectorialMapper
&
m
)
{
return
MTL4Solver
<
MTLMatrix
,
MTLVector
,
ITL_OEMSolver_para_runner
<
ITLSolver
,
MTLTypes
::
MTLMatrix
,
MTLTypes
::
MTLVector
>
>::
solve
(
A
,
x
,
b
,
m
);
}
~
ITL_OEMSolver_para
()
{}
/// Set parameter of iterative solver
...
...
AMDiS/src/MTL4Solver.h
View file @
d464d6e6
...
...
@@ -22,6 +22,7 @@
#include
"OEMSolver.h"
#include
"MatrixStreams.h"
#include
"Timer.h"
#include
<iostream>
#include
<boost/mpl/bool.hpp>
#include
<boost/numeric/mtl/utility/is_distributed.hpp>
...
...
@@ -67,6 +68,7 @@ namespace AMDiS {
template
<
typename
Matrix
,
typename
Vector
,
typename
Mapper
>
int
solve
(
const
Matrix
&
A
,
Vector
&
x
,
Vector
&
b
,
Mapper
&
mapper
)
{
Timer
t
;
if
(
num_rows
(
matrix
)
==
0
||
!
getMultipleRhs
()
)
{
init
(
mapper
,
mtl
::
traits
::
is_distributed
<
MTLMatrix
>
());
...
...
@@ -88,7 +90,11 @@ namespace AMDiS {
VecMap
<
Vector
,
Mapper
>
bVecMap
(
b
,
mapper
);
mtl_b
<<
bVecMap
;
MSG
(
"fill MTL4 matrix needed %5.f seconds
\n
"
,
t
.
elapsed
());
t
.
reset
();
error
=
worker
.
solve
(
matrix
,
mtl_x
,
mtl_b
);
MSG
(
"solve MTL4 matrix needed %5.f seconds
\n
"
,
t
.
elapsed
());
MTLVector
r
(
mtl_b
);
r
-=
matrix
*
mtl_x
;
...
...
AMDiS/src/OEMSolver.h
View file @
d464d6e6
...
...
@@ -96,7 +96,12 @@ namespace AMDiS {
virtual
int
solveSystem
(
const
SolverMatrix
<
Matrix
<
DOFMatrix
*>
>&
A
,
SystemVector
&
x
,
SystemVector
&
b
,
VectorialMapper
&
)
=
0
;
VectorialMapper
&
)
{
FUNCNAME
(
"OEMSolver::solveSystem()"
);
TEST_EXIT
(
false
)(
"This linear solver is not suitable for sequentiell problems
\n
"
);
return
-
1
;
}
inline
int
solveSystem
(
const
SolverMatrix
<
Matrix
<
DOFMatrix
*>
>&
A
,
SystemVector
&
x
,
...
...
AMDiS/src/Timer.cc
0 → 100644
View file @
d464d6e6
#include
"Timer.h"
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#include
<mpi.h>
#endif
namespace
AMDiS
{
Timer
::
Timer
()
:
first_seq
(
clock
())
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
,
first_mpi
(
MPI
::
Wtime
())
#endif
{}
void
Timer
::
reset
()
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
first_mpi
=
MPI
::
Wtime
();
#else
first_seq
=
clock
();
#endif
}
double
Timer
::
elapsed
()
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
return
MPI
::
Wtime
()
-
first_mpi
;
#else
return
((
double
)(
clock
()
-
first_seq
))
/
((
double
)
CLOCKS_PER_SEC
);
#endif
}
}
AMDiS/src/Timer.h
0 → 100644
View file @
d464d6e6
#ifndef AMDIS_TIMER_H
#define AMDIS_TIMER_H
#include
<time.h>
namespace
AMDiS
{
/// Helper class to destinct between different time measurement methods
class
Timer
{
/// begin value for sequentiell measurement
clock_t
first_seq
;
/// begin value for parallel measurement
double
first_mpi
;
public:
///initializes the timer with current time
Timer
();
/// resets the timer to current time
void
reset
();
/// returns the elapsed time (from construction or last reset) to now in seconds
double
elapsed
();
};
}
#endif
AMDiS/src/UmfPackSolver.h
View file @
d464d6e6
...
...
@@ -138,6 +138,14 @@ namespace AMDiS {
{
}
int
solveSystem
(
const
SolverMatrix
<
Matrix
<
DOFMatrix
*>
>&
A
,
SystemVector
&
x
,
SystemVector
&
b
,
VectorialMapper
&
m
)
{
return
solve
(
A
,
x
,
b
,
m
);
}
private:
};
...
...
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