Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Aland, Sebastian
amdis
Commits
ada80f81
Commit
ada80f81
authored
9 years ago
by
Reuther, Sebastian
Browse files
Options
Downloads
Patches
Plain Diff
adapted reinit (HL_SignedDistTraverse) algorithm for parallel (domain decomposition) AMDiS
parent
6a975382
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AMDiS/src/reinit/HL_SignedDistTraverse.cc
+26
-0
26 additions, 0 deletions
AMDiS/src/reinit/HL_SignedDistTraverse.cc
AMDiS/src/reinit/HL_SignedDistTraverse.h
+26
-0
26 additions, 0 deletions
AMDiS/src/reinit/HL_SignedDistTraverse.h
with
52 additions
and
0 deletions
AMDiS/src/reinit/HL_SignedDistTraverse.cc
+
26
−
0
View file @
ada80f81
...
...
@@ -109,6 +109,12 @@ void HL_SignedDistTraverse::initializeBoundary()
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
// end of: mesh traverse
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
// In parallel AMDiS synchronize the bound_DOF DOFVector with the max-assigner and the sD_DOF DOFVector with the min-assigner
AMDiS
::
Parallel
::
MeshDistributor
::
globalMeshDistributor
->
synchVector
(
*
bound_DOF
,
max_assigner
());
AMDiS
::
Parallel
::
MeshDistributor
::
globalMeshDistributor
->
synchVector
(
*
sD_DOF
,
min_to_zero_assigner
());
#endif
}
...
...
@@ -123,6 +129,11 @@ void HL_SignedDistTraverse::HL_updateIteration()
sDOld_DOF
=
new
DOFVector
<
double
>
(
feSpace
,
"sDOld_DOF"
);
sDOld_DOF
->
copy
(
const_cast
<
DOFVector
<
double
>
&>
(
*
sD_DOF
));
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
// Update sDOld_DOF on interior domain boundaries
AMDiS
::
Parallel
::
MeshDistributor
::
globalMeshDistributor
->
synchVector
(
*
sDOld_DOF
,
min_to_zero_assigner
());
#endif
// ===== Gauss-Seidel or Jacobi iteration ? =====
if
(
GaussSeidelFlag
)
update_DOF
=
sD_DOF
;
...
...
@@ -147,8 +158,23 @@ void HL_SignedDistTraverse::HL_updateIteration()
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
// Update sD_DOF on interior domain boundaries
AMDiS
::
Parallel
::
MeshDistributor
::
globalMeshDistributor
->
synchVector
(
*
sD_DOF
,
min_to_zero_assigner
());
#endif
// ===== Is tolerance reached ? =====
tol_reached
=
checkTol
();
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
// Convert bool to int that the datatype MPI_INT can be used in the MPI_Allreduce() command below.
int
int_tol_reached
=
(
tol_reached
?
1
:
0
);
int
int_tol_reached_overall
;
// Here MPI_MIN operation in the MPI_Allreduce() command is used that each processor runs the cycle again until each
// processor has reached the tolerance. Otherwise the synchVector() method from above would fail.
MPI_Allreduce
(
&
int_tol_reached
,
&
int_tol_reached_overall
,
1
,
MPI_INT
,
MPI_MIN
,
MPI_COMM_WORLD
);
int_tol_reached
=
int_tol_reached_overall
;
tol_reached
=
(
int_tol_reached
==
0
?
false
:
true
);
#endif
sDOld_DOF
->
copy
(
const_cast
<
DOFVector
<
double
>
&>
(
*
sD_DOF
));
}
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/reinit/HL_SignedDistTraverse.h
+
26
−
0
View file @
ada80f81
...
...
@@ -39,6 +39,32 @@ namespace reinit {
using
namespace
AMDiS
;
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
/**
* Functor which assigns a the maximum of a and b.
* (Used for synchronizing DOFVectors on interior boundaries in parallel AMDiS)
*/
struct
max_assigner
:
FunctorBase
{
int
getDegree
(
int
d0
)
const
{
return
d0
;
}
static
void
eval
(
double
&
v0
,
const
double
&
v1
)
{
v0
=
std
::
max
(
v0
,
v1
);
}
void
operator
()(
double
&
v0
,
const
double
&
v1
)
{
eval
(
v0
,
v1
);
}
};
#endif
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
/**
* Functor which assigns a the minimum of a and b with respect to 0.
* (Used for synchronizing DOFVectors on interior boundaries in parallel AMDiS)
*/
struct
min_to_zero_assigner
:
FunctorBase
{
int
getDegree
(
int
d0
)
const
{
return
d0
;
}
static
void
eval
(
double
&
v0
,
const
double
&
v1
)
{
v0
=
(
std
::
abs
(
v0
)
<
std
::
abs
(
v1
)
?
(
v0
)
:
(
v1
));
}
void
operator
()(
double
&
v0
,
const
double
&
v1
)
{
eval
(
v0
,
v1
);
}
};
#endif
class
HL_SignedDistTraverse
:
public
HL_SignedDist
{
public:
...
...
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