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
fbc50cd8
There was a problem fetching the pipeline summary.
Commit
fbc50cd8
authored
7 years ago
by
Olivier COULAUD
Browse files
Options
Downloads
Patches
Plain Diff
Fix compilation problem
parent
c7901144
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Examples/MPIInterpolationFMM.hpp
+66
-62
66 additions, 62 deletions
Examples/MPIInterpolationFMM.hpp
with
66 additions
and
62 deletions
Examples/MPIInterpolationFMM.hpp
+
66
−
62
View file @
fbc50cd8
...
...
@@ -207,8 +207,11 @@ int main(int argc, char* argv[])
<<
" readinsert-time-max:"
<<
maxTime
<<
std
::
endl
;
}
}
// -----------------------------------------------------
}
// -----------------------------------------------------
std
::
vector
<
MortonIndex
>
mortonLeafDistribution
(
2
*
app
.
global
().
processCount
());
FAbstractAlgorithm
*
algorithm
=
nullptr
;
FAlgorithmTimers
*
timer
=
nullptr
;
{
// -----------------------------------------------------
std
::
cout
<<
"
\n
"
<<
interpolationType
<<
" FMM Proc (ORDER="
<<
ORDER
<<
") ... "
<<
std
::
endl
;
...
...
@@ -216,8 +219,7 @@ int main(int argc, char* argv[])
// Kernels to use (pointer because of the limited size of the stack)
FAbstractAlgorithm
*
algorithm
=
nullptr
;
FAlgorithmTimers
*
timer
=
nullptr
;
// non periodic FMM algorithm
std
::
unique_ptr
<
KernelClass
>
kernelsNoPer
(
new
KernelClass
(
TreeHeight
,
loader
.
getBoxWidth
(),
loader
.
getCenterOfBox
(),
&
MatrixKernel
));
...
...
@@ -252,68 +254,70 @@ int main(int argc, char* argv[])
std
::
cout
<<
"exec-time-min:"
<<
minTime
<<
" exec-time-max:"
<<
maxTime
<<
std
::
endl
;
}
// -----------------------------------------------------
//
// Some output
//
//
{
// -----------------------------------------------------
FSize
N1
=
0
,
N2
=
loader
.
getNumberOfParticles
()
/
2
,
N3
=
(
loader
.
getNumberOfParticles
()
-
1
);
;
FReal
energy
=
0.0
;
//
// Loop over all leaves
//
std
::
cout
<<
std
::
endl
<<
" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "
<<
std
::
endl
;
std
::
cout
<<
std
::
scientific
;
std
::
cout
.
precision
(
10
)
;
tree
.
forEachLeaf
([
&
](
LeafClass
*
leaf
){
const
FReal
*
const
posX
=
leaf
->
getTargets
()
->
getPositions
()[
0
];
const
FReal
*
const
posY
=
leaf
->
getTargets
()
->
getPositions
()[
1
];
const
FReal
*
const
posZ
=
leaf
->
getTargets
()
->
getPositions
()[
2
];
const
FReal
*
const
potentials
=
leaf
->
getTargets
()
->
getPotentials
();
const
FReal
*
const
forcesX
=
leaf
->
getTargets
()
->
getForcesX
();
const
FReal
*
const
forcesY
=
leaf
->
getTargets
()
->
getForcesY
();
const
FReal
*
const
forcesZ
=
leaf
->
getTargets
()
->
getForcesZ
();
const
FSize
nbParticlesInLeaf
=
leaf
->
getTargets
()
->
getNbParticles
();
const
FReal
*
const
physicalValues
=
leaf
->
getTargets
()
->
getPhysicalValues
();
const
FVector
<
FSize
>&
indexes
=
leaf
->
getTargets
()
->
getIndexes
();
for
(
FSize
idxPart
=
0
;
idxPart
<
nbParticlesInLeaf
;
++
idxPart
){
const
FSize
indexPartOrig
=
indexes
[
idxPart
];
if
((
indexPartOrig
==
N1
)
||
(
indexPartOrig
==
N2
)
||
(
indexPartOrig
==
N3
)
)
{
std
::
cout
<<
"Proc "
<<
app
.
global
().
processId
()
<<
" Index "
<<
indexPartOrig
<<
" potential "
<<
potentials
[
idxPart
]
<<
" Pos "
<<
posX
[
idxPart
]
<<
" "
<<
posY
[
idxPart
]
<<
" "
<<
posZ
[
idxPart
]
<<
" Forces: "
<<
forcesX
[
idxPart
]
<<
" "
<<
forcesY
[
idxPart
]
<<
" "
<<
forcesZ
[
idxPart
]
<<
std
::
endl
;
}
energy
+=
potentials
[
idxPart
]
*
physicalValues
[
idxPart
]
;
}
});
FReal
gloEnergy
=
app
.
global
().
reduceSum
(
energy
);
if
(
0
==
app
.
global
().
processId
()){
std
::
cout
<<
std
::
endl
<<
"Proc "
<<
app
.
global
().
processId
()
<<
" Energy: "
<<
gloEnergy
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "
<<
std
::
endl
<<
std
::
endl
;
}
}
// -----------------------------------------------------
if
(
FParameters
::
existParameter
(
argc
,
argv
,
FParameterDefinitions
::
OutputFile
.
options
)){
algorithm
->
getAndBuildMortonIndexAtLeaf
(
mortonLeafDistribution
);
//
if
(
app
.
global
().
processId
()
==
0
)
{
std
::
cout
<<
" Morton distribution "
<<
std
::
endl
;
for
(
auto
v
:
mortonLeafDistribution
)
std
::
cout
<<
v
<<
" "
;
std
::
cout
<<
std
::
endl
;
// -----------------------------------------------------
//
// Some output
//
//
{
// -----------------------------------------------------
FSize
N1
=
0
,
N2
=
loader
.
getNumberOfParticles
()
/
2
,
N3
=
(
loader
.
getNumberOfParticles
()
-
1
);
;
FReal
energy
=
0.0
;
//
// Loop over all leaves
//
std
::
cout
<<
std
::
endl
<<
" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "
<<
std
::
endl
;
std
::
cout
<<
std
::
scientific
;
std
::
cout
.
precision
(
10
)
;
tree
.
forEachLeaf
([
&
](
LeafClass
*
leaf
){
const
FReal
*
const
posX
=
leaf
->
getTargets
()
->
getPositions
()[
0
];
const
FReal
*
const
posY
=
leaf
->
getTargets
()
->
getPositions
()[
1
];
const
FReal
*
const
posZ
=
leaf
->
getTargets
()
->
getPositions
()[
2
];
const
FReal
*
const
potentials
=
leaf
->
getTargets
()
->
getPotentials
();
const
FReal
*
const
forcesX
=
leaf
->
getTargets
()
->
getForcesX
();
const
FReal
*
const
forcesY
=
leaf
->
getTargets
()
->
getForcesY
();
const
FReal
*
const
forcesZ
=
leaf
->
getTargets
()
->
getForcesZ
();
const
FSize
nbParticlesInLeaf
=
leaf
->
getTargets
()
->
getNbParticles
();
const
FReal
*
const
physicalValues
=
leaf
->
getTargets
()
->
getPhysicalValues
();
const
FVector
<
FSize
>&
indexes
=
leaf
->
getTargets
()
->
getIndexes
();
for
(
FSize
idxPart
=
0
;
idxPart
<
nbParticlesInLeaf
;
++
idxPart
){
const
FSize
indexPartOrig
=
indexes
[
idxPart
];
if
((
indexPartOrig
==
N1
)
||
(
indexPartOrig
==
N2
)
||
(
indexPartOrig
==
N3
)
)
{
std
::
cout
<<
"Proc "
<<
app
.
global
().
processId
()
<<
" Index "
<<
indexPartOrig
<<
" potential "
<<
potentials
[
idxPart
]
<<
" Pos "
<<
posX
[
idxPart
]
<<
" "
<<
posY
[
idxPart
]
<<
" "
<<
posZ
[
idxPart
]
<<
" Forces: "
<<
forcesX
[
idxPart
]
<<
" "
<<
forcesY
[
idxPart
]
<<
" "
<<
forcesZ
[
idxPart
]
<<
std
::
endl
;
}
std
::
string
name
(
FParameters
::
getStr
(
argc
,
argv
,
FParameterDefinitions
::
OutputFile
.
options
,
"output.fma"
));
FMpiFmaGenericWriter
<
FReal
>
paraWriter
(
name
,
app
);
paraWriter
.
writeDistributionOfParticlesFromOctree
(
tree
,
loader
.
getNumberOfParticles
(),
localParticlesNumber
,
mortonLeafDistribution
);
energy
+=
potentials
[
idxPart
]
*
physicalValues
[
idxPart
]
;
}
});
FReal
gloEnergy
=
app
.
global
().
reduceSum
(
energy
);
if
(
0
==
app
.
global
().
processId
()){
std
::
cout
<<
std
::
endl
<<
"Proc "
<<
app
.
global
().
processId
()
<<
" Energy: "
<<
gloEnergy
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
" &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "
<<
std
::
endl
<<
std
::
endl
;
}
}
// -----------------------------------------------------
if
(
FParameters
::
existParameter
(
argc
,
argv
,
FParameterDefinitions
::
OutputFile
.
options
)){
algorithm
->
getAndBuildMortonIndexAtLeaf
(
mortonLeafDistribution
);
//
if
(
app
.
global
().
processId
()
==
0
)
{
std
::
cout
<<
" Morton distribution "
<<
std
::
endl
;
for
(
auto
v
:
mortonLeafDistribution
)
std
::
cout
<<
v
<<
" "
;
std
::
cout
<<
std
::
endl
;
}
return
0
;
std
::
string
name
(
FParameters
::
getStr
(
argc
,
argv
,
FParameterDefinitions
::
OutputFile
.
options
,
"output.fma"
));
FMpiFmaGenericWriter
<
FReal
>
paraWriter
(
name
,
app
);
paraWriter
.
writeDistributionOfParticlesFromOctree
(
tree
,
loader
.
getNumberOfParticles
(),
localParticlesNumber
,
mortonLeafDistribution
);
}
return
0
;
}
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