Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-istl
Commits
a7e7dd6f
Commit
a7e7dd6f
authored
5 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[test] Use mpi abstractions (fix todo/warning)
parent
bf3bbfaa
No related branches found
No related tags found
1 merge request
!294
[bugfix] Fix issue #68 / segfault in amg
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/istl/paamg/test/hierarchytest.cc
+9
-19
9 additions, 19 deletions
dune/istl/paamg/test/hierarchytest.cc
with
9 additions
and
19 deletions
dune/istl/paamg/test/hierarchytest.cc
+
9
−
19
View file @
a7e7dd6f
...
...
@@ -2,7 +2,7 @@
// vi: set et ts=4 sw=2 sts=2:
#include
<config.h>
#include
"mpi.h"
#include
<dune/common/parallel/mpihelper.hh>
#include
<dune/common/parallel/mpicollectivecommunication.hh>
#include
<dune/istl/paamg/matrixhierarchy.hh>
#include
<dune/istl/paamg/smoother.hh>
...
...
@@ -11,28 +11,26 @@
#include
<dune/istl/schwarz.hh>
#include
"anisotropic.hh"
template
<
int
BS
>
template
<
int
blockSize
>
void
testHierarchy
(
int
N
)
{
typedef
int
LocalId
;
typedef
int
GlobalId
;
typedef
Dune
::
OwnerOverlapCopyCommunication
<
LocalId
,
GlobalId
>
Communication
;
typedef
Communication
::
ParallelIndexSet
ParallelIndexSet
;
typedef
Dune
::
FieldMatrix
<
double
,
BS
,
BS
>
MatrixBlock
;
typedef
Dune
::
FieldMatrix
<
double
,
blockSize
,
blockSize
>
MatrixBlock
;
typedef
Dune
::
BCRSMatrix
<
MatrixBlock
>
BCRSMat
;
typedef
Dune
::
FieldVector
<
double
,
BS
>
VectorBlock
;
typedef
Dune
::
FieldVector
<
double
,
blockSize
>
VectorBlock
;
typedef
Dune
::
BlockVector
<
VectorBlock
>
Vector
;
int
n
;
Communication
pinfo
(
MPI_COMM_WORLD
);
Communication
pinfo
(
Dune
::
MPIHelper
::
getCommunicator
()
);
ParallelIndexSet
&
indices
=
pinfo
.
indexSet
();
typedef
Dune
::
RemoteIndices
<
ParallelIndexSet
>
RemoteIndices
;
RemoteIndices
&
remoteIndices
=
pinfo
.
remoteIndices
();
typedef
Dune
::
CollectiveCommunication
<
MPI_Comm
>
Comm
;
Comm
cc
(
MPI_COMM_WORLD
);
BCRSMat
mat
=
setupAnisotropic2d
<
MatrixBlock
>
(
N
,
indices
,
cc
,
&
n
);
BCRSMat
mat
=
setupAnisotropic2d
<
MatrixBlock
>
(
N
,
indices
,
Dune
::
MPIHelper
::
getCollectiveCommunication
(),
&
n
);
Vector
b
(
indices
.
size
());
remoteIndices
.
rebuild
<
false
>
();
...
...
@@ -74,21 +72,13 @@ void testHierarchy(int N)
int
main
(
int
argc
,
char
**
argv
)
{
#warning change to use MPI abstractions...
MPI_Init
(
&
argc
,
&
argv
);
Dune
::
MPIHelper
::
instance
(
argc
,
argv
);
const
int
BS
=
1
;
const
expr
int
blockSize
=
1
;
int
N
=
10
;
if
(
argc
>
1
)
N
=
atoi
(
argv
[
1
]);
int
procs
,
rank
;
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
procs
);
testHierarchy
<
BS
>
(
N
);
MPI_Finalize
();
testHierarchy
<
blockSize
>
(
N
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment