Dear Paraview developers and users,

I tried to run paraview in parallel using a python script. I compiled a
server including OpenMPI support and support for MESA off-screen
rendering and started the server using mpirun. The I connected from a
python script (see attachment). I could see that there are two threads
both taking 100% CPU time. However, there was absolutely no speed-up.
The runtime using two processors was completely the some. The data sets
were rather large (about 100 million unknowns in 3D, 512 x 512 x 405).
The result looked like the result with one process, but the time needed
was also the same. I am sure that I am making some error either in the
setup or I am missing something in the python program. Do you have any
suggestions?

Best regards,
Olaf Ippisch

-- 
Dr. Olaf Ippisch
Universität Heidelberg
Interdisziplinäres Zentrum für Wissenschaftliches Rechnen
Im Neuenheimer Feld 368, Raum 4.24
Tel: 06221/548252   Fax: 06221/548884
Mail: Im Neuenheimer Feld 368, 69120 Heidelberg
e-mail: <olaf.ippi...@iwr.uni-heidelberg.de>
#!pvpython
from paraview.simple import *
from re import search
from sys import argv

def SurfacePlot(r,outputFilename,cameraFocalPoint,cameraPosition,time):
  lt = MakeBlueToRedLT(0.0,1.2)
  view = CreateRenderView()
  t=Text()
  text = "%d h" % (time)
  t.Text = text
  Show(t,view)
  props=GetDisplayProperties(t)
  props.Position=[0.85,0.95]
  props.Justification='Right'
#  view = GetActiveView()
  Show(r,view)
  props=GetDisplayProperties(r)
  props.LookupTable = lt
  # setup view
  view.ViewSize=[800,600]
  view.CameraViewUp=[0.0,0.0,1.0]
  view.CameraFocalPoint=cameraFocalPoint
  view.CameraPosition=cameraPosition
  #view.OrientationAxesVisibility = 0
  view.CenterAxesVisibility = 0
  props.Ambient = 0.25
  # first plot
  props.Representation = 'Surface'
  props.ColorArrayName='conc'
  bar = CreateScalarBar(LookupTable=lt, Title="Concentration")
  bar.Orientation='Horizontal'
  bar.TitleFontSize=14
  bar.LabelFontSize=10
  bar.Position=[0.65,0.05]
  bar.Position2=[0.3,0.1]
  view.Representations.append(bar)
  WriteImage(outputFilename,view,Magnification=2)

def ContourPlot(r,outputFilename,cameraFocalPoint,cameraPosition):
  lt = MakeBlueToRedLT(0.0,1.0)
  view = CreateRenderView()
  t=Text()
  text = "%d h" % (time)
  t.Text = text
  Show(t,view)
  props=GetDisplayProperties(t)
  props.Position=[0.85,0.95]
  props.Justification='Right'
#  view = GetActiveView()
  s = Show(r,view)
  props=GetDisplayProperties(r)
  props.LookupTable = lt
  # setup view
  #view = GetActiveView()
  view.ViewSize=[800,600]
  view.CameraViewUp=[0.0,0.0,1.0]
  view.CameraFocalPoint=cameraFocalPoint
  view.CameraPosition=cameraPosition
  #view.OrientationAxesVisibility = 0
  view.CenterAxesVisibility = 0
  # first plot
  props.Representation = 'Outline'
  c= Contour(r)
  c.Isosurfaces=[0.2,0.4,0.6,0.8]
  c.ComputeScalars = True
  dp = GetDisplayProperties(c)
  if ((int(r.PointData[0].GetRange()[1]/0.2)-int(r.PointData[0].GetRange()[0]/0.2))>0) :
    dp.ColorArrayName='conc'
  dp.LookupTable = lt
  Show(c,view)
  if (r.PointData[0].GetRange()[1] > 1.1) :
    d= Contour(r)
    d.Isosurfaces=[1.1]
    d.ComputeScalars = True
    dp2 = GetDisplayProperties(d)
    dp2.ColorArrayName='conc'
    dp2.LookupTable = lt
    dp2.Opacity=0.5
    Show(d,view)
  bar = CreateScalarBar(LookupTable=lt, Title="Concentration")
  bar.Orientation='Horizontal'
  bar.TitleFontSize=12
  bar.LabelFontSize=8
  bar.Position=[0.65,0.05]
  bar.Position2=[0.3,0.1]
  view.Representations.append(bar)
  WriteImage(outputFilename,view,Magnification=2)


def newFilename(base,number):
    return "%s_%05d.png" % (base,number)

def fileTime(filename):
    return int(search(r'\d+', filename).group(0))

Connect('reservoir.iwr.uni-heidelberg.de')
cameraFocalPoint=[-5.12,5.12,1.5]
cameraPosition=[16.0,16.0,11.0]
fname = argv[1]
print "Reading data from ",fname
time = (fileTime(fname)-3628800)/3600
f = OpenDataFile(fname)
f.UpdatePipeline()
r= Transform(Input=f)
r.Transform.Rotate = [0,-90,0]
r.Transform.Translate = [0,0,0]
i=time
print "Writing ", newFilename("contour",i)
ContourPlot(r,newFilename("contour",i),cameraFocalPoint,cameraPosition)

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to