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
cb425050
Commit
cb425050
authored
13 years ago
by
Matthias Messner
Browse files
Options
Downloads
Patches
Plain Diff
some optimizations in the M2L
parent
2fa2c86c
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/Kernels/Chebyshev/FChebSymKernel.hpp
+52
-1
52 additions, 1 deletion
Src/Kernels/Chebyshev/FChebSymKernel.hpp
Src/Kernels/Chebyshev/FChebSymmetries.hpp
+2
-2
2 additions, 2 deletions
Src/Kernels/Chebyshev/FChebSymmetries.hpp
Tests/testChebAlgorithm.cpp
+2
-2
2 additions, 2 deletions
Tests/testChebAlgorithm.cpp
with
56 additions
and
5 deletions
Src/Kernels/Chebyshev/FChebSymKernel.hpp
+
52
−
1
View file @
cb425050
...
@@ -154,6 +154,57 @@ public:
...
@@ -154,6 +154,57 @@ public:
void
M2L
(
CellClass
*
const
FRestrict
TargetCell
,
const
CellClass
*
SourceCells
[
343
],
const
int
NumSourceCells
,
const
int
TreeLevel
)
{
// permute and copy multipole expansion
memset
(
countExp
,
0
,
sizeof
(
int
)
*
343
);
for
(
unsigned
int
idx
=
0
;
idx
<
343
;
++
idx
)
{
if
(
SourceCells
[
idx
])
{
const
unsigned
int
pidx
=
SymHandler
->
pindices
[
idx
];
const
unsigned
int
count
=
(
countExp
[
pidx
])
++
;
FReal
*
const
mul
=
Mul
[
pidx
]
+
count
*
nnodes
;
const
unsigned
int
*
const
pvec
=
SymHandler
->
pvectors
[
idx
];
const
FReal
*
const
MultiExp
=
SourceCells
[
idx
]
->
getMultipole
();
for
(
unsigned
int
n
=
0
;
n
<
nnodes
;
++
n
)
mul
[
pvec
[
n
]]
=
MultiExp
[
n
];
}
}
// multiply (mat-mat-mul)
FReal
Compressed
[
nnodes
*
30
];
const
FReal
CellWidth
(
AbstractBaseClass
::
BoxWidth
/
FReal
(
FMath
::
pow
(
2
,
TreeLevel
)));
const
FReal
scale
(
AbstractBaseClass
::
MatrixKernel
->
getScaleFactor
(
CellWidth
));
for
(
unsigned
int
pidx
=
0
;
pidx
<
343
;
++
pidx
)
{
const
unsigned
int
count
=
countExp
[
pidx
];
if
(
count
)
{
const
unsigned
int
rank
=
SymHandler
->
LowRank
[
pidx
];
FBlas
::
gemtm
(
nnodes
,
rank
,
count
,
FReal
(
1.
),
SymHandler
->
K
[
pidx
]
+
rank
*
nnodes
,
nnodes
,
Mul
[
pidx
],
nnodes
,
Compressed
,
rank
);
FBlas
::
gemm
(
nnodes
,
rank
,
count
,
scale
,
SymHandler
->
K
[
pidx
],
nnodes
,
Compressed
,
rank
,
Loc
[
pidx
],
nnodes
);
}
}
// permute and add contribution to local expansions
FReal
*
const
LocalExpansion
=
TargetCell
->
getLocal
();
memset
(
countExp
,
0
,
sizeof
(
int
)
*
343
);
for
(
unsigned
int
idx
=
0
;
idx
<
343
;
++
idx
)
{
if
(
SourceCells
[
idx
])
{
const
unsigned
int
pidx
=
SymHandler
->
pindices
[
idx
];
const
unsigned
int
count
=
(
countExp
[
pidx
])
++
;
const
FReal
*
const
loc
=
Loc
[
pidx
]
+
count
*
nnodes
;
const
unsigned
int
*
const
pvec
=
SymHandler
->
pvectors
[
idx
];
for
(
unsigned
int
n
=
0
;
n
<
nnodes
;
++
n
)
LocalExpansion
[
n
]
+=
loc
[
pvec
[
n
]];
}
}
}
/*
void M2L(CellClass* const FRestrict TargetCell,
void M2L(CellClass* const FRestrict TargetCell,
const CellClass* SourceCells[343],
const CellClass* SourceCells[343],
const int NumSourceCells,
const int NumSourceCells,
...
@@ -198,8 +249,8 @@ public:
...
@@ -198,8 +249,8 @@ public:
}
}
}
}
}
}
*/
/*
/*
void M2L(CellClass* const FRestrict TargetCell,
void M2L(CellClass* const FRestrict TargetCell,
...
...
This diff is collapsed.
Click to expand it.
Src/Kernels/Chebyshev/FChebSymmetries.hpp
+
2
−
2
View file @
cb425050
...
@@ -99,8 +99,8 @@ class FChebSymmetries
...
@@ -99,8 +99,8 @@ class FChebSymmetries
const
unsigned
int
getPermutationArrayAndIndex
(
const
int
i
,
const
int
j
,
const
int
k
,
unsigned
int
getPermutationArrayAndIndex
(
const
int
i
,
const
int
j
,
const
int
k
,
unsigned
int
permutation
[
nnodes
])
const
unsigned
int
permutation
[
nnodes
])
const
{
{
// find right quadrant index (if < 0 then 0, else 1)
// find right quadrant index (if < 0 then 0, else 1)
const
unsigned
int
qidx
=
getQuadIdx
(
i
,
j
,
k
);
const
unsigned
int
qidx
=
getQuadIdx
(
i
,
j
,
k
);
...
...
This diff is collapsed.
Click to expand it.
Tests/testChebAlgorithm.cpp
+
2
−
2
View file @
cb425050
...
@@ -105,8 +105,8 @@ int main(int argc, char* argv[])
...
@@ -105,8 +105,8 @@ int main(int argc, char* argv[])
typedef
FChebMatrixKernelR
MatrixKernelClass
;
typedef
FChebMatrixKernelR
MatrixKernelClass
;
typedef
FChebCell
<
ORDER
>
CellClass
;
typedef
FChebCell
<
ORDER
>
CellClass
;
typedef
FOctree
<
ParticleClass
,
CellClass
,
ContainerClass
,
LeafClass
>
OctreeClass
;
typedef
FOctree
<
ParticleClass
,
CellClass
,
ContainerClass
,
LeafClass
>
OctreeClass
;
typedef
FChebKernel
<
ParticleClass
,
CellClass
,
ContainerClass
,
MatrixKernelClass
,
ORDER
>
KernelClass
;
//
typedef FChebKernel<ParticleClass,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
//
typedef FChebSymKernel<ParticleClass,CellClass,ContainerClass,MatrixKernelClass,ORDER> KernelClass;
typedef
FChebSymKernel
<
ParticleClass
,
CellClass
,
ContainerClass
,
MatrixKernelClass
,
ORDER
>
KernelClass
;
//typedef FFmmAlgorithm<OctreeClass,ParticleClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
//typedef FFmmAlgorithm<OctreeClass,ParticleClass,CellClass,ContainerClass,KernelClass,LeafClass> FmmClass;
typedef
FFmmAlgorithmThread
<
OctreeClass
,
ParticleClass
,
CellClass
,
ContainerClass
,
KernelClass
,
LeafClass
>
FmmClass
;
typedef
FFmmAlgorithmThread
<
OctreeClass
,
ParticleClass
,
CellClass
,
ContainerClass
,
KernelClass
,
LeafClass
>
FmmClass
;
...
...
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