<div dir="ltr">I normally run Paraview on my workstation with mpi support (14 cores). It's been working fine like this for a year.<div><br></div><div>For some reason however, the debug/output messages windows dont work when running in mpi (e.g. print "hello", returns nothing). But they do work when I turn mpi off.</div><div><br></div><div>I recently wrote a few new programmable filters, and while they work perfectly with mpi off, the hand and dont do anything with mpi on.</div><div><br></div><div>Any idea?</div><div><br></div><div>-ashton</div><div><br></div><div>p.s. heres one of the filters for example;</div><div>
<pre style="margin-top:12px;margin-bottom:0px"><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">from</span><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,0,255)">paraview.numpy_support</span><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">import</span><span style="font-family:monospace"> vtk_to_numpy</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">import</span><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,0,255)">vtkCommonDataModelPython</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">import</span><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,0,255)">numpy</span><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">as</span><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,0,255)">np</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">from</span><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,0,255)">scipy.optimize</span><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">import</span><span style="font-family:monospace"> curve_fit</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;font-family:monospace"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">if</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(0,128,0)">type</span><span style="font-family:monospace">(</span><span style="font-family:monospace;color:rgb(0,128,0)">self</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">GetInputDataObject(</span><span style="font-family:monospace;color:rgb(102,102,102)">0</span><span style="font-family:monospace">,</span><span style="font-family:monospace;color:rgb(102,102,102)">0</span><span style="font-family:monospace">)) </span><span style="font-family:monospace;font-weight:600;color:rgb(170,34,255)">is</span><span style="font-family:monospace"> vtkCommonDataModelPython</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">vtkUnstructuredGrid </span><span style="font-family:monospace;font-weight:600;color:rgb(170,34,255)">and</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(0,128,0)">type</span><span style="font-family:monospace">(</span><span style="font-family:monospace;color:rgb(0,128,0)">self</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">GetInputDataObject(</span><span style="font-family:monospace;color:rgb(102,102,102)">0</span><span style="font-family:monospace">,</span><span style="font-family:monospace;color:rgb(102,102,102)">1</span><span style="font-family:monospace">)) </span><span style="font-family:monospace;font-weight:600;color:rgb(170,34,255)">is</span><span style="font-family:monospace"> vtkCommonDataModelPython</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">vtkPolyData:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace"> g </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(102,102,102)">0</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace"> p </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(102,102,102)">1</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">elif</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(0,128,0)">type</span><span style="font-family:monospace">(</span><span style="font-family:monospace;color:rgb(0,128,0)">self</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">GetInputDataObject(</span><span style="font-family:monospace;color:rgb(102,102,102)">0</span><span style="font-family:monospace">,</span><span style="font-family:monospace;color:rgb(102,102,102)">1</span><span style="font-family:monospace">)) </span><span style="font-family:monospace;font-weight:600;color:rgb(170,34,255)">is</span><span style="font-family:monospace"> vtkCommonDataModelPython</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">vtkUnstructuredGrid </span><span style="font-family:monospace;font-weight:600;color:rgb(170,34,255)">and</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(0,128,0)">type</span><span style="font-family:monospace">(</span><span style="font-family:monospace;color:rgb(0,128,0)">self</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">GetInputDataObject(</span><span style="font-family:monospace;color:rgb(102,102,102)">0</span><span style="font-family:monospace">,</span><span style="font-family:monospace;color:rgb(102,102,102)">0</span><span style="font-family:monospace">)) </span><span style="font-family:monospace;font-weight:600;color:rgb(170,34,255)">is</span><span style="font-family:monospace"> vtkCommonDataModelPython</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">vtkPolyData:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace"> g </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(102,102,102)">1</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace"> p </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(102,102,102)">0</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">else</span><span style="font-family:monospace">:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">print</span><span style="font-family:monospace">(</span><span style="font-family:monospace;color:rgb(186,33,33)">'ERROR'</span><span style="font-family:monospace">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">return</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;font-family:monospace;font-weight:600;color:rgb(0,128,0)"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace;font-style:italic;color:rgb(64,128,128)"># import the grid</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">Vs </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> inputs[g]</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">PointData[</span><span style="font-family:monospace;color:rgb(186,33,33)">'Vs'</span><span style="font-family:monospace">]</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">depth </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> inputs[g]</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">PointData[</span><span style="font-family:monospace;color:rgb(186,33,33)">'depth'</span><span style="font-family:monospace">]</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">z </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> inputs[</span><span style="font-family:monospace;color:rgb(102,102,102)">0</span><span style="font-family:monospace">]</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">PointData[</span><span style="font-family:monospace;color:rgb(186,33,33)">'z'</span><span style="font-family:monospace">]</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;font-family:monospace"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace;font-style:italic;color:rgb(64,128,128)"># setup output</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">output</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">PointData</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">append(Vs, </span><span style="font-family:monospace;color:rgb(186,33,33)">'Vs'</span><span style="font-family:monospace">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">output</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">PointData</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">append(depth, </span><span style="font-family:monospace;color:rgb(186,33,33)">'depth'</span><span style="font-family:monospace">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">output</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">PointData</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">append(z, </span><span style="font-family:monospace;color:rgb(186,33,33)">'z'</span><span style="font-family:monospace">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;font-family:monospace"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace;font-style:italic;color:rgb(64,128,128)"># import the profile</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">Vs_profile </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> inputs[p]</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">PointData[</span><span style="font-family:monospace;color:rgb(186,33,33)">'Vs'</span><span style="font-family:monospace">]</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">depth_profile </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> inputs[p]</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">PointData[</span><span style="font-family:monospace;color:rgb(186,33,33)">'depth'</span><span style="font-family:monospace">]</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;font-family:monospace"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">def</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(0,0,255)">func</span><span style="font-family:monospace">(x, a, b, c, d,e):</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace"> </span><span style="font-family:monospace;font-weight:600;color:rgb(0,128,0)">return</span><span style="font-family:monospace"> a </span><span style="font-family:monospace;color:rgb(102,102,102)">+</span><span style="font-family:monospace"> b</span><span style="font-family:monospace;color:rgb(102,102,102)">*</span><span style="font-family:monospace">x </span><span style="font-family:monospace;color:rgb(102,102,102)">+</span><span style="font-family:monospace"> c</span><span style="font-family:monospace;color:rgb(102,102,102)">*</span><span style="font-family:monospace">x</span><span style="font-family:monospace;color:rgb(102,102,102)">**2</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(102,102,102)">+</span><span style="font-family:monospace"> d</span><span style="font-family:monospace;color:rgb(102,102,102)">*</span><span style="font-family:monospace">x</span><span style="font-family:monospace;color:rgb(102,102,102)">**3</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(102,102,102)">+</span><span style="font-family:monospace"> e</span><span style="font-family:monospace;color:rgb(102,102,102)">*</span><span style="font-family:monospace">x</span><span style="font-family:monospace;color:rgb(102,102,102)">**4</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;font-family:monospace;color:rgb(102,102,102)"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">nanx </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> np</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">argwhere(np</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">isnan(depth_profile))</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">nany </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> np</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">argwhere(np</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">isnan(Vs_profile))</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">nani </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> np</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">unique(np</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">append(nanx,nany))</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">xdata </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> numpy</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">delete(depth_profile, nani)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">ydata </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> numpy</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">delete(Vs_profile, nani)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;font-family:monospace"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">popt, pcov1 </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> curve_fit(func, xdata, ydata)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;font-family:monospace"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px;font-family:monospace"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">Vs_theory </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> popt[</span><span style="font-family:monospace;color:rgb(102,102,102)">0</span><span style="font-family:monospace">] </span><span style="font-family:monospace;color:rgb(102,102,102)">+</span><span style="font-family:monospace"> popt[</span><span style="font-family:monospace;color:rgb(102,102,102)">1</span><span style="font-family:monospace">]</span><span style="font-family:monospace;color:rgb(102,102,102)">*</span><span style="font-family:monospace">depth </span><span style="font-family:monospace;color:rgb(102,102,102)">+</span><span style="font-family:monospace"> popt[</span><span style="font-family:monospace;color:rgb(102,102,102)">2</span><span style="font-family:monospace">]</span><span style="font-family:monospace;color:rgb(102,102,102)">*</span><span style="font-family:monospace">depth</span><span style="font-family:monospace;color:rgb(102,102,102)">**2</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(102,102,102)">+</span><span style="font-family:monospace"> popt[</span><span style="font-family:monospace;color:rgb(102,102,102)">3</span><span style="font-family:monospace">]</span><span style="font-family:monospace;color:rgb(102,102,102)">*</span><span style="font-family:monospace">depth</span><span style="font-family:monospace;color:rgb(102,102,102)">**3</span><span style="font-family:monospace"> </span><span style="font-family:monospace;color:rgb(102,102,102)">+</span><span style="font-family:monospace"> popt[</span><span style="font-family:monospace;color:rgb(102,102,102)">4</span><span style="font-family:monospace">]</span><span style="font-family:monospace;color:rgb(102,102,102)">*</span><span style="font-family:monospace">depth</span><span style="font-family:monospace;color:rgb(102,102,102)">**4</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;font-family:monospace;color:rgb(102,102,102)"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">diff </span><span style="font-family:monospace;color:rgb(102,102,102)">=</span><span style="font-family:monospace"> Vs </span><span style="font-family:monospace;color:rgb(102,102,102)">-</span><span style="font-family:monospace"> Vs_theory </span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">per_diff</span><span style="font-family:monospace;color:rgb(102,102,102)">=100*</span><span style="font-family:monospace">diff</span><span style="font-family:monospace;color:rgb(102,102,102)">/</span><span style="font-family:monospace">Vs_theory</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:monospace">output</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">PointData</span><span style="font-family:monospace;color:rgb(102,102,102)">.</span><span style="font-family:monospace">append(per_diff, </span><span style="font-family:monospace;color:rgb(186,33,33)">'perturbation'</span><span style="font-family:monospace">)</span></pre>
<pre style="margin-top:0px;margin-bottom:12px;font-family:monospace"><br></pre></div></div>