# Interactive 3D widget, custom filter plugin and MPI

**URL:** https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201
**Category:** Development
**Created:** [December 18, 2019, 7:32am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201 "2019-12-18T07:32:27Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Artem\_Bodrin](https://discourse.paraview.org/user_avatar/discourse.paraview.org/artem_bodrin/32/2063_2.png) [@Artem\_Bodrin](https://discourse.paraview.org/u/Artem_Bodrin)
#### Post date: [December 18, 2019, 7:32am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/1 "2019-12-18T07:32:27Z")

</div>

Good times to all of you, dear community!

I have an idea to create a custom filter with a 3d widget. It will have 2 inputs: any surface (simple for start) and a pointset.  
The surface is a source for calculations, while the pointset is needed to define a handles of 3D widget, user can interact with.  
Images attached shows what I’m talking about: blue spheres are handles that user can drag around.  
Everything seems working fine, when paraview started standalone, but things get broken in MPI mode.  
Looks like in MPI mode the pointset data is coming from rank #0 only. I can not understand why. I spend a lot of time stepping in debugger, trying to figure out  
what is going on under the hood, but the level of abstraction is quite high, and I did not found any developers documentation about how properly create 3D widgets, their representations and their communication with pipeline or so.

Can anyone please point me to direction, where I could get some knowledge? Where data should be synchronized (if it’s up to developer)?  
I have studied both VTK user guide & ParaView user guide, tried to find a code examples inside ParaView sources…

ParaView 5.7.0, MPI mode initiated as follows:  
`mpirun -np2 ./pvserver`

Any help will be gladly accepted. Regards,  
Artem

Standalone mode:

 ![non-mpi%20mode](https://discourse.paraview.org/uploads/default/original/2X/8/834439c858b0056e5b179ea53f66951734d411a8.png)

MPI mode:

 ![mpi%20mode](https://discourse.paraview.org/uploads/default/original/2X/e/e5f2c0ef2c1946696640fe216a9cba828ce1c7ac.png)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2019, 8:40am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/2 "2019-12-18T08:40:09Z")

</div>

> [@Artem\_Bodrin](#):
>
> Looks like in MPI mode the pointset data is coming from rank #0 only. I can not understand why

Maybe you can replicate your pointset on all nodes using AppendReduce filter.

---

<div class="post-metadata">

### Author: ![Artem\_Bodrin](https://discourse.paraview.org/user_avatar/discourse.paraview.org/artem_bodrin/32/2063_2.png) [@Artem\_Bodrin](https://discourse.paraview.org/u/Artem_Bodrin)
#### Post date: [December 18, 2019, 9:04am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/3 "2019-12-18T09:04:22Z")

</div>

Sorry, I do not follow. Where I should instantiate that filter?  
In a debugging session I’ve met all the points of pointset distributed between ranks, I guess I must put them together at some point, but I can not understand where. It’s clear that on a render-server side, but where exacly… in RequestData method?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2019, 9:05am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/4 "2019-12-18T09:05:38Z")

</div>

Between your ExtractSelection and your CustomFilter.

---

<div class="post-metadata">

### Author: ![Artem\_Bodrin](https://discourse.paraview.org/user_avatar/discourse.paraview.org/artem_bodrin/32/2063_2.png) [@Artem\_Bodrin](https://discourse.paraview.org/u/Artem_Bodrin)
#### Post date: [December 18, 2019, 9:06am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/5 "2019-12-18T09:06:39Z")

</div>

Oh, I see… in a pipeline… Is there any option to do that programmatically in my custom filter?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2019, 9:07am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/6 "2019-12-18T09:07:02Z")

</div>

Yes, but you may want to check that it is resolving your issue first.

---

<div class="post-metadata">

### Author: ![Artem\_Bodrin](https://discourse.paraview.org/user_avatar/discourse.paraview.org/artem_bodrin/32/2063_2.png) [@Artem\_Bodrin](https://discourse.paraview.org/u/Artem_Bodrin)
#### Post date: [December 18, 2019, 9:11am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/7 "2019-12-18T09:11:45Z")

</div>

Yes, It does

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2019, 9:12am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/8 "2019-12-18T09:12:52Z")

</div>

You can then just integrate it in your filter to append-reduce your pointset data before using it.

---

<div class="post-metadata">

### Author: ![Artem\_Bodrin](https://discourse.paraview.org/user_avatar/discourse.paraview.org/artem_bodrin/32/2063_2.png) [@Artem\_Bodrin](https://discourse.paraview.org/u/Artem_Bodrin)
#### Post date: [December 18, 2019, 9:13am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/9 "2019-12-18T09:13:53Z")

</div>

I guess it will be in RequestData method, in the very beginning?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 18, 2019, 9:14am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/10 "2019-12-18T09:14:49Z")

</div>

Yes.

---

<div class="post-metadata">

### Author: ![Artem\_Bodrin](https://discourse.paraview.org/user_avatar/discourse.paraview.org/artem_bodrin/32/2063_2.png) [@Artem\_Bodrin](https://discourse.paraview.org/u/Artem_Bodrin)
#### Post date: [December 18, 2019, 9:15am UTC](https://discourse.paraview.org/t/interactive-3d-widget-custom-filter-plugin-and-mpi/3201/11 "2019-12-18T09:15:22Z")

</div>

Alright, thanks a lot, Mathieu
