Commit 55ab30f9 authored by Andrew Maclean's avatar Andrew Maclean Committed by David Gobbi
Browse files

A fix to enable this script to work with Py3k.

parent aa4e0d02
...@@ -82,7 +82,7 @@ def GetSource(dataType): ...@@ -82,7 +82,7 @@ def GetSource(dataType):
pts = vtk.vtkPoints() pts = vtk.vtkPoints()
sg.SetPoints(pts) sg.SetPoints(pts)
npts = input.GetNumberOfPoints() npts = input.GetNumberOfPoints()
for i in xrange(npts): for i in range(npts):
pts.InsertNextPoint(input.GetPoint(i)) pts.InsertNextPoint(input.GetPoint(i))
sg.GetPointData().ShallowCopy(input.GetPointData()) sg.GetPointData().ShallowCopy(input.GetPointData())
...@@ -97,7 +97,7 @@ def TestDataType(dataType, reader, writer, ext, numTris): ...@@ -97,7 +97,7 @@ def TestDataType(dataType, reader, writer, ext, numTris):
writer.SetInputConnection(s.GetOutputPort()) writer.SetInputConnection(s.GetOutputPort())
npieces = 16 npieces = 16
writer.SetNumberOfPieces(npieces) writer.SetNumberOfPieces(npieces)
pperrank = npieces / nranks pperrank = npieces // nranks
start = pperrank * rank start = pperrank * rank
end = start + pperrank - 1 end = start + pperrank - 1
writer.SetStartPiece(start) writer.SetStartPiece(start)
...@@ -130,7 +130,7 @@ def TestDataType(dataType, reader, writer, ext, numTris): ...@@ -130,7 +130,7 @@ def TestDataType(dataType, reader, writer, ext, numTris):
contr.AllReduce(da, da2, vtk.vtkCommunicator.SUM_OP) contr.AllReduce(da, da2, vtk.vtkCommunicator.SUM_OP)
if rank == 0: if rank == 0:
print da2.GetValue(0) print(da2.GetValue(0))
import os import os
os.remove(filename) os.remove(filename)
for i in range(npieces): for i in range(npieces):
......
Supports Markdown
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