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
1c137425
Commit
1c137425
authored
Apr 3, 2023
by
David Immel
Browse files
Options
Downloads
Patches
Plain Diff
bugfix for freeing MPI communicators every balance
parent
3918dbd4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/ALL_Histogram.hpp
+19
-10
19 additions, 10 deletions
include/ALL_Histogram.hpp
with
19 additions
and
10 deletions
include/ALL_Histogram.hpp
+
19
−
10
View file @
1c137425
...
...
@@ -70,13 +70,22 @@ public:
// array of MPI communicators for each direction (to collect work
// on each plane)
communicators
.
resize
(
2
*
this
->
dimension
);
communicators
.
resize
(
6
);
for
(
int
i
=
0
;
i
<
6
;
i
++
)
communicators
.
at
(
i
)
=
MPI_COMM_NULL
;
nNeighbors
.
resize
(
2
*
this
->
dimension
);
nBins
.
resize
(
this
->
dimension
);
}
/// default destructor
~
Histogram_LB
()
=
default
;
~
Histogram_LB
()
{
for
(
int
i
=
0
;
i
<
communicators
.
size
();
i
++
)
{
if
(
communicators
.
at
(
i
)
!=
MPI_COMM_NULL
&&
communicators
.
at
(
i
)
!=
MPI_COMM_SELF
&&
communicators
.
at
(
i
)
!=
MPI_COMM_WORLD
)
MPI_Comm_free
(
&
(
communicators
.
at
(
i
)));
}
}
/// method to setup the loac-balancing method
void
setup
()
override
;
...
...
@@ -156,6 +165,14 @@ template <class T, class W> void Histogram_LB<T, W>::setup() {
// get the local rank from the MPI communicator
MPI_Cart_rank
(
this
->
globalComm
,
this
->
local_coords
.
data
(),
&
this
->
localRank
);
// free sub-communicators
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
if
(
communicators
.
at
(
i
)
!=
MPI_COMM_SELF
&&
communicators
.
at
(
i
)
!=
MPI_COMM_WORLD
&&
communicators
.
at
(
i
)
!=
MPI_COMM_NULL
)
MPI_Comm_free
(
&
(
communicators
.
at
(
i
)));
}
// create sub-communicators
// communicators 0 - 2: reduction of partial histograms
...
...
@@ -358,14 +375,6 @@ template <class T, class W> void Histogram_LB<T, W>::balance(int step) {
<<
std
::
endl
;
find_neighbors
();
MPI_Barrier
(
this
->
globalComm
);
// free created communicators
for
(
int
i
=
0
;
i
<
6
;
++
i
)
{
if
(
communicators
.
at
(
i
)
!=
MPI_COMM_SELF
&&
communicators
.
at
(
i
)
!=
MPI_COMM_WORLD
)
MPI_Comm_free
(
&
(
communicators
.
at
(
i
)));
}
}
template
<
class
T
,
class
W
>
void
Histogram_LB
<
T
,
W
>::
find_neighbors
()
{
...
...
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