I have a python programmable source which mimics an already working C++
Reader. The Reader works in parallel and correctly gets the Update
Extent assigning to each proc, a different sub-region of the whole. The
Python prog. source works fine in serial mode.
When run in parallel, *all* procs receive the same Update Extent equal
to the Whole Extent, as if the Extent Translator ignores the
parallelism. I get the following printed for the Update Extent:
Process id: 0 >> (0, 63, 0, 31, 0, 24)
Process id: 3 >> (0, 63, 0, 31, 0, 24)
Process id: 2 >> (0, 63, 0, 31, 0, 24)
Process id: 1 >> (0, 63, 0, 31, 0, 24)
Have other been successful with Programmable Source running in parallel?
My script is atached.
Jean --
Swiss National Supercomputing Center
ps = servermanager.sources.ProgrammableSource()
ps.OutputDataSetType = 3
str1 = "rg = self.GetRectilinearGridOutput()\ndims = [64, 32, 25]\nrg.SetWholeExtent(0, dims[0]-1, 0, dims[1]-1, 0, dims[2]-1)"
str2 = "rg = self.GetRectilinearGridOutput()\nexts = rg.GetUpdateExtent()\nwhole = rg.GetWholeExtent()\ndims = [exts[1]-exts[0]+1, exts[3]-exts[2]+1, exts[5]-exts[4]+1]\nrg.SetExtent(exts)\nprint exts\nimport math\nphi = [0]\ntheta = [0]\nR = [.53]\nfor i in range(1,whole[1]+1):\n phi.append(i*2*math.pi/(whole[1]-1))\nfor i in range(1,whole[3]+1):\n theta.append(i*math.pi/(whole[3]-1))\nfor i in range(1,whole[5]+1):\n R.append(.53+i*(1.53-0.53)/(whole[5]-1))\nVTKphi = vtk.vtkFloatArray()\nVTKphi.SetNumberOfTuples(dims[0])\nVTKtheta = vtk.vtkFloatArray()\nVTKtheta.SetNumberOfTuples(dims[1])\nVTKR = vtk.vtkFloatArray()\nVTKR.SetNumberOfTuples(dims[2])\nfor i in range(exts[0], exts[1]+1):\n VTKphi.SetValue(i, phi[i])\nfor j in range(exts[2], exts[3]+1):\n VTKtheta.SetValue(j, theta[j])\nfor k in range(exts[4], exts[5]+1):\n VTKR.SetValue(k, R[k])\nrg.SetXCoordinates(VTKphi)\nrg.SetYCoordinates(VTKtheta)\nrg.SetZCoordinates(VTKR)"
ps.InformationScript = str1
ps.Script = str2
ps.UpdatePipeline()
view = servermanager.GetRenderView()
rep = servermanager.CreateRepresentation(ps, view)
view.ResetCamera()
view.StillRender()
servermanager.ProxyManager().RegisterProxy("sources", "mysource", ps)
servermanager.ProxyManager().RegisterProxy("representations", "mysource", rep)
_______________________________________________
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