<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16437"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT size=2 face=Arial>Hi,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Im trying to run the
PythonScriptCoProcessingExample(.cxx) included in ParaView sourcecode - this is
my first "getting in touch" with MPI + ParaView (and Coprocessing of
course) so maybe it`s just a very simple problem. I already succesfully compiled
Paraview with Coprocessing and python (Ubuntu 11.10) and I`m running the source
with COPROCESSOR_USE_MPI. </FONT></DIV>
<DIV><FONT size=2 face=Arial>When I run it like: </FONT></DIV>
<DIV><FONT size=2 face=Arial>mpirun -n 1 ./CoProcessing ./PythonScriptTest.py
</FONT></DIV>
<DIV><FONT size=2 face=Arial>then I get as result CPGrid0_mpirun1.png and
CPPressure0_mpirun1.png - looks good.</FONT></DIV>
<DIV><FONT size=2 face=Arial>If I try:</FONT></DIV>
<DIV><FONT size=2 face=Arial>mpirun -n 2 ./CoProcessing
./PythonScriptTest.py </FONT></DIV>
<DIV><FONT size=2 face=Arial>then I get as result CPGrid0_mpirun2.png and
CPPressure0_mpirun2.png - these pictures seem to be incorrect. </FONT></DIV>
<DIV><FONT size=2 face=Arial>In vtkPVCustomTestDriver.cxx there are source lines
like:</FONT></DIV>
<DIV><FONT size=2 face=Arial>...</FONT></DIV>
<DIV><FONT size=2 face=Arial>#ifdef COPROCESSOR_USE_MPI<BR> myid =
vtkMPICommunicator::GetWorldCommunicator()->GetLocalProcessId();<BR>#endif</FONT></DIV>
<DIV><FONT size=2 face=Arial>....</FONT></DIV>
<DIV><FONT size=2 face=Arial>gridBuilder->SetSpacing(spacing);<BR>
double origin[3] = {myid*49*.2,20,300};</FONT></DIV>
<DIV><FONT size=2 face=Arial>.....</FONT></DIV>
<DIV><FONT size=2 face=Arial>If I understand it correctly there should be just a
shift on the x-axis between the grids? The pictures get more and more messy,
when I increase the numer of processes.</FONT></DIV>
<DIV><FONT size=2 face=Arial>After little messing around with the pyton-script
needed to run this example (see bottom of this Mail) I got the following output
when running it with mpirun -n 3: CPPressure0_changedscript_mpirun3.png. The
halfs of the 2nd and 3rd grid are missing.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>What am I doing wrong? Is this example not supposed
to be run with MPI? How does Coprocessing merge the data from different
processes and how does the picture get built?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I already tested this on a different PC with
the same result. I hope you can help me. </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Best wishes</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Marek</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>changed Python Script:</FONT></DIV>
<DIV><FONT size=2 face=Arial>def DoCoProcessing(datadescription):<BR>
timestep = datadescription.GetTimeStep()</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial> grid =
datadescription.GetInputDescriptionByName("input").GetGrid()<BR> pressure
= grid.GetPointData().GetArray('Pressure')</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial># print grid</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>
#grid.GetPointData().SetScalars(pressure)<BR>
obj.SetOutput(grid)<BR># print obj</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial> # get global range of Pressure<BR> di
= trivialproducer.GetDataInformation(0)<BR>
trivialproducer.UpdatePipeline()<BR> di.Update()<BR> pdi =
di.GetPointDataInformation()<BR># print pdi<BR> ai =
pdi.GetArrayInformation('Pressure')<BR> pressurerange =
ai.GetComponentRange(0)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial> contour.Isosurfaces =
.5*(pressurerange[0]+pressurerange[1])</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial> # now output the results to the screen as
well as taking<BR> # a screen shot of the view<BR> #setup a
window<BR> #rep = Show(contour)<BR> #ren = Render()</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial> #set the background color<BR>
#ren.Background=[1,1,1] #white</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial> #set image size<BR> #ren.ViewSize =
[1000, 1000] #[width, height]</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial> #set representation<BR>
#rep.Representation="Surface"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial> #save screenshot<BR>
#gridimagefilename = 'CPGrid'+str(timestep) + '.png'<BR>
#WriteImage(gridimagefilename)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial> rep = Show(trivialproducer)<BR>
#rep.LookupTable = MakeBlueToRedLT(pressurerange[0], pressurerange[1])<BR>
#rep.ColorArrayName = 'Pressure'<BR> #rep.ColorAttributeType =
'POINT_DATA'<BR> #set representation<BR>
rep.Representation="Wireframe"<BR> #rep = Show(contour)<BR> #set the
background color<BR> ren = Render()<BR> ren.Background=[0,0,0]
#white<BR> ren.ViewSize = [1000, 1000] #[width, height]</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial> pressureimagefilename =
'CPPressure'+str(timestep) + '.png'<BR>
WriteImage(pressureimagefilename)<BR> return</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>def
RequestDataDescription(datadescription):<BR> time =
datadescription.GetTime()<BR> timestep =
datadescription.GetTimeStep()<BR> print timestep<BR> if timestep %
20 == 0:<BR> # add in some fields<BR> #print
'added Pressure and wanting to do coprocessing'<BR>
datadescription.GetInputDescriptionByName("input").AddPointField("Pressure")<BR>
datadescription.GetInputDescriptionByName('input').GenerateMeshOn()<BR>
return</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial># the code below is needed to import objects from
paraview.simple<BR># plus the definition of vtkTrivialProducer into this python
script.<BR>try: paraview.simple<BR>except: from paraview.simple import
*</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>trivialproducer = TrivialProducer()<BR>contour =
Contour(Input=trivialproducer)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>obj =
trivialproducer.GetClientSideObject()<BR></FONT></DIV></BODY></HTML>