# 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:** 1\
**Showing post:** 2

<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

---

_[View the full topic](https://discourse.paraview.org/t/custom-parallel-source-using-pythonalgorithm/7407)._
