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
bd724c08
Commit
bd724c08
authored
Jun 10, 2008
by
Thomas Witkowski
Browse files
* Pardiso Solver
parent
a9c641bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/PardisoSolver.cc
View file @
bd724c08
...
...
@@ -4,6 +4,7 @@
#ifdef HAVE_MKL
#include
<mkl.h>
#include
<mkl_pardiso.h>
namespace
AMDiS
{
...
...
@@ -120,7 +121,7 @@ namespace AMDiS {
iparm
[
0
]
=
1
;
// No solver default
iparm
[
1
]
=
2
;
// Fill-in reordering from METIS
iparm
[
2
]
=
1
;
// Number of threads
iparm
[
2
]
=
mkl_get_max_threads
()
;
// Number of threads
iparm
[
7
]
=
2
;
// Max numbers of iterative refinement steps
iparm
[
9
]
=
13
;
// Perturb the pivot elements with 1e-13
iparm
[
10
]
=
1
;
// Use nonsymmetric permutation and scaling MPS
...
...
@@ -151,7 +152,52 @@ namespace AMDiS {
PARDISO
(
pt
,
&
maxfct
,
&
mnum
,
&
mtype
,
&
phase
,
&
n
,
a
,
ia
,
ja
,
&
idum
,
&
nRhs
,
iparm
,
&
msglvl
,
&
ddum
,
&
ddum
,
&
error
);
TEST_EXIT
(
error
==
0
)(
"Intel MKL Pardiso error during symbolic factorization: %d
\n
"
,
error
);
// Numerical factorization
phase
=
22
;
PARDISO
(
pt
,
&
maxfct
,
&
mnum
,
&
mtype
,
&
phase
,
&
n
,
a
,
ia
,
ja
,
&
idum
,
&
nRhs
,
iparm
,
&
msglvl
,
&
ddum
,
&
ddum
,
&
error
);
TEST_EXIT
(
error
==
0
)(
"Intel MKL Pardiso error during numerical factorization: %d
\n
"
,
error
);
// Back substitution and iterative refinement
phase
=
33
;
iparm
[
7
]
=
2
;
// Max numbers of iterative refinement steps
PARDISO
(
pt
,
&
maxfct
,
&
mnum
,
&
mtype
,
&
phase
,
&
n
,
a
,
ia
,
ja
,
&
idum
,
&
nRhs
,
iparm
,
&
msglvl
,
bvec
,
xvec
,
&
error
);
TEST_EXIT
(
error
==
0
)(
"Intel MKL Pardiso error during solution: %d
\n
"
,
error
);
// Termination and release of memory
phase
=
-
1
;
PARDISO
(
pt
,
&
maxfct
,
&
mnum
,
&
mtype
,
&
phase
,
&
n
,
a
,
ia
,
ja
,
&
idum
,
&
nRhs
,
iparm
,
&
msglvl
,
&
ddum
,
&
ddum
,
&
error
);
// Copy and resort solution.
for
(
int
i
=
0
;
i
<
x
->
getSize
();
i
++
)
{
DOFVector
<
double
>::
Iterator
it
(
x
->
getDOFVector
(
i
),
USED_DOFS
);
int
counter
=
0
;
for
(
it
.
reset
();
!
it
.
end
();
it
++
,
counter
++
)
{
*
it
=
xvec
[
counter
*
nComponents
+
i
];
}
}
// Calculate and print the residual.
*
p
=
*
x
;
*
p
*=
-
1.0
;
matVec
->
matVec
(
NoTranspose
,
*
p
,
*
r
);
*
r
+=
*
b
;
this
->
residual
=
norm
(
r
);
MSG
(
"Residual: %e
\n
"
,
this
->
residual
);
free
(
a
);
free
(
ja
);
...
...
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