Dear Paraviewer developers<div><br></div><div>Thanks for the new 3.10.1 release: finally I can get my python batch files run in parallel including the text labels!</div><div><br></div><div>I have one small problem related with a parallel run of a python batch script when pythonCalculator is included</div>
<div><br></div><div>I have added the script below this email and added to the attachment as pycalc.py</div><div><br></div><div>If I run the script with</div><div><br></div><div>pvbatch pycalc.py </div><div>everything is fine</div>
<div><br></div><div>also</div><div><br></div><div>pvbatch --use-offscreen-rendering pycalc.py </div><div>works fine</div><div><br></div><div>Even </div><div><br></div><div>mpirun -np 1 pvbatch --use-offscreen-rendering pycalc.py </div>
<div><br></div><div>runs like a charm</div><div><br></div><div>However, if I do:</div><div><br></div><div>mpirun -np 2 pvbatch --use-offscreen-rendering pycalc.py </div><div><br></div><div>It crashed and I got a whole bunch of error messages</div>
<div><br></div><div>starting with </div><div>Process id: 1 &gt;&gt; Warning: In /tmp/openfoam_build/ParaView-3.10.1/VTK/Parallel/vtkSochetController, line 50</div><div>vtkSocketCrontroller (-xd4a51f0): Already initialized</div>
<div>...</div><div>Error: Cannot find command function for &quot;vtkProcessModeule&quot;&quot;</div><div><br></div><div>If I change in the script the PythonCalcuator for the normal calculator by substituting the lines with Calc for</div>
<div><br></div><div>Calc=Calculator()</div><div>Calc.Function=&#39;U_Z&#39;</div><div><br></div><div>Everything runs fine, even for the mpirun -np 2 </div><div><br></div><div>In other words: the combination of mpirun on multiple processors with PythonCalculator does not seem to  work</div>
<div><br></div><div>I have added the scripts and the error message in the tar ball attachment. Hopefully can shed some light on this, as the PythonCalculator would be very handy to use in script, also when I am running parallel</div>
<div><br></div><div>Thanks in advance!</div><div><br></div><div>Regards</div><div><br></div><div>Eelco </div><div><br></div><div><br></div><div><br></div><div><br></div><div>+++++++++++++++++++++++++++++++</div><div><div>
try: paraview.simple</div><div>except: from paraview.simple import *</div><div>paraview.simple._DisableFirstRenderCameraReset()</div><div><br></div><div>sm=servermanager</div><div>sm.Connect()</div><div><br></div><div>nbprocs = sm.ActiveConnection.GetNumberOfDataPartitions()</div>
<div>print (&quot;RENDERING ON # %d cores: &quot;)%(nbprocs)</div><div><br></div><div>U_pxz_y0_vtk = LegacyVTKReader(FileNames=[&#39;U_pxz_y0.vtk&#39;] )</div><div><br></div><div>RenderView1 = sm.CreateRenderView()</div><div>
<br></div><div>Calc = PythonCalculator()</div><div>Calc.Expression = &#39;U&#39;</div><div><br></div><div>DataRepresentation1 =  sm.CreateRepresentation(ProcessIdScalars(Calc),RenderView1)</div><div><br></div><div>RenderView1.StillRender()</div>
<div>RenderView1.WriteImage(&quot;bla.png&quot;,&quot;vtkPNGWriter&quot;,1)</div><div>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</div></div>