# pvpython/pvbatch with MPI Build Causes Deadlock on Consecutive Runs

**URL:** https://discourse.paraview.org/t/pvpython-pvbatch-with-mpi-build-causes-deadlock-on-consecutive-runs/15710
**Category:** ParaView Support
**Tags:** mpi, python
**Created:** [November 11, 2024, 3:56pm UTC](https://discourse.paraview.org/t/pvpython-pvbatch-with-mpi-build-causes-deadlock-on-consecutive-runs/15710 "2024-11-11T15:56:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anilbeycorintis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anilbeycorintis/32/15523_2.png) [@anilbeycorintis](https://discourse.paraview.org/u/anilbeycorintis)
#### Post date: [November 11, 2024, 3:56pm UTC](https://discourse.paraview.org/t/pvpython-pvbatch-with-mpi-build-causes-deadlock-on-consecutive-runs/15710/1 "2024-11-11T15:56:18Z")

</div>

I’m experiencing an issue with ParaView’s `pvpython` and `pvbatch` when using an MPI-enabled build (`ParaView-5.11.2-egl-MPI-Linux-Python3.9`). Specifically, when I run `pvpython` or `pvbatch` scripts multiple times from the same parent process (e.g., within a Python testing framework like `pytest`), the first execution completes successfully, but subsequent runs hang indefinitely.

- **Is there a supported method to disable or bypass MPI initialization in `pvpython`/`pvbatch` when using an MPI-enabled build?**
- **Are there any known workarounds or patches that address this issue?**
- **Would building ParaView from source without MPI support be the only viable solution?**

I appreciate any guidance or suggestions you can provide.

---

<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: [November 12, 2024, 9:48am UTC](https://discourse.paraview.org/t/pvpython-pvbatch-with-mpi-build-causes-deadlock-on-consecutive-runs/15710/2 "2024-11-12T09:48:25Z")

</div>

> [@anilbeycorintis](#):
>
> Is there a supported method to disable or bypass MPI initialization in `pvpython`/`pvbatch` when using an MPI-enabled build?

`--no-mpi` should do the trick

Still an issue to open, this should not be needed. Could you open it ?

[https://gitlab.kitware.com/paraview/paraview/-/issues](https://gitlab.kitware.com/paraview/paraview/-/issues)

---

<div class="post-metadata">

### Author: ![anilbeycorintis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anilbeycorintis/32/15523_2.png) [@anilbeycorintis](https://discourse.paraview.org/u/anilbeycorintis)
#### Post date: [November 12, 2024, 1:35pm UTC](https://discourse.paraview.org/t/pvpython-pvbatch-with-mpi-build-causes-deadlock-on-consecutive-runs/15710/3 "2024-11-12T13:35:28Z")

</div>

Even when no-mpi flag is passed there are still multiple processes getting launched.

![Screenshot from 2024-11-12 13-56-53](https://discourse.paraview.org/uploads/default/original/2X/c/c285a2395475dce55996fa14cd87c67af072b270.png)

Ok thanks I will create an issue on the repository.

---

<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: [November 12, 2024, 1:41pm UTC](https://discourse.paraview.org/t/pvpython-pvbatch-with-mpi-build-causes-deadlock-on-consecutive-runs/15710/4 "2024-11-12T13:41:59Z")

</div>

> [@anilbeycorintis](#):
>
> Even when no-mpi flag is passed there are still multiple processes getting launched.

I do not see this behavior, even without the `--no-mpi` flag

 ![a](https://discourse.paraview.org/uploads/default/original/2X/f/f5290f80e7e6a8c8d8de2b55689ae42cadf28372.png)
