Commit f4642ad9 authored by Mark Hymers's avatar Mark Hymers

Handle integer division properly in python 3

Signed-off-by: Mark Hymers's avatarMark Hymers <mark.hymers@ynic.york.ac.uk>
parent 9094f7e7
......@@ -121,6 +121,8 @@ class MPI4PyImplementor(object):
if j < (num_pts % num_nodes):
jump += 1
jump = int(jump)
ret.append((cur, cur + jump, ))
cur += jump
......@@ -147,7 +149,7 @@ class MPI4PyImplementor(object):
data_type = info[-1]
# Calculate share size for this node
p = data_shape[0] / self.mpi.size
p = int(data_shape[0] / self.mpi.size)
if self.mpi.rank < (data_shape[0] % self.mpi.size):
p += 1
......@@ -162,7 +164,7 @@ class MPI4PyImplementor(object):
rsz = prod(data_shape[1:]).astype(int)
if self.mpi.rank == root:
# share out jobs as equally as possible
counts = array([data_shape[0]/self.mpi.size]*self.mpi.size)
counts = array([int(data_shape[0]/self.mpi.size)]*self.mpi.size)
counts[:data_shape[0] % self.mpi.size] += 1
# Calculate total data elements for each node
counts *= rsz
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment