Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ScalFMM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
solverstack
ScalFMM
Commits
b867235a
Commit
b867235a
authored
10 years ago
by
Quentin Khan
Browse files
Options
Downloads
Patches
Plain Diff
FFmmAlgorithmThreadBalanced L2L done
parent
726c803b
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
Examples/FFmmAlgorithmThreadBalanced.hpp
+34
-16
34 additions, 16 deletions
Examples/FFmmAlgorithmThreadBalanced.hpp
with
34 additions
and
16 deletions
Examples/FFmmAlgorithmThreadBalanced.hpp
+
34
−
16
View file @
b867235a
...
@@ -447,38 +447,56 @@ protected:
...
@@ -447,38 +447,56 @@ protected:
FLOG
(
FTic
counterTime
);
FLOG
(
FTic
counterTime
);
FLOG
(
FTic
computationCounter
);
FLOG
(
FTic
computationCounter
);
typename
OctreeClass
::
Iterator
octreeIterator
(
tree
);
Tree
Iterator
octreeIterator
(
tree
);
octreeIterator
.
moveDown
();
octreeIterator
.
moveDown
();
for
(
int
idxLevel
=
2
;
idxLevel
<
FAbstractAlgorithm
::
upperWorkingLevel
;
++
idxLevel
){
for
(
int
idxLevel
=
2
;
idxLevel
<
FAbstractAlgorithm
::
upperWorkingLevel
;
++
idxLevel
){
octreeIterator
.
moveDown
();
octreeIterator
.
moveDown
();
}
}
typename
OctreeClass
::
Iterator
avoidGotoLeftIterator
(
octreeIterator
);
Tree
Iterator
avoidGotoLeftIterator
(
octreeIterator
);
const
int
heightMinusOne
=
FAbstractAlgorithm
::
lowerWorkingLevel
-
1
;
const
int
heightMinusOne
=
FAbstractAlgorithm
::
lowerWorkingLevel
-
1
;
// for each levels excepted leaf level
// for each levels excepted leaf level
for
(
int
idxLevel
=
FAbstractAlgorithm
::
upperWorkingLevel
;
idxLevel
<
heightMinusOne
;
++
idxLevel
){
for
(
int
idxLevel
=
FAbstractAlgorithm
::
upperWorkingLevel
;
idxLevel
<
heightMinusOne
;
++
idxLevel
)
{
FLOG
(
FTic
counterTimeLevel
);
FLOG
(
FTic
counterTimeLevel
);
int
numberOfCells
=
0
;
// for each cells
std
::
vector
<
std
::
pair
<
TreeIterator
,
int
>
>
iterVector
;
do
{
// Find iterators to leaf portion of each zone.
iterArray
[
numberOfCells
]
=
octreeIterator
;
for
(
std
::
vector
<
ZoneBoundClass
>
zone
:
costzones
)
{
++
numberOfCells
;
iterVector
.
push_back
(
}
while
(
octreeIterator
.
moveRight
());
std
::
pair
<
TreeIterator
,
int
>
(
avoidGotoLeftIterator
.
moveDown
();
octreeIterator
,
// Iterator to the current cell
octreeIterator
=
avoidGotoLeftIterator
;
zone
[
idxLevel
].
second
));
// Cell count in zone
// Get iterator to end of zone (which is the first of the next zone)
for
(
int
idx
=
0
;
idx
<
zone
[
idxLevel
].
second
;
idx
++
)
{
octreeIterator
.
moveRight
();
}
}
octreeIterator
.
gotoLeft
();
octreeIterator
.
moveDown
();
FLOG
(
computationCounter
.
tic
());
FLOG
(
computationCounter
.
tic
());
const
int
chunkSize
=
FMath
::
Max
(
1
,
numberOfCells
/
(
omp_get_max_threads
()
*
omp_get_max_threads
()));
#pragma omp parallel
#pragma omp parallel
{
{
KernelClass
*
const
myThreadkernels
=
kernels
[
omp_get_thread_num
()];
const
int
threadNum
=
omp_get_thread_num
();
#pragma omp for nowait schedule(dynamic, chunkSize)
KernelClass
*
const
myThreadkernels
=
kernels
[
threadNum
];
for
(
int
idxCell
=
0
;
idxCell
<
numberOfCells
;
++
idxCell
){
TreeIterator
zoneIterator
=
iterVector
[
threadNum
].
first
;
myThreadkernels
->
L2L
(
iterArray
[
idxCell
].
getCurrentCell
()
,
iterArray
[
idxCell
].
getCurrentChild
(),
idxLevel
);
int
zoneCellCount
=
iterVector
[
threadNum
].
second
;
while
(
zoneCellCount
--
>
0
)
{
myThreadkernels
->
L2L
(
zoneIterator
.
getCurrentCell
(),
zoneIterator
.
getCurrentChild
(),
idxLevel
);
zoneIterator
.
moveRight
();
}
}
}
}
FLOG
(
computationCounter
.
tac
());
FLOG
(
computationCounter
.
tac
());
FLOG
(
FLog
::
Controller
<<
"
\t\t
>> Level "
<<
idxLevel
<<
" = "
<<
counterTimeLevel
.
tacAndElapsed
()
<<
"s
\n
"
);
FLOG
(
FLog
::
Controller
<<
"
\t\t
>> Level "
<<
idxLevel
<<
" = "
<<
counterTimeLevel
.
tacAndElapsed
()
<<
"s
\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