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
f1c73fe2
Commit
f1c73fe2
authored
7 years ago
by
Olivier COULAUD
Browse files
Options
Downloads
Patches
Plain Diff
add output for debug purpose
parent
f3683c88
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/MPIInterpolationFMM.hpp
+25
-10
25 additions, 10 deletions
Examples/MPIInterpolationFMM.hpp
with
25 additions
and
10 deletions
Examples/MPIInterpolationFMM.hpp
+
25
−
10
View file @
f1c73fe2
...
@@ -70,7 +70,7 @@ using FmmClassProcPER = FFmmAlgorithmThreadProcPeriodic<FReal,OctreeClass,CellC
...
@@ -70,7 +70,7 @@ using FmmClassProcPER = FFmmAlgorithmThreadProcPeriodic<FReal,OctreeClass,CellC
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
///////// PARAMETERS HANDLING //////////////////////////////////////
///////// PARAMETERS HANDLING //////////////////////////////////////
//
const FParameterNames
L
ocal
OptionPeriodicDeep { {"-periodic
","-
per
"}, "
Perdiodic boundary condition (-per 5) the box grow
by a facor
(3L)^5
"};
const
FParameterNames
l
ocal
IncreaseBox
=
{
{
"ratio
"
,
"-
L
"
},
"
Increase teh Box size
by a fac
t
or
L:= ratio
"
};
FHelpDescribeAndExit
(
argc
,
argv
,
FHelpDescribeAndExit
(
argc
,
argv
,
"Driver for Chebyshev Interpolation kernel using MPI (1/r kernel). "
"Driver for Chebyshev Interpolation kernel using MPI (1/r kernel). "
"Usully run using : mpirun -np nb_proc_needed ./ChebyshevInterpolationAlgorithm [params]."
,
"Usully run using : mpirun -np nb_proc_needed ./ChebyshevInterpolationAlgorithm [params]."
,
...
@@ -79,7 +79,10 @@ int main(int argc, char* argv[])
...
@@ -79,7 +79,10 @@ int main(int argc, char* argv[])
FParameterDefinitions
::
InputFile
,
FParameterDefinitions
::
InputFile
,
FParameterDefinitions
::
OutputFile
,
FParameterDefinitions
::
OutputFile
,
FParameterDefinitions
::
NbThreads
,
FParameterDefinitions
::
NbThreads
,
FParameterDefinitions
::
PeriodicityNbLevels
);
FParameterDefinitions
::
PeriodicityNbLevels
,
localIncreaseBox
)
;
const
std
::
string
defaultFile
(
"../Data/test20k.fma"
);
const
std
::
string
defaultFile
(
"../Data/test20k.fma"
);
const
std
::
string
filename
=
FParameters
::
getStr
(
argc
,
argv
,
FParameterDefinitions
::
InputFile
.
options
,
defaultFile
.
c_str
());
const
std
::
string
filename
=
FParameters
::
getStr
(
argc
,
argv
,
FParameterDefinitions
::
InputFile
.
options
,
defaultFile
.
c_str
());
...
@@ -121,16 +124,25 @@ int main(int argc, char* argv[])
...
@@ -121,16 +124,25 @@ int main(int argc, char* argv[])
if
(
!
loader
.
isOpen
())
{
if
(
!
loader
.
isOpen
())
{
throw
std
::
runtime_error
(
"Particle file couldn't be opened!"
)
;
throw
std
::
runtime_error
(
"Particle file couldn't be opened!"
)
;
}
}
auto
boxWidth
=
loader
.
getBoxWidth
()
;
//
if
(
FParameters
::
existParameter
(
argc
,
argv
,
localIncreaseBox
.
options
)){
FReal
ratio
=
FParameters
::
getValue
(
argc
,
argv
,
localIncreaseBox
.
options
,
1.0
);
boxWidth
*=
ratio
;
}
// Initialize empty oct-tree
// Initialize empty oct-tree
OctreeClass
tree
(
TreeHeight
,
SubTreeHeight
,
loader
.
getB
oxWidth
()
,
loader
.
getCenterOfBox
());
OctreeClass
tree
(
TreeHeight
,
SubTreeHeight
,
b
oxWidth
,
loader
.
getCenterOfBox
());
FSize
localParticlesNumber
=
0
;
FSize
localParticlesNumber
=
0
;
{
// -----------------------------------------------------
{
// -----------------------------------------------------
if
(
app
.
global
().
processId
()
==
0
){
if
(
app
.
global
().
processId
()
==
0
){
std
::
cout
<<
"Loading & Inserting "
<<
loader
.
getNumberOfParticles
()
std
::
cout
<<
"Loading & Inserting "
<<
loader
.
getNumberOfParticles
()
<<
" particles ..."
<<
std
::
endl
;
<<
" particles ..."
<<
std
::
endl
<<
" Box: "
<<
std
::
endl
<<
" width "
<<
boxWidth
<<
std
::
endl
<<
" Centre "
<<
loader
.
getCenterOfBox
()
<<
std
::
endl
;
std
::
cout
<<
"
\t
Height : "
<<
TreeHeight
<<
"
\t
sub-height : "
<<
SubTreeHeight
<<
std
::
endl
;
std
::
cout
<<
"
\t
Height : "
<<
TreeHeight
<<
"
\t
sub-height : "
<<
SubTreeHeight
<<
std
::
endl
;
}
}
time
.
tic
();
time
.
tic
();
...
@@ -221,7 +233,7 @@ int main(int argc, char* argv[])
...
@@ -221,7 +233,7 @@ int main(int argc, char* argv[])
// non periodic FMM algorithm
// non periodic FMM algorithm
std
::
unique_ptr
<
KernelClass
>
kernelsNoPer
(
new
KernelClass
(
TreeHeight
,
loader
.
getB
oxWidth
()
,
std
::
unique_ptr
<
KernelClass
>
kernelsNoPer
(
new
KernelClass
(
TreeHeight
,
b
oxWidth
,
loader
.
getCenterOfBox
(),
&
MatrixKernel
));
loader
.
getCenterOfBox
(),
&
MatrixKernel
));
FmmClassProc
algoNoPer
(
app
.
global
(),
&
tree
,
kernelsNoPer
.
get
());
FmmClassProc
algoNoPer
(
app
.
global
(),
&
tree
,
kernelsNoPer
.
get
());
//
//
...
@@ -240,8 +252,8 @@ int main(int argc, char* argv[])
...
@@ -240,8 +252,8 @@ int main(int argc, char* argv[])
//timer = &algoPer ;
//timer = &algoPer ;
}
}
//
//
// FMM exectution FFmmFarField
// FMM exectution FFmmFarField
FFmmNearField
algorithm
->
execute
();
algorithm
->
execute
(
FFmmNearField
);
//
//
time
.
tac
();
time
.
tac
();
...
@@ -270,7 +282,9 @@ FReal energy =0.0 ;
...
@@ -270,7 +282,9 @@ FReal energy =0.0 ;
//
//
std
::
cout
<<
std
::
endl
<<
" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "
<<
std
::
endl
;
std
::
cout
<<
std
::
scientific
;
std
::
cout
<<
std
::
scientific
;
std
::
cout
.
precision
(
10
)
;
std
::
cout
.
precision
(
15
)
;
FReal
TotalPhysicalValue
=
0.0
;
tree
.
forEachLeaf
([
&
](
LeafClass
*
leaf
){
tree
.
forEachLeaf
([
&
](
LeafClass
*
leaf
){
const
FReal
*
const
posX
=
leaf
->
getTargets
()
->
getPositions
()[
0
];
const
FReal
*
const
posX
=
leaf
->
getTargets
()
->
getPositions
()[
0
];
...
@@ -294,11 +308,12 @@ tree.forEachLeaf([&](LeafClass* leaf){
...
@@ -294,11 +308,12 @@ tree.forEachLeaf([&](LeafClass* leaf){
<<
" Forces: "
<<
forcesX
[
idxPart
]
<<
" "
<<
forcesY
[
idxPart
]
<<
" "
<<
forcesZ
[
idxPart
]
<<
std
::
endl
;
<<
" Forces: "
<<
forcesX
[
idxPart
]
<<
" "
<<
forcesY
[
idxPart
]
<<
" "
<<
forcesZ
[
idxPart
]
<<
std
::
endl
;
}
}
energy
+=
potentials
[
idxPart
]
*
physicalValues
[
idxPart
]
;
energy
+=
potentials
[
idxPart
]
*
physicalValues
[
idxPart
]
;
TotalPhysicalValue
+=
physicalValues
[
idxPart
]
;
}
}
});
});
FReal
gloEnergy
=
app
.
global
().
reduceSum
(
energy
);
FReal
gloEnergy
=
app
.
global
().
reduceSum
(
energy
);
if
(
0
==
app
.
global
().
processId
()){
if
(
0
==
app
.
global
().
processId
()){
std
::
cout
<<
std
::
endl
<<
"Proc "
<<
app
.
global
().
processId
()
<<
" Energy: "
<<
gloEnergy
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"aboveRoot: "
<<
aboveTree
<<
" Energy: "
<<
energy
<<
" TotalPhysicalValue: "
<<
TotalPhysicalValue
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"Proc "
<<
app
.
global
().
processId
()
<<
" Energy: "
<<
gloEnergy
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "
<<
std
::
endl
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "
<<
std
::
endl
<<
std
::
endl
;
}
}
}
}
...
...
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