Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
7aa289ea
Commit
7aa289ea
authored
Nov 19, 2015
by
Ultima
Browse files
Replaced _allgather in slicing_distributor's vdot by comm.Allreduce.
parent
02f51fa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty_mpi_data.py
View file @
7aa289ea
...
...
@@ -494,10 +494,15 @@ class distributed_data_object(object):
def
vdot
(
self
,
other
):
other
=
self
.
distributor
.
extract_local_data
(
other
)
local_vdot
=
np
.
vdot
(
self
.
get_local_data
(),
other
)
local_vdot_list
=
self
.
distributor
.
_allgather
(
local_vdot
)
global_vdot
=
np
.
result_type
(
self
.
dtype
,
other
.
dtype
).
type
(
np
.
sum
(
local_vdot_list
))
local_vdot
=
np
.
array
([
np
.
vdot
(
self
.
get_local_data
(),
other
)])
global_vdot
=
np
.
empty_like
(
local_vdot
)
self
.
_Allreduce_sum
(
sendbuf
=
local_vdot
,
recvbuf
=
global_vdot
)
# local_vdot = np.vdot(self.get_local_data(), other)
# local_vdot_list = self.distributor._allgather(local_vdot)
# global_vdot = np.result_type(self.dtype,
# other.dtype).type(np.sum(local_vdot_list))
return
global_vdot
def
__getitem__
(
self
,
key
):
...
...
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