Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VirtualFluids
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
iRMB
VirtualFluids
Commits
f0d468e9
Commit
f0d468e9
authored
3 years ago
by
Anna Wellmann
Browse files
Options
Downloads
Patches
Plain Diff
Setup for weak scaling on multiple levels
parent
711f58da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!104
Add Communication Hiding to GPU version
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/gpu/LBM/SphereScaling/SphereScaling.cpp
+61
-52
61 additions, 52 deletions
apps/gpu/LBM/SphereScaling/SphereScaling.cpp
src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp
+1
-1
1 addition, 1 deletion
src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp
with
62 additions
and
53 deletions
apps/gpu/LBM/SphereScaling/SphereScaling.cpp
+
61
−
52
View file @
f0d468e9
...
...
@@ -119,7 +119,7 @@ void multipleLevel(const std::string& configPath)
bool
useGridGenerator
=
true
;
bool
useStreams
=
true
;
bool
useLevels
=
fals
e
;
bool
useLevels
=
tru
e
;
para
->
useReducedCommunicationAfterFtoC
=
true
;
std
::
string
scalingType
=
"weak"
;
// "strong" // "weak"
...
...
@@ -196,9 +196,9 @@ void multipleLevel(const std::string& configPath)
if
(
useGridGenerator
)
{
real
sideLengthCube
;
if
(
useLevels
)
sideLengthCube
=
38
;
sideLengthCube
=
76
;
else
sideLengthCube
=
60
;
sideLengthCube
=
86
;
// 60, 80 läuft
real
xGridMin
=
0.0
;
real
xGridMax
=
sideLengthCube
;
real
yGridMin
=
0.0
;
...
...
@@ -218,8 +218,14 @@ void multipleLevel(const std::string& configPath)
real
zSplit
=
0.5
*
sideLengthCube
;
if
(
scalingType
==
"weak"
){
zSplit
=
zGridMax
;
zGridMax
=
zGridMax
+
sideLengthCube
;
if
(
useLevels
)
{
dxGrid
=
dxGrid
/
pow
(
2.0
,
(
1.0
/
3.0
));
// dxGrid = round(dxGrid*100.0)/100.0 // round to tow decimal places
}
else
{
zSplit
=
zGridMax
;
zGridMax
=
zGridMax
+
sideLengthCube
;
}
}
if
(
generatePart
==
0
)
{
...
...
@@ -233,13 +239,9 @@ void multipleLevel(const std::string& configPath)
if
(
useLevels
)
{
gridBuilder
->
addGrid
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphereLev1
),
1
);
if
(
scalingType
==
"weak"
)
std
::
cout
<<
"weak scaling not implemented for multiple levels"
;
}
if
(
scalingType
==
"strong"
){
gridBuilder
->
addGeometry
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphere
));
}
else
if
(
scalingType
==
"weak"
){
if
(
scalingType
==
"weak"
&&
!
useLevels
)
{
// Sphere* sphere1 = new Sphere(0.5 * sideLengthCube, 0.5 * sideLengthCube, 0.5 * sideLengthCube, dSphere);
// Sphere* sphere2 = new Sphere(0.5 * sideLengthCube, 0.5 * sideLengthCube, 1.5 * sideLengthCube, dSphere);
// auto conglo = Conglomerate::makeShared();
...
...
@@ -249,6 +251,8 @@ void multipleLevel(const std::string& configPath)
TriangularMesh
*
sphereSTL
=
TriangularMesh
::
make
(
stlPath
+
"Spheres_2GPU.stl"
);
gridBuilder
->
addGeometry
(
sphereSTL
);
}
else
{
gridBuilder
->
addGeometry
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphere
));
}
if
(
generatePart
==
0
)
...
...
@@ -284,18 +288,21 @@ void multipleLevel(const std::string& configPath)
//////////////////////////////////////////////////////////////////////////
}
else
if
(
comm
->
getNummberOfProcess
()
==
4
)
{
real
ySplit
;
real
zSplit
;
if
(
scalingType
==
"strong"
){
ySplit
=
0.5
*
sideLengthCube
;
zSplit
=
0.5
*
sideLengthCube
;
}
else
if
(
scalingType
==
"weak"
){
ySplit
=
yGridMax
;
yGridMax
=
yGridMax
+
(
yGridMax
-
yGridMin
);
zSplit
=
zGridMax
;
zGridMax
=
zGridMax
+
(
zGridMax
-
zGridMin
);
};
real
ySplit
=
0.5
*
sideLengthCube
;
real
zSplit
=
0.5
*
sideLengthCube
;
if
(
scalingType
==
"weak"
)
{
if
(
useLevels
){
dxGrid
=
dxGrid
/
pow
(
2.0
,
(
2.0
/
3.0
));
// dxGrid = round(dxGrid*100.0)/100.0 // round to tow decimal places
}
else
{
ySplit
=
yGridMax
;
yGridMax
=
yGridMax
+
(
yGridMax
-
yGridMin
);
zSplit
=
zGridMax
;
zGridMax
=
zGridMax
+
(
zGridMax
-
zGridMin
);
}
}
if
(
generatePart
==
0
)
{
gridBuilder
->
addCoarseGrid
(
xGridMin
,
yGridMin
,
zGridMin
,
xGridMax
,
ySplit
+
overlap
,
...
...
@@ -316,15 +323,13 @@ void multipleLevel(const std::string& configPath)
if
(
useLevels
)
{
gridBuilder
->
addGrid
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphereLev1
),
1
);
if
(
scalingType
==
"weak"
)
std
::
cout
<<
"weak scaling not implemented for multiple levels"
;
}
if
(
scalingType
==
"strong"
){
gridBuilder
->
addGeometry
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphere
));
}
else
if
(
scalingType
==
"weak"
){
if
(
scalingType
==
"weak"
&&
!
useLevels
)
{
TriangularMesh
*
sphereSTL
=
TriangularMesh
::
make
(
stlPath
+
"Spheres_4GPU.stl"
);
gridBuilder
->
addGeometry
(
sphereSTL
);
}
else
{
gridBuilder
->
addGeometry
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphere
));
}
if
(
generatePart
==
0
)
...
...
@@ -391,22 +396,24 @@ void multipleLevel(const std::string& configPath)
// gridBuilder->setVelocityBoundaryCondition(SideType::GEOMETRY, 0.0, 0.0, 0.0);
//////////////////////////////////////////////////////////////////////////
}
else
if
(
comm
->
getNummberOfProcess
()
==
8
)
{
real
xSplit
;
real
ySplit
;
real
zSplit
;
if
(
scalingType
==
"strong"
){
xSplit
=
0.5
*
sideLengthCube
;
ySplit
=
0.5
*
sideLengthCube
;
zSplit
=
0.5
*
sideLengthCube
;
}
else
if
(
scalingType
==
"weak"
){
xSplit
=
xGridMax
;
xGridMax
=
xGridMax
+
(
xGridMax
-
xGridMin
);
ySplit
=
yGridMax
;
yGridMax
=
yGridMax
+
(
yGridMax
-
yGridMin
);
zSplit
=
zGridMax
;
zGridMax
=
zGridMax
+
(
zGridMax
-
zGridMin
);
};
real
xSplit
=
0.5
*
sideLengthCube
;
real
ySplit
=
0.5
*
sideLengthCube
;
real
zSplit
=
0.5
*
sideLengthCube
;
if
(
scalingType
==
"weak"
)
{
if
(
useLevels
){
dxGrid
=
dxGrid
/
2.0
;
// dxGrid = round(dxGrid*100.0)/100.0 // round to tow decimal places
}
else
{
xSplit
=
xGridMax
;
xGridMax
=
xGridMax
+
(
xGridMax
-
xGridMin
);
ySplit
=
yGridMax
;
yGridMax
=
yGridMax
+
(
yGridMax
-
yGridMin
);
zSplit
=
zGridMax
;
zGridMax
=
zGridMax
+
(
zGridMax
-
zGridMin
);
}
}
if
(
generatePart
==
0
)
{
gridBuilder
->
addCoarseGrid
(
xGridMin
,
yGridMin
,
zGridMin
,
xSplit
+
overlap
,
ySplit
+
overlap
,
...
...
@@ -443,15 +450,13 @@ void multipleLevel(const std::string& configPath)
if
(
useLevels
)
{
gridBuilder
->
addGrid
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphereLev1
),
1
);
if
(
scalingType
==
"weak"
)
std
::
cout
<<
"weak scaling not implemented for multiple levels"
;
}
if
(
scalingType
==
"strong"
){
gridBuilder
->
addGeometry
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphere
));
}
else
if
(
scalingType
==
"weak"
){
TriangularMesh
*
sphereSTL
=
TriangularMesh
::
make
(
stlPath
+
"Spheres_4GPU.stl"
);
if
(
scalingType
==
"weak"
&&
!
useLevels
)
{
TriangularMesh
*
sphereSTL
=
TriangularMesh
::
make
(
stlPath
+
"Spheres_8GPU.stl"
);
gridBuilder
->
addGeometry
(
sphereSTL
);
}
else
{
gridBuilder
->
addGeometry
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphere
));
}
if
(
generatePart
==
0
)
...
...
@@ -609,9 +614,13 @@ void multipleLevel(const std::string& configPath)
gridBuilder
->
setNumberOfLayers
(
10
,
8
);
gridBuilder
->
addGrid
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphereLev1
),
1
);
}
gridBuilder
->
addGeometry
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphere
));
if
(
scalingType
==
"weak"
&&
!
useLevels
){
TriangularMesh
*
sphereSTL
=
TriangularMesh
::
make
(
stlPath
+
"Spheres_1GPU.stl"
);
gridBuilder
->
addGeometry
(
sphereSTL
);
}
else
{
gridBuilder
->
addGeometry
(
new
Sphere
(
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
0.5
*
sideLengthCube
,
dSphere
));
}
gridBuilder
->
buildGrids
(
LBM
,
true
);
// buildGrids() has to be called before setting the BCs!!!!
...
...
This diff is collapsed.
Click to expand it.
src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp
+
1
−
1
View file @
f0d468e9
...
...
@@ -303,7 +303,7 @@ void Simulation::init(SPtr<Parameter> para, SPtr<GridProvider> gridProvider, std
// find indices of corner nodes for multiGPU communication
//////////////////////////////////////////////////////////////////////////
if
(
para
->
getDevices
().
size
()
>
2
)
{
output
<<
"Find indices of
corner
nodes for multiGPU communication ..."
;
output
<<
"Find indices of
edge
nodes for multiGPU communication ..."
;
para
->
findEdgeNodesCommMultiGPU
();
output
<<
"done.
\n
"
;
}
...
...
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