Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
veros_veit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Veit Lüschow
veros_veit
Commits
2883a7fd
Commit
2883a7fd
authored
Feb 17, 2020
by
Dion Häfner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
free MPI comm after use
parent
c3cce72e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
veros/distributed.py
veros/distributed.py
+21
-15
No files found.
veros/distributed.py
View file @
2883a7fd
...
...
@@ -284,12 +284,15 @@ def exchange_cyclic_boundaries(vs, arr):
def
_reduce
(
vs
,
arr
,
op
,
axis
=
None
):
if
axis
is
None
:
comm
=
rs
.
mpi_comm
disconnect_comm
=
False
else
:
assert
axis
in
(
0
,
1
)
pi
=
proc_rank_to_index
(
rst
.
proc_rank
)
other_axis
=
1
-
axis
comm
=
rs
.
mpi_comm
.
Split
(
pi
[
other_axis
],
rst
.
proc_rank
)
disconnect_comm
=
True
try
:
if
np
.
isscalar
(
arr
):
squeeze
=
True
arr
=
np
.
array
([
arr
])
...
...
@@ -309,6 +312,9 @@ def _reduce(vs, arr, op, axis=None):
res
=
res
[
0
]
return
res
finally
:
if
disconnect_comm
:
comm
.
Disconnect
()
@
dist_context_only
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment