<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>Your delete line is <br><br> Delete(Animationscene1)<br><br>but your variable is actually called AnimationScene1 (camel-case lettering). Python is case-sensitive, so that's why you are getting the error you are showing.<br><br>That said, we do two things to loop over everything. We can Delete() every object, but that can be tedious in complicated pipelines. Alternatively, we have a driver script that executes pvpython on a trace script and passes in a number to indicate which file should be rendered. Our trace script then dumps a single PNG image and we stitch them together to make a movie afterwards using ImageMagick. Since each image is rendered in an entirely new instance of pvpython, there are no memory issues. An example driver script is below. We've also made our driver script parallel so it splits the range of data files into chunks for each processor, and then pvpython is called multiple times in parallel to render the files.<br><br>Tim<br><br> import subprocess<br><br> start = 0<br> end = 100<br> stride = 1<br><br> for n in range(start, end + 1, stride):<br> print "Working on file: ", n<br> subprocess.call(['/data4/pv4.1Install-OS/bin/pvpython', 'jicf_trace.py', '%i' % (n)])<br><br><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Tim De Coster" <tim91decoster@gmail.com><br><b>To: </b>paraview@paraview.org<br><b>Sent: </b>Tuesday, January 19, 2016 10:03:01 AM<br><b>Subject: </b>[Paraview] Memory overload and I don't know what to delete (despite looking in the archives)<br><br><div dir="ltr"><div><div><div><div><div>Hi all,<br><br></div>I am stuck with a problem
regarding ParaView (version 4.0.1 64-bit), running on Ubuntu 14.04. It seems that when I run a
python script, my memory gets overloaded. I looked already in the
archives and it seems that I need to delete some data using the command Delete(). When I try this
however, I get error messages saying that the things I want to delete
are not possible<br>( File "./RunParaviewMovieMaker.py", line 89, in create_movie<br> Delete(Animationscene1)<br>NameError: global name 'Animationscene1' is not defined<br>*** Error in `/usr/bin/python': corrupted double-linked list: 0x0000000002b52ca0 ***<br>).<br>Let me first explain my problem in more detail:<br><br></div>I
have a lot of data that I generated with another script (about 3TB and
still increasing), but now I need to convert these data into movies.
When I run my loop over different folders, the first few movies are
generated in less than 30s each, but then gradually the time per movie
starts increasing and my memory gets overloaded. The script I am running
is (which I simply got from using the trace call for python in ParaView):<br><br>#!/usr/bin/python<br><br>from paraview.simple import *<br><br>def main():<br><br> some huge for-loop generating names of maps where the .vtk files are stored. In this for loop I use the command:<br> create_movie(filename3)<br><br>def create_movie(mapname):<br><br> vtkfolder = '.'<br> number_of_frames = 2000<br><br> vtknames = []<br> for i in range (0, number_of_frames - 1):<br> vtknames.append('{1}/{2}/VoltParaviewMovie{0:0=4d}.vtk'.format(i, vtkfolder, mapname))<br><br> VoltParaviewMovie = LegacyVTKReader(FileNames = vtknames)<br><br> AnimationScene1 = GetAnimationScene()<br> AnimationScene1 = GetAnimationScene()<br> AnimationScene1.EndTime = 1999.0<br> AnimationScene1.PlayMode = 'Snap To TimeSteps'<br><br> AnimationScene1.EndTime = 1999.0<br> AnimationScene1.PlayMode = 'Snap To TimeSteps'<br><br> RenderView1 = GetRenderView()<br>
a1_Voltage_PVLookupTable = GetLookupTableForArray( "Voltage", 1,
RGBPoints=[-85.52999877929688, 0.23, 0.299, 0.754, 50.0, 0.706, 0.016,
0.15], VectorMode='Magnitude', NanColor=[0.25, 0.0, 0.0],
ColorSpace='Diverging', ScalarRangeInitialized=1.0,
AllowDuplicateScalars=1 )<br><br> a1_Voltage_PiecewiseFunction = CreatePiecewiseFunction( Points=[0.0, 0.0, 0.5, 0.0, 1.0, 1.0, 0.5, 0.0] )<br><br> DataRepresentation1 = Show()<br> DataRepresentation1.EdgeColor = [0.0, 0.0, 0.5000076295109483]<br> DataRepresentation1.SelectionPointFieldDataArrayName = 'Voltage'<br> DataRepresentation1.ScalarOpacityFunction = a1_Voltage_PiecewiseFunction<br> DataRepresentation1.ColorArrayName = ('POINT_DATA', 'Voltage')<br> DataRepresentation1.ScalarOpacityUnitDistance = 7.108580809929175<br> DataRepresentation1.LookupTable = a1_Voltage_PVLookupTable<br> DataRepresentation1.Representation = 'Slice'<br> DataRepresentation1.ScaleFactor = 0.0<br><br> RenderView1.CameraFocalPoint = [63.5, 63.5, 0.0]<br> RenderView1.CameraPosition = [63.5, 63.5, 10000.0]<br> RenderView1.InteractionMode = '2D'<br> RenderView1.CenterOfRotation = [63.5, 63.5, 0.0]<br><br> a1_Voltage_PVLookupTable.ScalarOpacityFunction = a1_Voltage_PiecewiseFunction<br><br> RenderView1.CameraPosition = [63.5, 63.5, 346.97045256124744]<br> RenderView1.CameraClippingRange = [343.50074803563496, 352.1750093496662]<br> RenderView1.CameraParallelScale = 89.80256121069154<br><br> newmapname = ''<br> fragments = mapname.split('.')<br> for fragment in fragments:<br> newmapname +=fragment<br><br> WriteAnimation('{0}/{1}.avi'.format(vtkfolder, newmapname), Magnification=1, Quality=2, FrameRate=15.000000)<br><br> Render()<br><br> print('{0} has been produced.'.format(newmapname))<br><br><br>if __name__ == '__main__':<br> main()<br><br></div>Would
any one of you be able to point out to me what I am doing wrong? Or
which objects/structures I should delete (in the archives the problem always appeared to be that a writer needed to be deleted, but I don't have such an object) such that I basically start
over each time I create a new movie and hence don't use that much memory?<br><br></div>With kind regards,<br></div>Tim</div>
<br>_______________________________________________<br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br><br>Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView<br><br>Search the list archives at: http://markmail.org/search/?q=ParaView<br><br>Follow this link to subscribe/unsubscribe:<br>http://public.kitware.com/mailman/listinfo/paraview<br></div><br></div></body></html>