Commit f1cf7da2 authored by Chuck Atkins's avatar Chuck Atkins
Browse files

Fix various issues with benchmark scripts

parent 62f72214
Pipeline #50465 failed with stage
import datetime as dt
from paraview import servermanager
from paraview.simple import *
#from paraview.benchmark import *
import logbase, logparser
from paraview.benchmark import *
#import logbase, logparser
logbase.maximize_logs()
records = []
......@@ -81,7 +81,7 @@ def memtime_stamp():
def run(output_basename='log', num_spheres=8, num_spheres_in_scene=None,
resolution=725, view_size=(1920, 1080), num_frames=10, save_logs=True,
color=False, OSPRay=False):
transparency=False, ospray=False):
if num_spheres_in_scene is None:
num_spheres_in_scene = num_spheres
......@@ -89,7 +89,7 @@ def run(output_basename='log', num_spheres=8, num_spheres_in_scene=None,
controller = vtk.vtkMultiProcessController.GetGlobalController()
view = get_render_view(view_size)
if OSPRay:
if ospray:
view.EnableOSPRay = 1
print('Generating bounding box')
......@@ -167,13 +167,15 @@ self.GetOutput().ShallowCopy(ap.GetOutput())
paramprop.SetElement(4, 'res')
paramprop.SetElement(5, str(resolution))
gen.UpdateProperty('Parameters')
genDisplay = Show()
genDisplay.SetRepresentationType('Surface')
if color:
print('Assigning colors')
pidScale = ProcessIdScalars()
pidScaleDisplay = Show()
print('Assigning colors')
pidScale = ProcessIdScalars()
pidScaleDisplay = Show()
pidScaleDisplay.SetRepresentationType('Surface')
if transparency:
print('Enabling 50% transparency')
pidScaleDisplay.Opacity = 0.5
print('Repositioning initial camera')
c = GetActiveCamera()
......@@ -220,7 +222,7 @@ self.GetOutput().ShallowCopy(ap.GetOutput())
'num_spheres_in_scene': num_spheres_in_scene,
'resolution': resolution, 'view_size': view_size,
'num_frames': num_frames, 'save_logs': save_logs,
'color': color}))
'transparency': transparency, 'ospray': ospray}))
# Save the memory statistics collected
with open(output_basename + '.mem.txt', 'w') as ofile:
......@@ -230,7 +232,7 @@ self.GetOutput().ShallowCopy(ap.GetOutput())
logparser.summarize_results(num_frames, (fpsT1-fpsT0).total_seconds(),
num_polys, 'Polys', save_logs,
output_basename)
print('Points / Frame:', num_points)
print('Points / Frame: %d' % (num_points))
def main(argv):
......@@ -250,9 +252,9 @@ def main(argv):
help='View size used to render')
parser.add_argument('-f', '--frames', default=10, type=int,
help='Number of frames')
parser.add_argument('-c', '--color', action='store_true',
help='Enable color renderings')
parser.add_argument('-y', '--OSPRay', action='store_true',
parser.add_argument('-t', '--transparency', action='store_true',
help='Enable transparency')
parser.add_argument('-y', '--ospray', action='store_true',
help='Use OSPRAY to render')
args = parser.parse_args(argv)
......@@ -269,8 +271,8 @@ def main(argv):
run(output_basename=args.output_basename, num_spheres=args.spheres,
num_spheres_in_scene=args.spheres_in_scene, resolution=args.resolution,
view_size=args.view_size, num_frames=args.frames, color=args.color,
OSPRay=args.OSPRay)
view_size=args.view_size, num_frames=args.frames,
transparency=args.transparency, ospray=args.ospray)
if __name__ == "__main__":
import sys
......
import datetime as dt
from paraview import servermanager
from paraview.simple import *
#from paraview.benchmark import *
import logbase, logparser
from paraview.benchmark import *
#import logbase, logparser
logbase.maximize_logs()
records = []
......@@ -80,13 +80,13 @@ def memtime_stamp():
def run(output_basename='log', dimension=100, view_size=(1920, 1080),
num_frames=10, save_logs=True, color=False, OSPRay=False):
num_frames=10, save_logs=True, transparency=False, ospray=False):
import vtk
controller = vtk.vtkMultiProcessController.GetGlobalController()
view = get_render_view(view_size)
if OSPRay:
if ospray:
view.EnableOSPRay = 1
print('Generating wavelet')
......@@ -105,10 +105,12 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080),
contour.Isosurfaces = list(map(float, range(10, 110, 10)))
contourDisplay = Show()
contourDisplay.SetRepresentationType('Surface')
ColorBy(contourDisplay, ('POINTS', 'RTData'))
contourDisplay.RescaleTransferFunctionToDataRange(True, False)
if color:
ColorBy(contourDisplay, ('POINTS', 'RTData'))
contourDisplay.RescaleTransferFunctionToDataRange(True, False)
if transparency:
print('Enabling 50% transparency')
contourDisplay.Opacity = 0.5
print('Repositioning initial camera')
c = GetActiveCamera()
......@@ -155,6 +157,8 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080),
'dimension': dimension,
'view_size': view_size,
'num_frames': num_frames,
'transparency': transparency,
'ospray' : ospray,
'save_logs': save_logs}))
# Save the memory statistics collected
......@@ -181,9 +185,9 @@ def main(argv):
help='View size used to render')
parser.add_argument('-f', '--frames', default=10, type=int,
help='Number of frames')
parser.add_argument('-c', '--color', action='store_true',
help='Enable color renderings')
parser.add_argument('-y', '--OSPRay', action='store_true',
parser.add_argument('-t', '--transparency', action='store_true',
help='Enable transparency')
parser.add_argument('-y', '--ospray', action='store_true',
help='Use OSPRAY to render')
args = parser.parse_args(argv)
......@@ -199,8 +203,8 @@ def main(argv):
Connect(m.group(2))
run(output_basename=args.output_basename, dimension=args.dimension,
view_size=args.view_size, num_frames=args.frames, color=args.color,
OSPRay=args.OSPRay)
view_size=args.view_size, num_frames=args.frames,
transparency=args.transparency, ospray=args.ospray)
if __name__ == "__main__":
import sys
......
import datetime as dt
from paraview import servermanager
from paraview.simple import *
#from paraview.benchmark import *
import logbase, logparser
from paraview.benchmark import *
#import logbase, logparser
logbase.maximize_logs()
records = []
......@@ -80,13 +80,13 @@ def memtime_stamp():
def run(output_basename='log', dimension=100, view_size=(1920, 1080),
num_frames=10, save_logs=True, OSPRay=False):
num_frames=10, save_logs=True, ospray=False):
import vtk
controller = vtk.vtkMultiProcessController.GetGlobalController()
view = get_render_view(view_size)
if OSPRay:
if ospray:
view.EnableOSPRay = 1
print('Generating wavelet')
......@@ -140,6 +140,7 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080),
'dimension': dimension,
'view_size': view_size,
'num_frames': num_frames,
'ospray' : ospray,
'save_logs': save_logs}))
# Save the memory statistics collected
......@@ -165,7 +166,7 @@ def main(argv):
help='View size used to render')
parser.add_argument('-f', '--frames', default=10, type=int,
help='Number of frames')
parser.add_argument('-y', '--OSPRay', action='store_true',
parser.add_argument('-y', '--ospray', action='store_true',
help='Use OSPRAY to render')
args = parser.parse_args(argv)
......@@ -181,7 +182,7 @@ def main(argv):
Connect(m.group(2))
run(output_basename=args.output_basename, dimension=args.dimension,
view_size=args.view_size, num_frames=args.frames, OSPRay=args.OSPRay)
view_size=args.view_size, num_frames=args.frames, ospray=args.ospray)
if __name__ == "__main__":
import sys
......
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