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
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
solverstack
ScalFMM
Commits
ae904e8e
Commit
ae904e8e
authored
10 years ago
by
Quentin Khan
Browse files
Options
Downloads
Patches
Plain Diff
Polished doc of FFmmAlgorithm, FFmmAlgorithmThread and FCoreCommon
parent
b76c01e4
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
Src/Core/FCoreCommon.hpp
+9
-8
9 additions, 8 deletions
Src/Core/FCoreCommon.hpp
Src/Core/FFmmAlgorithm.hpp
+28
-23
28 additions, 23 deletions
Src/Core/FFmmAlgorithm.hpp
Src/Core/FFmmAlgorithmThread.hpp
+32
-25
32 additions, 25 deletions
Src/Core/FFmmAlgorithmThread.hpp
with
69 additions
and
56 deletions
Src/Core/FCoreCommon.hpp
+
9
−
8
View file @
ae904e8e
...
...
@@ -38,15 +38,16 @@ enum FFmmOperations {
};
/**
* @brief The FAbstractAlgorithm class
* Is an abstract algorithm to be able to use the FAlgorithmBuilder
* and execute from an abastrct pointer
* \brief Base class of algorithms
*
* This class is an abstract algorithm to be able to use the FAlgorithmBuilder
* and execute from an abstract pointer.
*/
class
FAbstractAlgorithm
{
protected:
//< Where to start the work
int
upperWorkingLevel
;
//< Where to end the work (exclusi
f
)
//< Where to end the work (exclusi
ve
)
int
lowerWorkingLevel
;
//< Height of the tree
int
nbLevelsInTree
;
...
...
@@ -71,7 +72,7 @@ public:
virtual
~
FAbstractAlgorithm
(){
}
/** Execute
all the fmm but
for given levels*/
/** Execute
the whole fmm
for given levels
.
*/
virtual
void
execute
(
const
int
inUpperWorkingLevel
,
const
int
inLowerWorkingLevel
)
final
{
upperWorkingLevel
=
inUpperWorkingLevel
;
lowerWorkingLevel
=
inLowerWorkingLevel
;
...
...
@@ -79,7 +80,7 @@ public:
executeCore
(
FFmmNearAndFarFields
);
}
/** Execute
all th
e fmm */
/** Execute
the whol
e fmm
.
*/
virtual
void
execute
()
final
{
upperWorkingLevel
=
2
;
lowerWorkingLevel
=
nbLevelsInTree
;
...
...
@@ -87,7 +88,7 @@ public:
executeCore
(
FFmmNearAndFarFields
);
}
/** Execute only some FMM operation for given levels */
/** Execute only some FMM operation
s
for given levels
.
*/
virtual
void
execute
(
const
unsigned
operationsToProceed
,
const
int
inUpperWorkingLevel
,
const
int
inLowerWorkingLevel
)
final
{
upperWorkingLevel
=
inUpperWorkingLevel
;
lowerWorkingLevel
=
inLowerWorkingLevel
;
...
...
@@ -95,7 +96,7 @@ public:
executeCore
(
operationsToProceed
);
}
/** Execute only some steps */
/** Execute only some steps
.
*/
virtual
void
execute
(
const
unsigned
operationsToProceed
)
final
{
upperWorkingLevel
=
2
;
lowerWorkingLevel
=
nbLevelsInTree
;
...
...
This diff is collapsed.
Click to expand it.
Src/Core/FFmmAlgorithm.hpp
+
28
−
23
View file @
ae904e8e
...
...
@@ -30,30 +30,32 @@
#include
"FCoreCommon.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FFmmAlgorithm
* @brief
* Please read the license
* \author Berenger Bramas (berenger.bramas@inria.fr)
* \brief Implements a basic FMM algorithm.
*
* This class is a basic FMM algorithm
* It just iterates on a tree and call the kernels with good arguments.
* Please read the license.
*
* Of course this class does not deallocate pointer given in arguements.
* This class runs the FMM algorithm on a tree using the kernels that it was given.
*
* This class does not deallocate pointers given to it constructor.
*/
template
<
class
OctreeClass
,
class
CellClass
,
class
ContainerClass
,
class
KernelClass
,
class
LeafClass
>
class
FFmmAlgorithm
:
public
FAbstractAlgorithm
,
public
FAlgorithmTimers
{
OctreeClass
*
const
tree
;
//< The octree to work on
KernelClass
*
const
kernels
;
//< The kernels
OctreeClass
*
const
tree
;
//
/
< The octree to work on
.
KernelClass
*
const
kernels
;
//
/
< The kernels
.
const
int
OctreeHeight
;
const
int
OctreeHeight
;
///< The height of the given tree.
public:
/** The constructor need the octree and the kernels used for computation
* @param inTree the octree to work on
* @param inKernels the kernels to call
* An assert is launched if one of the arguments is null
*/
/** Class constructor
*
* The constructor needs the octree and the kernels used for computation.
* @param inTree the octree to work on.
* @param inKernels the kernels to call.
*
* \except An exception is thrown if one of the arguments is NULL.
*/
FFmmAlgorithm
(
OctreeClass
*
const
inTree
,
KernelClass
*
const
inKernels
)
:
tree
(
inTree
)
,
kernels
(
inKernels
),
OctreeHeight
(
tree
->
getHeight
())
{
...
...
@@ -71,8 +73,7 @@ public:
protected
:
/**
* To execute the fmm algorithm
* Call this function to run the complete algorithm
* Runs the complete algorithm.
*/
void
executeCore
(
const
unsigned
operationsToProceed
)
override
{
...
...
@@ -101,7 +102,7 @@ protected:
// P2M
/////////////////////////////////////////////////////////////////////////////
/**
P2M
*/
/**
Runs the P2M kernel.
*/
void
bottomPass
(){
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Bottom Pass
\n
"
).
write
(
FLog
::
Flush
)
);
FLOG
(
FTic
counterTime
);
...
...
@@ -112,7 +113,7 @@ protected:
// Iterate on leafs
octreeIterator
.
gotoBottomLeft
();
do
{
// We need the current cell that represent the leaf
// We need the current cell that represent
s
the leaf
// and the list of particles
FLOG
(
computationCounter
.
tic
());
kernels
->
P2M
(
octreeIterator
.
getCurrentCell
()
,
octreeIterator
.
getCurrentListSrc
());
...
...
@@ -127,7 +128,7 @@ protected:
// Upward
/////////////////////////////////////////////////////////////////////////////
/**
M2M
*/
/**
Runs the M2M kernel.
*/
void
upwardPass
(){
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Upward Pass
\n
"
).
write
(
FLog
::
Flush
);
);
FLOG
(
FTic
counterTime
);
...
...
@@ -172,7 +173,7 @@ protected:
// Transfer
/////////////////////////////////////////////////////////////////////////////
/**
M2L
*/
/**
Runs the M2L kernel.
*/
void
transferPass
(){
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Downward Pass (M2L)
\n
"
).
write
(
FLog
::
Flush
);
);
FLOG
(
FTic
counterTime
);
...
...
@@ -218,7 +219,7 @@ protected:
// Downward
/////////////////////////////////////////////////////////////////////////////
/**
L2L
*/
/**
Runs the L2L kernel .
*/
void
downardPass
(){
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Downward Pass (L2L)
\n
"
).
write
(
FLog
::
Flush
);
);
FLOG
(
FTic
counterTime
);
...
...
@@ -261,7 +262,11 @@ protected:
// Direct
/////////////////////////////////////////////////////////////////////////////
/** P2P */
/** Runs the P2P & L2P kernels.
*
* \param p2pEnabled If true, run the P2P kernel.
* \param l2pEnabled If true, run the L2P kernel.
*/
void
directPass
(
const
bool
p2pEnabled
,
const
bool
l2pEnabled
){
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Direct Pass
\n
"
).
write
(
FLog
::
Flush
);
);
FLOG
(
FTic
counterTime
);
...
...
This diff is collapsed.
Click to expand it.
Src/Core/FFmmAlgorithmThread.hpp
+
32
−
25
View file @
ae904e8e
...
...
@@ -31,24 +31,24 @@
#include
<omp.h>
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FFmmAlgorithmThread
* @brief
* Please read the license
* \author Berenger Bramas (berenger.bramas@inria.fr)
* \brief Implements an FMM algorithm threaded using OpenMP.
*
* This class is a threaded FMM algorithm
* It just iterates on a tree and call the kernels with good arguments.
* It used the inspector-executor model :
* iterates on the tree and builds an array to work in parallel on this array
* Please read the license
*
* Of course this class does not deallocate pointer given in arguments.
* This class runs a threaded FMM algorithm. It just iterates on a tree and call
* the kernels with good arguments. The inspector-executor model is used : the
* class iterates on the tree and builds an array and works in parallel on this
* array.
*
* When using this algorithm the P2P is thread safe.
*
* This class does not deallocate pointers given to its constructor.
*/
template
<
class
OctreeClass
,
class
CellClass
,
class
ContainerClass
,
class
KernelClass
,
class
LeafClass
>
class
FFmmAlgorithmThread
:
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,16 +56,19 @@ class FFmmAlgorithmThread : public FAbstractAlgorithm, public FAlgorithmTimers{
static
const
int
SizeShape
=
3
*
3
*
3
;
int
shapeLeaf
[
SizeShape
];
const
int
MaxThreads
;
const
int
MaxThreads
;
///< The maximum number of threads.
const
int
OctreeHeight
;
const
int
OctreeHeight
;
///< The height of the given tree.
public:
/** The constructor need the octree and the kernels used for computation
* @param inTree the octree to work on
* @param inKernels the kernels to call
* An assert is launched if one of the arguments is null
*/
/** Class constructor
*
* The constructor needs the octree and the kernels used for computation.
* \param inTree the octree to work on.
* \param inKernels the kernels to call.
*
* \except An exception is thrown if one of the arguments is NULL.
*/
FFmmAlgorithmThread
(
OctreeClass
*
const
inTree
,
KernelClass
*
const
inKernels
)
:
tree
(
inTree
)
,
kernels
(
nullptr
),
iterArray
(
nullptr
),
leafsNumber
(
0
),
MaxThreads
(
omp_get_max_threads
()),
OctreeHeight
(
tree
->
getHeight
())
{
...
...
@@ -96,8 +99,7 @@ public:
protected
:
/**
* To execute the fmm algorithm
* Call this function to run the complete algorithm
* Runs the complete algorithm.
*/
void
executeCore
(
const
unsigned
operationsToProceed
)
override
{
...
...
@@ -146,7 +148,7 @@ protected:
// P2M
/////////////////////////////////////////////////////////////////////////////
/**
P2M
*/
/**
Runs the P2M kernel.
*/
void
bottomPass
(){
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Bottom Pass
\n
"
).
write
(
FLog
::
Flush
)
);
FLOG
(
FTic
counterTime
);
...
...
@@ -184,7 +186,7 @@ protected:
// Upward
/////////////////////////////////////////////////////////////////////////////
/**
M2M
*/
/**
Runs the M2M kernel.
*/
void
upwardPass
(){
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Upward Pass
\n
"
).
write
(
FLog
::
Flush
);
);
FLOG
(
FTic
counterTime
);
...
...
@@ -241,7 +243,7 @@ protected:
// Transfer
/////////////////////////////////////////////////////////////////////////////
/**
M2L L2L
*/
/**
Runs the M2L kernel.
*/
void
transferPass
(){
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Downward Pass (M2L)
\n
"
).
write
(
FLog
::
Flush
);
);
...
...
@@ -297,7 +299,8 @@ protected:
// Downward
/////////////////////////////////////////////////////////////////////////////
void
downardPass
(){
// second L2L
/** Runs the L2L kernel. */
void
downardPass
(){
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Downward Pass (L2L)
\n
"
).
write
(
FLog
::
Flush
);
);
FLOG
(
FTic
counterTime
);
...
...
@@ -349,7 +352,11 @@ protected:
// Direct
/////////////////////////////////////////////////////////////////////////////
/** P2P */
/** Runs the P2P & L2P kernels.
*
* \param p2pEnabled Run the P2P kernel.
* \param l2pEnabled Run the L2P kernel.
*/
void
directPass
(
const
bool
p2pEnabled
,
const
bool
l2pEnabled
){
FLOG
(
FLog
::
Controller
.
write
(
"
\t
Start Direct Pass
\n
"
).
write
(
FLog
::
Flush
);
);
FLOG
(
FTic
counterTime
);
...
...
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