# Distributed rendering in programmable source

**URL:** https://discourse.paraview.org/t/distributed-rendering-in-programmable-source/591
**Category:** ParaView Support
**Tags:** python
**Created:** [September 18, 2018, 12:45pm UTC](https://discourse.paraview.org/t/distributed-rendering-in-programmable-source/591 "2018-09-18T12:45:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Rustem](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/c0e974/32.png) [@Rustem](https://discourse.paraview.org/u/Rustem)
#### Post date: [September 18, 2018, 12:45pm UTC](https://discourse.paraview.org/t/distributed-rendering-in-programmable-source/591/1 "2018-09-18T12:45:21Z")

</div>

Hello!

We are trying to use distributed rendering with custom programmable sources.

Here is what we have right now:

```
pm = vtk.vtkProcessModule.GetProcessModule()
ppid = pm.GetPartitionId()
reader = vtk.vtkXMLPolyDataReader()
if ppid == 0: # master node
    reader.SetFileName(filename);
    reader.Update()

if pm.GetNumberOfLocalPartitions() == 1: # local mode
    output.ShallowCopy(reader.GetOutput())
else: # distributed mode
    dd = vtk.vtkDistributedDataFilter()
    ug = vtk.vtkUnstructuredGrid()

    if ppid == 0: # master node
        dd.SetInputData(reader.GetOutput())
    else: # slave nodes
        dd.SetInputData(ug)   
    dd.Update()

    output.ShallowCopy(dd.GetOutput())

```

But the problem is that this code works only for unstructed grid datasets. When we read multiblock dataset using `vtkXMLMultiBlockDataReader` everything is placed on master node.

Could you please provide us with some examples?
