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
Merge requests
!204
Remove m_cell_global_index from Connectivity
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Remove m_cell_global_index from Connectivity
feature/loadbalancing
into
develop
Overview
0
Commits
30
Pipelines
0
Changes
40
Merged
Stéphane Del Pino
requested to merge
feature/loadbalancing
into
develop
1 month ago
Overview
0
Commits
30
Pipelines
0
Changes
1
Expand
now this information is computed when needed (load balance)
closes
#11 (closed)
0
0
Merge request reports
Compare
version 1
version 1
c332cbfa
1 month ago
develop (base)
and
latest version
latest version
1136f061
30 commits,
1 month ago
version 1
c332cbfa
29 commits,
1 month ago
Show latest version
1 file
+
24
−
50
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/scheme/LoadBalancer.cpp
+
24
−
50
Options
@@ -23,56 +23,30 @@ LoadBalancer::balance(const std::vector<std::shared_ptr<const DiscreteFunctionVa
auto
p_balanced_mesh_v
=
mesh_balancer
.
mesh
();
if
(
parallel
::
size
()
==
1
)
{
std
::
visit
(
[
&
balanced_discrete_function_list
,
&
discrete_function_list
](
auto
&&
p_balanced_mesh
)
{
for
(
size_t
i_discrete_function
=
0
;
i_discrete_function
<
discrete_function_list
.
size
();
++
i_discrete_function
)
{
std
::
visit
(
[
&
balanced_discrete_function_list
,
p_balanced_mesh
](
auto
&&
discrete_function
)
{
using
DiscreteFunctionT
=
std
::
decay_t
<
decltype
(
discrete_function
)
>
;
if
constexpr
(
is_discrete_function_P0_v
<
DiscreteFunctionT
>
)
{
balanced_discrete_function_list
.
push_back
(
std
::
make_shared
<
DiscreteFunctionVariant
>
(
DiscreteFunctionT
{
p_balanced_mesh
,
discrete_function
.
cellValues
()}));
}
else
{
balanced_discrete_function_list
.
push_back
(
std
::
make_shared
<
DiscreteFunctionVariant
>
(
DiscreteFunctionT
{
p_balanced_mesh
,
discrete_function
.
cellArrays
()}));
}
},
discrete_function_list
[
i_discrete_function
]
->
discreteFunction
());
}
},
p_balanced_mesh_v
->
variant
());
}
else
{
// This macro test is used to avoid none reachable code for serial builds of pugs
#ifdef PUGS_HAS_MPI
std
::
visit
(
[
&
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
}
std
::
visit
(
[
&
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
->
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
->
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
());
return
balanced_discrete_function_list
;
}
Loading