Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
code
pugs
Commits
1136f061
Commit
1136f061
authored
1 month ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Fix serial "load balancer"
parent
c332cbfa
No related branches found
Branches containing commit
No related tags found
1 merge request
!204
Remove m_cell_global_index from Connectivity
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scheme/LoadBalancer.cpp
+24
-50
24 additions, 50 deletions
src/scheme/LoadBalancer.cpp
with
24 additions
and
50 deletions
src/scheme/LoadBalancer.cpp
+
24
−
50
View file @
1136f061
...
@@ -23,56 +23,30 @@ LoadBalancer::balance(const std::vector<std::shared_ptr<const DiscreteFunctionVa
...
@@ -23,56 +23,30 @@ LoadBalancer::balance(const std::vector<std::shared_ptr<const DiscreteFunctionVa
auto
p_balanced_mesh_v
=
mesh_balancer
.
mesh
();
auto
p_balanced_mesh_v
=
mesh_balancer
.
mesh
();
if
(
parallel
::
size
()
==
1
)
{
std
::
visit
(
std
::
visit
(
[
&
mesh_balancer
,
&
balanced_discrete_function_list
,
&
discrete_function_list
](
auto
&&
p_balanced_mesh
)
{
[
&
balanced_discrete_function_list
,
&
discrete_function_list
](
auto
&&
p_balanced_mesh
)
{
using
MeshType
=
mesh_type_t
<
decltype
(
p_balanced_mesh
)
>
;
for
(
size_t
i_discrete_function
=
0
;
i_discrete_function
<
discrete_function_list
.
size
();
constexpr
size_t
Dimension
=
MeshType
::
Dimension
;
++
i_discrete_function
)
{
const
auto
&
dispatcher
=
mesh_balancer
.
connectivityDispatcher
()
->
get
<
Dimension
>
();
std
::
visit
(
[
&
balanced_discrete_function_list
,
p_balanced_mesh
](
auto
&&
discrete_function
)
{
for
(
size_t
i_discrete_function
=
0
;
i_discrete_function
<
discrete_function_list
.
size
();
++
i_discrete_function
)
{
using
DiscreteFunctionT
=
std
::
decay_t
<
decltype
(
discrete_function
)
>
;
std
::
visit
(
if
constexpr
(
is_discrete_function_P0_v
<
DiscreteFunctionT
>
)
{
[
&
balanced_discrete_function_list
,
&
dispatcher
,
&
p_balanced_mesh
](
auto
&&
discrete_function
)
{
balanced_discrete_function_list
.
push_back
(
std
::
make_shared
<
DiscreteFunctionVariant
>
(
using
DiscreteFunctionT
=
std
::
decay_t
<
decltype
(
discrete_function
)
>
;
DiscreteFunctionT
{
p_balanced_mesh
,
discrete_function
.
cellValues
()}));
if
constexpr
(
is_discrete_function_P0_v
<
DiscreteFunctionT
>
)
{
}
else
{
const
auto
&
dispatched_cell_value
=
dispatcher
->
dispatch
(
discrete_function
.
cellValues
());
balanced_discrete_function_list
.
push_back
(
std
::
make_shared
<
DiscreteFunctionVariant
>
(
balanced_discrete_function_list
.
push_back
(
DiscreteFunctionT
{
p_balanced_mesh
,
discrete_function
.
cellArrays
()}));
std
::
make_shared
<
DiscreteFunctionVariant
>
(
DiscreteFunctionT
{
p_balanced_mesh
,
dispatched_cell_value
}));
}
}
else
{
},
const
auto
&
dispatched_cell_array
=
dispatcher
->
dispatch
(
discrete_function
.
cellArrays
());
discrete_function_list
[
i_discrete_function
]
->
discreteFunction
());
balanced_discrete_function_list
.
push_back
(
}
std
::
make_shared
<
DiscreteFunctionVariant
>
(
DiscreteFunctionT
{
p_balanced_mesh
,
dispatched_cell_array
}));
},
}
p_balanced_mesh_v
->
variant
());
},
}
else
{
discrete_function_list
[
i_discrete_function
]
->
discreteFunction
());
// This macro test is used to avoid none reachable code for serial builds of pugs
}
#ifdef PUGS_HAS_MPI
},
std
::
visit
(
p_balanced_mesh_v
->
variant
());
[
&
mesh_balancer
,
&
balanced_discrete_function_list
,
&
discrete_function_list
](
auto
&&
p_balanced_mesh
)
{
using
MeshType
=
mesh_type_t
<
decltype
(
p_balanced_mesh
)
>
;
constexpr
size_t
Dimension
=
MeshType
::
Dimension
;
const
auto
&
dispatcher
=
mesh_balancer
.
connectivityDispatcher
()
->
get
<
Dimension
>
();
for
(
size_t
i_discrete_function
=
0
;
i_discrete_function
<
discrete_function_list
.
size
();
++
i_discrete_function
)
{
std
::
visit
(
[
&
balanced_discrete_function_list
,
&
dispatcher
,
&
p_balanced_mesh
](
auto
&&
discrete_function
)
{
using
DiscreteFunctionT
=
std
::
decay_t
<
decltype
(
discrete_function
)
>
;
if
constexpr
(
is_discrete_function_P0_v
<
DiscreteFunctionT
>
)
{
const
auto
&
dispatched_cell_value
=
dispatcher
->
template
dispatch
(
discrete_function
.
cellValues
());
balanced_discrete_function_list
.
push_back
(
std
::
make_shared
<
DiscreteFunctionVariant
>
(
DiscreteFunctionT
{
p_balanced_mesh
,
dispatched_cell_value
}));
}
else
{
const
auto
&
dispatched_cell_array
=
dispatcher
->
template
dispatch
(
discrete_function
.
cellArrays
());
balanced_discrete_function_list
.
push_back
(
std
::
make_shared
<
DiscreteFunctionVariant
>
(
DiscreteFunctionT
{
p_balanced_mesh
,
dispatched_cell_array
}));
}
},
discrete_function_list
[
i_discrete_function
]
->
discreteFunction
());
}
},
p_balanced_mesh_v
->
variant
());
#endif // PUGS_HAS_MPI
}
return
balanced_discrete_function_list
;
return
balanced_discrete_function_list
;
}
}
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