Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loadbalancing
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
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SLMS
loadbalancing
Commits
548510cf
Commit
548510cf
authored
Jun 27, 2019
by
Rene Halver
Browse files
Options
Downloads
Patches
Plain Diff
fix for the general work_array administration and passing from the ALL object
parent
e5075238
No related branches found
No related tags found
No related merge requests found
Pipeline
#22033
passed
Jun 27, 2019
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/ALL.hpp
+11
-17
11 additions, 17 deletions
include/ALL.hpp
with
11 additions
and
17 deletions
include/ALL.hpp
+
11
−
17
View file @
548510cf
...
@@ -112,26 +112,21 @@ template <class T, class W> class ALL
...
@@ -112,26 +112,21 @@ template <class T, class W> class ALL
switch
(
method
)
switch
(
method
)
{
{
case
ALL_LB_t
::
TENSOR
:
case
ALL_LB_t
::
TENSOR
:
work_array
.
resize
(
1
);
balancer
.
reset
(
new
ALL_Tensor_LB
<
T
,
W
>
(
d
,(
W
)
0
,
g
));
balancer
.
reset
(
new
ALL_Tensor_LB
<
T
,
W
>
(
d
,
work_array
.
at
(
0
),
g
));
break
;
break
;
case
ALL_LB_t
::
STAGGERED
:
case
ALL_LB_t
::
STAGGERED
:
work_array
.
resize
(
1
);
balancer
.
reset
(
new
ALL_Staggered_LB
<
T
,
W
>
(
d
,(
W
)
0
,
g
));
balancer
.
reset
(
new
ALL_Staggered_LB
<
T
,
W
>
(
d
,
work_array
.
at
(
0
),
g
));
break
;
break
;
case
ALL_LB_t
::
UNSTRUCTURED
:
case
ALL_LB_t
::
UNSTRUCTURED
:
work_array
.
resize
(
1
);
balancer
.
reset
(
new
ALL_Unstructured_LB
<
T
,
W
>
(
d
,(
W
)
0
,
g
));
balancer
.
reset
(
new
ALL_Unstructured_LB
<
T
,
W
>
(
d
,
work_array
.
at
(
0
),
g
));
break
;
break
;
case
ALL_LB_t
::
VORONOI
:
case
ALL_LB_t
::
VORONOI
:
#ifdef ALL_VORONOI
#ifdef ALL_VORONOI
work_array
.
resize
(
1
);
balancer
.
reset
(
new
ALL_Voronoi_LB
<
T
,
W
>
(
d
,(
W
)
0
,
g
));
balancer
.
reset
(
new
ALL_Voronoi_LB
<
T
,
W
>
(
d
,
work_array
.
at
(
0
),
g
));
#endif
#endif
break
;
break
;
case
ALL_LB_t
::
HISTOGRAM
:
case
ALL_LB_t
::
HISTOGRAM
:
work_array
.
resize
(
1
);
balancer
.
reset
(
new
ALL_Histogram_LB
<
T
,
W
>
(
d
,
std
::
vector
<
W
>
(
10
),
g
));
balancer
.
reset
(
new
ALL_Histogram_LB
<
T
,
W
>
(
d
,
work_array
,
g
));
break
;
break
;
default:
default:
throw
ALL_Invalid_Argument_Exception
(
throw
ALL_Invalid_Argument_Exception
(
...
@@ -315,13 +310,12 @@ template <class T, class W> void ALL<T,W>::set_vertices(const int n, const int d
...
@@ -315,13 +310,12 @@ template <class T, class W> void ALL<T,W>::set_vertices(const int n, const int d
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
set_work
(
W
work
)
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
set_work
(
W
work
)
{
{
// set new value for work (single value for whole domain)
// set new value for work (single value for whole domain)
work_array
.
resize
(
1
);
balancer
->
set_work
(
work
);
work_array
.
at
(
0
)
=
work
;
}
}
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
set_work
(
const
std
::
vector
<
W
>&
work
)
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
set_work
(
const
std
::
vector
<
W
>&
work
)
{
{
work_array
=
work
;
balancer
->
set_work
(
work
)
;
}
}
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
set_proc_grid_params
(
const
std
::
vector
<
int
>&
loc
,
const
std
::
vector
<
int
>&
size
)
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
set_proc_grid_params
(
const
std
::
vector
<
int
>&
loc
,
const
std
::
vector
<
int
>&
size
)
...
@@ -429,12 +423,12 @@ template <class T, class W> void ALL<T,W>::calculate_outline()
...
@@ -429,12 +423,12 @@ template <class T, class W> void ALL<T,W>::calculate_outline()
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
get_work
(
W
&
result
)
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
get_work
(
W
&
result
)
{
{
result
=
work_array
->
at
(
0
);
result
=
balancer
->
get_work
().
at
(
0
);
}
}
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
get_work
(
std
::
vector
<
W
>&
result
)
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
get_work
(
std
::
vector
<
W
>&
result
)
{
{
result
=
work_array
;
result
=
balancer
->
get_work
()
;
}
}
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
setup
()
template
<
class
T
,
class
W
>
void
ALL
<
T
,
W
>::
setup
()
...
@@ -706,7 +700,7 @@ template <class T, class W> void ALL<T,W>::print_vtk_outlines(int step)
...
@@ -706,7 +700,7 @@ template <class T, class W> void ALL<T,W>::print_vtk_outlines(int step)
work
->
SetNumberOfComponents
(
1
);
work
->
SetNumberOfComponents
(
1
);
work
->
SetNumberOfTuples
(
1
);
work
->
SetNumberOfTuples
(
1
);
work
->
SetName
(
"work"
);
work
->
SetName
(
"work"
);
W
total_work
=
std
::
accumulate
(
work_array
.
begin
(),
work_array
.
end
(),(
W
)
0
);
W
total_work
=
std
::
accumulate
(
balancer
->
get_work
().
begin
(),
balancer
->
get_work
()
.
end
(),(
W
)
0
);
work
->
SetValue
(
0
,
total_work
);
work
->
SetValue
(
0
,
total_work
);
// determine extent of system
// determine extent of system
...
@@ -810,7 +804,7 @@ template <class T, class W> void ALL<T,W>::print_vtk_vertices(int step)
...
@@ -810,7 +804,7 @@ template <class T, class W> void ALL<T,W>::print_vtk_vertices(int step)
local_vertices
[
v
*
balancer
->
get_dimension
()
+
d
]
=
balancer
->
get_vertices
().
at
(
v
).
x
(
d
);
local_vertices
[
v
*
balancer
->
get_dimension
()
+
d
]
=
balancer
->
get_vertices
().
at
(
v
).
x
(
d
);
}
}
}
}
local_vertices
[
n_vertices
*
balancer
->
get_dimension
()]
=
(
T
)
work_array
.
at
(
0
);
local_vertices
[
n_vertices
*
balancer
->
get_dimension
()]
=
(
T
)
balancer
->
get_work
()
.
at
(
0
);
T
*
global_vertices
;
T
*
global_vertices
;
if
(
local_rank
==
0
)
if
(
local_rank
==
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
sign in
to comment