# custom parallel source using pythonalgorithm

**URL:** https://discourse.paraview.org/t/custom-parallel-source-using-pythonalgorithm/7407
**Category:** ParaView Support
**Tags:** python
**Created:** [June 14, 2021, 2:15pm UTC](https://discourse.paraview.org/t/custom-parallel-source-using-pythonalgorithm/7407 "2021-06-14T14:15:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hari](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/h/cdc98d/32.png) [@hari](https://discourse.paraview.org/u/hari)
#### Post date: [June 14, 2021, 2:15pm UTC](https://discourse.paraview.org/t/custom-parallel-source-using-pythonalgorithm/7407/1 "2021-06-14T14:15:24Z")

</div>

Hi Kitware,

I am trying to develop a parallel plugin using vtkpythonalgorithmbase. This plugin is a parallel source which reads the raw simulation data. Further, it is a parallel, i.e, each processor reads its part of the data and UpdataExtent() key is updated accordingly.

However, I am some issues when running paraview in client sever mode, where pvserver is run on multiple processors, only the processor 0 is calling RequestData and rest of processors are not going past RequestInformation.

I have attached the plugin below. Any help is appreciated. Thanks in advance

Regards,  
Hari  
[pv\_plugin.py](https://discourse.paraview.org/uploads/short-url/uCiKLtnkkkAYK8raKBLKZhMz0EJ.py) (6.3 KB)

---

<div class="post-metadata">

### Author: ![pavel](https://discourse.paraview.org/user_avatar/discourse.paraview.org/pavel/32/8287_2.png) [@pavel](https://discourse.paraview.org/u/pavel)
#### Post date: [January 26, 2022, 10:29pm UTC](https://discourse.paraview.org/t/custom-parallel-source-using-pythonalgorithm/7407/2 "2022-01-26T22:29:20Z")

</div>

Hi Harikrishna,

For working in parallel in client-server mode I have in _RequestInformation()_:

```auto
def RequestInformation(self, request, inInfoVec, outInfoVec):
                
        outInfo = outInfoVec.GetInformationObject(0)
        outInfo.Set(vtkAlgorithm.CAN_HANDLE_PIECE_REQUEST(), 1)

        ...

```

and in _RequestData()_:

```auto
def RequestData(self, request, inInfoVec, outInfoVec):
                  
        executive = self.GetExecutive()        
        outInfo = executive.GetOutputInformation(0)        
        
        # MPI info:        
        part = outInfo.Get(executive.UPDATE_PIECE_NUMBER())        
        nparts = outInfo.Get(executive.UPDATE_NUMBER_OF_PIECES())        
        nghosts = outInfo.Get(executive.UPDATE_NUMBER_OF_GHOST_LEVELS())

        ...

```

This will work also without MPI mode (with single pvserver running).

Please let me know if it is still actual for you.

Best Regards,  
Pavel
