# Corrupt kd tree error in XDMF

**URL:** https://discourse.paraview.org/t/corrupt-kd-tree-error-in-xdmf/1543
**Category:** ParaView Support
**Created:** [March 27, 2019, 8:38pm UTC](https://discourse.paraview.org/t/corrupt-kd-tree-error-in-xdmf/1543 "2019-03-27T20:38:15Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Aandreyev](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/34f0e0/32.png) [@Aandreyev](https://discourse.paraview.org/u/Aandreyev)
#### Post date: [March 27, 2019, 8:38pm UTC](https://discourse.paraview.org/t/corrupt-kd-tree-error-in-xdmf/1543/1 "2019-03-27T20:38:15Z")

</div>

Hi all,

I filed an issue for this, but figured I’d reach out here and see if anyone else has run into this issue…  
When I’m running version 5.6.0 in client server mode with the server side compiled with osmesa off-screen rendering (v18.2.5), occasionally I’m getting the following error:

ERROR: In /home/shelf1/compile/visualization/src/paraview/5.6.0\_gui/VTK/Common/DataModel/vtkKdTree.cxx, line 1956  
vtkKdTree (0x573d5fa0): vtkKdTree::BuildMapForDuplicatePoints corrupt k-d tree

I did some searching online, and this may be related to an issue in the discussions here:  
[https://public.kitware.com/pipermail/paraview/2013-March/027686.html](https://public.kitware.com/pipermail/paraview/2013-March/027686.html)

Has anybody else run into this problem? It seems to be quite random and changing the proc number can solve it, and running in serial is guaranteed to.

Link to the issue I submitted:  
[https://gitlab.kitware.com/paraview/paraview/issues/18896](https://gitlab.kitware.com/paraview/paraview/issues/18896)

---

<div class="post-metadata">

### Author: ![Aquan](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@Aquan](https://discourse.paraview.org/u/Aquan)
#### Post date: [January 25, 2020, 12:34pm UTC](https://discourse.paraview.org/t/corrupt-kd-tree-error-in-xdmf/1543/2 "2020-01-25T12:34:17Z")

</div>

I hope this isn’t considered necromancing, but I just wanted to give a heads-up that I’m running into the same error.  
I’m using vtm/vtu datasets, and the error occurs when I try to distribute the mesh between processes with the D3 filter. I see the same behaviour you mentioned, that changing the number of procs solves it, and also if I use prepartioned data in the pvtu format it works fine with any number of procs…

Has there been any update on this issue so far? I’m mostly using ParaView.5.6.2, but I also tried the same case with 5.7 and 5.8, and the error occurs for all of them.

---

<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: [January 27, 2020, 3:57am UTC](https://discourse.paraview.org/t/corrupt-kd-tree-error-in-xdmf/1543/3 "2020-01-27T03:57:28Z")

</div>

Can you share your dataset and steps to reproduce the issue?

---

<div class="post-metadata">

### Author: ![Aquan](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@Aquan](https://discourse.paraview.org/u/Aquan)
#### Post date: [January 28, 2020, 9:39am UTC](https://discourse.paraview.org/t/corrupt-kd-tree-error-in-xdmf/1543/4 "2020-01-28T09:39:56Z")

</div>

Steps to reproduce are:

1. Import dataset
2. Distribute dataset with D3 filter
3. Update pipeline

For me the error appears if I use at least 11 processes. Concerning the dataset: I can share it, but it’s quite large (around 3.5GB). If you could give me an email address I could send you a link to download it.

---

<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: [January 28, 2020, 1:22pm UTC](https://discourse.paraview.org/t/corrupt-kd-tree-error-in-xdmf/1543/6 "2020-01-28T13:22:42Z")

</div>

Could you try with the new Redistribute Dataset filter available in ParaView 5.8 ?

---

<div class="post-metadata">

### Author: ![Aquan](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@Aquan](https://discourse.paraview.org/u/Aquan)
#### Post date: [January 29, 2020, 2:12pm UTC](https://discourse.paraview.org/t/corrupt-kd-tree-error-in-xdmf/1543/7 "2020-01-29T14:12:54Z")

</div>

I tried the new Redistribute Dataset filter. However, when I use it in parallel, paraview seems to hang. At first, I see a lot of activity (high process load), but after a while the load on the pvserver processes drops sharply, and paraview is stuck on “RedistributeDatSetFilter (62%)”. If I use the “Split Cells” setting, instead of “Assign cells uniquely”, then it is stuck on “RedistributeDatSetFilter (81%)”. This behaviour also seems to be independent of the number of process used.

I used it directly on the imported dataset. Do I need to use any other filters before that?

---

<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: [January 29, 2020, 3:13pm UTC](https://discourse.paraview.org/t/corrupt-kd-tree-error-in-xdmf/1543/8 "2020-01-29T15:13:54Z")

</div>

There is no reason for it not to work, nor there is with D3 anyway.

Ideally, if you could reproduce the issues with a smaller dataset and with a smaller number of cores, we could open an issue.

If not, it will require some investigation.

---

<div class="post-metadata">

### Author: ![Aquan](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@Aquan](https://discourse.paraview.org/u/Aquan)
#### Post date: [January 29, 2020, 4:41pm UTC](https://discourse.paraview.org/t/corrupt-kd-tree-error-in-xdmf/1543/9 "2020-01-29T16:41:13Z")

</div>

Ok, I’ll try and see if I can reproduce it with a smaller dataset. The “problem” is, I tried it on some other cases of mine, and everything worked without issues, so it might be a problem with the mesh topology of my current case…
