[Paraview] non-interactive viz on cluster

Kharche, Sanjay S.R.Kharche at exeter.ac.uk
Sat Jul 18 07:04:03 EDT 2015


Dear All

I need to non-interactively make png images of a series of sequentially
numbered vts/vtk files. Since this is a large amount of data, I would like
to do this using a cluster. The cluster has paraview and OpenFoam. I am not
very familiar with OpenFoam, and have just started using Paraview in
terms of python scripts. When I submit the job, I get an error. I gather
that the error is because there is always a blank Paraview OpenGL window
that opens when I use the script below. Can someone suggest a solution?

thanks
Sanjay

error from the pbs job:
ERROR: In /home/kitware/Kitware/ParaView-3.10/source/VTK/Rendering/vtkXOpenGLRenderWindow.cxx, line 541
vtkXOpenGLRenderWindow (0x1ba5ad0): bad X server connection. DISPLAY=ERROR: In /home/kitware/Kitware/ParaView-3.10/source/VTK/Rendering/vtkXOpenGLRenderWindow.cxx, line 343
vtkXOpenGLRenderWindow (0x1ba5ad0): bad X server connection. DISPLAY=

My python script that I created using the GUI, and then edited for writing the png is below. I run it using the
non screen rendering option:

pvbatch --use-offscreen-rendering mouse2d.py &

mouse2d.py is this:

try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

# this does not make a difference to the viz.
# SetActiveView(GetRenderView())
# GetActiveView().UseOffscreenRenderingForScreenshots = 1

# loop through all files.
for i in range (1,3999):
	mouse2D_SAN1_vts = XMLStructuredGridReader( FileName=['mouse2D_SAN%d.vts' % (i)] )
	mouse2D_SAN1_vts.PointArrayStatus = ['Unnamed0']
	RenderView1 = GetRenderView()
	DataRepresentation1 = Show()
	DataRepresentation1.EdgeColor = [0.0, 0.0, 0.5000076295109483]
	RenderView1.CenterOfRotation = [78.0, 58.5, 0.0]
	Transform1 = Transform( Transform="Transform" )
	a1_Unnamed0_PVLookupTable = GetLookupTableForArray( "Unnamed0", 1, NanColor=[0.25, 0.0, 0.0], RGBPoints=[-0.01, 0.23, 0.299, 0.754, 1.0, 0.706, 0.016, 0.15], VectorMode='Magnitude', ColorSpace='Diverging', LockScalarRange=1 )
	a1_Unnamed0_PiecewiseFunction = CreatePiecewiseFunction()
	RenderView1.CameraPosition = [78.0, 58.5, 376.71107225273664]
	RenderView1.CameraFocalPoint = [78.0, 58.5, 0.0]
	RenderView1.CameraClippingRange = [372.94396153020926, 382.3617383365277]
	RenderView1.CameraParallelScale = 97.5
	DataRepresentation1.ColorArrayName = 'Unnamed0'
	DataRepresentation1.LookupTable = a1_Unnamed0_PVLookupTable
	Transform1.Transform = "Transform"
	DataRepresentation2 = Show()
	DataRepresentation2.ColorArrayName = 'Unnamed0'
	DataRepresentation2.LookupTable = a1_Unnamed0_PVLookupTable
	DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483]
	DataRepresentation1.Visibility = 0

	Transform1.Transform.Scale = [1.0, -1.0, 0.0]
	RenderView1.CenterAxesVisibility = 0
	RenderView1.CameraPosition = [78.0, -58.5, 376.71107225273664]
	RenderView1.OrientationAxesVisibility = 0
	RenderView1.CameraFocalPoint = [78.0, -58.5, 0.0]
	RenderView1.CenterOfRotation = [78.0, -58.5, 0.0]
#	Render()
	WriteImage("dir_%i.png" % (i))


More information about the ParaView mailing list