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
4153e622
Commit
4153e622
authored
10 years ago
by
Quentin Khan
Browse files
Options
Downloads
Patches
Plain Diff
Various fixes for CostZones FChebBalanceSymKernel and FFmmAlgorithmThreadBalanced
parent
dd7d91e7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Examples/CostZones.hpp
+2
-0
2 additions, 0 deletions
Examples/CostZones.hpp
Examples/FChebBalanceSymKernel.hpp
+23
-11
23 additions, 11 deletions
Examples/FChebBalanceSymKernel.hpp
Examples/FFmmAlgorithmThreadBalanced.hpp
+17
-14
17 additions, 14 deletions
Examples/FFmmAlgorithmThreadBalanced.hpp
with
42 additions
and
25 deletions
Examples/CostZones.hpp
+
2
−
0
View file @
4153e622
#ifndef _COSTZONES_HPP_
#define _COSTZONES_HPP_
#include
"FChebBalanceSymKernel.hpp"
/**
* \brief The costzones algorithm implementation.
* \author Quentin Khan <quentin.khan@inria.fr>
...
...
This diff is collapsed.
Click to expand it.
Examples/FChebBalanceSymKernel.hpp
+
23
−
11
View file @
4153e622
...
...
@@ -30,20 +30,38 @@
class
FTreeCoordinate
;
/**
* \author Quentin Khan
* \brief Cell with a cost memory for balance computations.
*
* This class extends FBasicCell to add simple computation cost memory.
*/
class
FCostCell
:
public
FBasicCell
{
/// The cost of the cell. It is declared mutable because the existing
/// algorithms use const cells.
mutable
long
int
_cost
=
0
;
public:
/// Debug member, used to check whether the cell was already visited.
bool
_visited
=
false
;
/**
* \brief Gets the cost of the cell.
* \return The cost of the cell
*/
long
int
getCost
()
const
{
return
_cost
;
}
/**
* Sets the cost of the cell.
* \return The cost of the cell
*/
long
int
setCost
(
int
newCost
)
{
_cost
=
newCost
;
return
_cost
;
}
/**
* Add a cost to the cell.
* \warning Can be used on const cells !
*/
long
int
addCost
(
int
addCost
)
const
{
_cost
+=
addCost
;
return
_cost
;
...
...
@@ -51,7 +69,7 @@ public:
};
/**
* \author Quentin Khan, Matthias Messner (original file)
* \author Quentin Khan, Matthias Messner (original file
: FChebFlopsSymKernel
)
* \brief Cost computation of Chebyshev interpolation based FMM.
*
* Please read the license
...
...
@@ -80,10 +98,11 @@ public:
const
FSmartPointer
<
MatrixKernelClass
,
FSmartPointerMemory
>
MatrixKernel
;
const
FSmartPointer
<
SymmetryHandler
,
FSmartPointerMemory
>
SymHandler
;
///
/// The tree the kernel is working on. Needed to attain cells in the P2P
/// operator (we only get the particles containers otherwise)
OctreeClass
*
_tree
;
/// tree height
///
The
tree height
const
unsigned
int
_treeHeight
;
/// count permuted local and multipole expansions
...
...
@@ -358,13 +377,6 @@ public:
/**
* Handler to deal with all symmetries: Stores permutation indices and vectors
* to reduce 343 different interactions to 16 only.
...
...
This diff is collapsed.
Click to expand it.
Examples/FFmmAlgorithmThreadBalanced.hpp
+
17
−
14
View file @
4153e622
...
...
@@ -47,8 +47,8 @@
*/
template
<
class
OctreeClass
,
class
CellClass
,
class
ContainerClass
,
class
KernelClass
,
class
LeafClass
>
class
FFmmAlgorithmThreadBalanced
:
public
FAbstractAlgorithm
,
public
FAlgorithmTimers
{
OctreeClass
*
const
tree
;
///< The octree to work on.
KernelClass
**
kernels
;
///< The kernels.
OctreeClass
*
const
tree
;
///< The octree to work on.
KernelClass
**
kernels
;
///< The kernels.
typename
OctreeClass
::
Iterator
*
iterArray
;
int
leafsNumber
;
...
...
@@ -56,10 +56,12 @@ class FFmmAlgorithmThreadBalanced : public FAbstractAlgorithm, public FAlgorithm
static
const
int
SizeShape
=
3
*
3
*
3
;
int
shapeLeaf
[
SizeShape
];
const
int
MaxThreads
;
///< The maximum number of threads.
const
int
OctreeHeight
;
///< The height of the given tree.
const
int
MaxThreads
;
///< The maximum number of threads.
const
int
OctreeHeight
;
///< The height of the given tree.
/// The vector containing the costzones
const
std
::
vector
<
std
::
vector
<
int
,
int
>>
costzones
;
public:
/** Class constructor
*
...
...
@@ -69,21 +71,22 @@ public:
*
* \except An exception is thrown if one of the arguments is NULL.
*/
FFmmAlgorithmThreadBalanced
(
OctreeClass
*
const
inTree
,
KernelClass
*
const
inKernels
)
:
tree
(
inTree
)
,
kernels
(
nullptr
),
iterArray
(
nullptr
),
leafsNumber
(
0
),
MaxThreads
(
omp_get_max_threads
()),
OctreeHeight
(
tree
->
getHeight
())
{
FFmmAlgorithmThreadBalanced
(
OctreeClass
*
const
inTree
,
KernelClass
*
const
inKernels
,
const
std
::
vector
<
std
::
vector
<
int
,
int
>>
)
:
tree
(
inTree
)
,
kernels
(
nullptr
),
iterArray
(
nullptr
),
leafsNumber
(
0
),
MaxThreads
(
omp_get_max_threads
()),
OctreeHeight
(
tree
->
getHeight
())
{
FAssertLF
(
tree
,
"tree cannot be null"
);
this
->
kernels
=
new
KernelClass
*
[
MaxThreads
];
#pragma omp parallel for schedule(static)
for
(
int
idxThread
=
0
;
idxThread
<
MaxThreads
;
++
idxThread
)
{
#pragma omp critical (InitFFmmAlgorithmThreadBalanced)
#pragma omp critical (InitFFmmAlgorithmThreadBalanced)
{
this
->
kernels
[
idxThread
]
=
new
KernelClass
(
*
inKernels
);
}
...
...
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