Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-fem-dg
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
Container Registry
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
dune-fem
dune-fem-dg
Commits
cf5130e8
Commit
cf5130e8
authored
11 years ago
by
Robert Kloefkorn
Browse files
Options
Downloads
Patches
Plain Diff
added flag to avoid communication.
parent
d927f323
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/fem-dg/pass/threadpass.hh
+23
-18
23 additions, 18 deletions
dune/fem-dg/pass/threadpass.hh
with
23 additions
and
18 deletions
dune/fem-dg/pass/threadpass.hh
+
23
−
18
View file @
cf5130e8
...
...
@@ -217,6 +217,7 @@ namespace Dune {
nonBlockingComm_
(),
numberOfElements_
(
0
),
firstCall_
(
true
),
requireCommunication_
(
true
),
sumComputeTime_
(
Fem
::
Parameter
::
getValue
<
bool
>
(
"fem.parallel.sumcomputetime"
,
false
)
)
{
const
int
maxThreads
=
Fem
::
ThreadManager
::
maxThreads
();
...
...
@@ -231,6 +232,8 @@ namespace Dune {
if
(
Fem
::
Parameter
::
verbose
()
)
std
::
cout
<<
"Thread Pass initialized
\n
"
;
#endif
// get information about communication
requireCommunication_
=
passes_
[
0
]
->
requireCommunication
();
}
virtual
~
ThreadPass
()
...
...
@@ -376,14 +379,6 @@ namespace Dune {
//! overload compute method to use thread iterators
void
compute
(
const
ArgumentType
&
arg
,
DestinationType
&
dest
)
const
{
}
//! overload compute method to use thread iterators
void
compute
(
const
ArgumentType
&
arg
,
DestinationType
&
dest
)
const
{
const
bool
updateAlso
=
(
&
dest
!=
0
);
// reset number of elements
numberOfElements_
=
0
;
...
...
@@ -413,7 +408,7 @@ namespace Dune {
// for the first call we need to receive data already here,
// since the flux calculation is done at once
if
(
nonBlockingComm_
.
n
onBlockingCommunication
()
)
if
(
useN
onBlockingCommunication
()
)
{
// RECEIVE DATA, send was done on call of operator() (see pass.hh)
receiveCommunication
(
arg
);
...
...
@@ -473,7 +468,7 @@ namespace Dune {
// BEGIN PARALLEL REGION, second stage, surface integrals
// only for non-blocking communication
////////////////////////////////////////////////////////////
if
(
nonBlockingComm_
.
n
onBlockingCommunication
()
)
if
(
useN
onBlockingCommunication
()
)
{
// mark second stage
firstStage_
=
false
;
...
...
@@ -522,23 +517,32 @@ namespace Dune {
// set max time steps
setMaxTimeSteps
();
// if useNonBlockingComm_ is disabled then communicate here
if
(
!
nonBlockingComm_
.
nonBlockingCommunication
()
&&
updateAlso
)
// if useNonBlockingComm_ is disabled then communicate here
if communication is required
if
(
requireCommunication_
&&
!
nonBlockingComm_
.
nonBlockingCommunication
()
)
{
// communicate calculated function
dest
.
communicate
();
if
(
&
dest
)
// could also be reference to NULL
{
// communicate calculated function
dest
.
communicate
();
}
}
}
//! return true if communication is necessary and non-blocking should be used
bool
useNonBlockingCommunication
()
const
{
return
requireCommunication_
&&
nonBlockingComm_
.
nonBlockingCommunication
();
}
void
initComm
()
const
{
if
(
nonBlockingComm_
.
n
onBlockingCommunication
()
&&
destination_
)
if
(
useN
onBlockingCommunication
()
&&
destination_
)
nonBlockingComm_
.
initComm
(
destination
()
);
}
void
receiveComm
()
const
{
if
(
nonBlockingComm_
.
n
onBlockingCommunication
()
&&
destination_
)
if
(
useN
onBlockingCommunication
()
&&
destination_
)
nonBlockingComm_
.
receiveComm
(
destination
()
);
}
...
...
@@ -560,7 +564,7 @@ namespace Dune {
// Iterator is of same type as the space iterator
typedef
typename
ThreadIteratorType
::
IteratorType
Iterator
;
if
(
nonBlockingComm_
.
n
onBlockingCommunication
()
)
if
(
useN
onBlockingCommunication
()
)
{
if
(
computeInteriorIntegrals
)
{
...
...
@@ -575,7 +579,7 @@ namespace Dune {
}
// receive ghost data (only master thread)
if
(
thread
==
0
)
if
(
thread
==
0
&&
requireCommunication_
)
{
// RECEIVE DATA, send was done on call of operator() (see pass.hh)
receiveCommunication
(
*
arg_
);
...
...
@@ -694,6 +698,7 @@ namespace Dune {
mutable
size_t
numberOfElements_
;
mutable
bool
firstCall_
;
bool
requireCommunication_
;
const
bool
sumComputeTime_
;
};
//! @}
...
...
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