# pvserver and pvbatch number of threads

**URL:** https://discourse.paraview.org/t/pvserver-and-pvbatch-number-of-threads/16296
**Category:** ParaView Support
**Created:** [March 11, 2025, 1:15pm UTC](https://discourse.paraview.org/t/pvserver-and-pvbatch-number-of-threads/16296 "2025-03-11T13:15:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hunter.gilbert](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/h/ecccb3/32.png) [@hunter.gilbert](https://discourse.paraview.org/u/hunter.gilbert)
#### Post date: [March 11, 2025, 1:15pm UTC](https://discourse.paraview.org/t/pvserver-and-pvbatch-number-of-threads/16296/1 "2025-03-11T13:15:28Z")

</div>

I’m using the headless paraview 5.13.0 and have a question about threading and MPI parallelism. When I launch pvbatch or pvserver with no other options, it appears that by default there are as many threads created as CPU cores. I’d like to have control over how much of the cpu resources are used. If launched with mpiexec and a specified number of processes, there is not one thread per process launched, but instead it appears that each process spawns one thread per core, resulting in an absolutely huge number of threads. Htop on linux reports that all of the threads are consuming cpu resources. Is this normal behavior? Is there some way that I can control the number of threads per process or the total number of threads? I can’t seem to find anything about this in the documentation or in the output of “pvbatch --help”.

---

<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: [March 11, 2025, 2:09pm UTC](https://discourse.paraview.org/t/pvserver-and-pvbatch-number-of-threads/16296/2 "2025-03-11T14:09:28Z")

</div>

> [@hunter.gilbert](#):
>
> Is this normal behavior?

Yes, there is no reason to run pvserver with mpi on a single node as most filters are multithreaded

> Is there some way that I can control the number of threads per process or the total number of threads?

Yes!  
Set the environnement variable:  
`VTK_SMP_BACKEND_IN_USE` to `Sequential`

See: [https://www.kitware.com/vtk-shared-memory-parallelism-tools-2021-updates/](https://www.kitware.com/vtk-shared-memory-parallelism-tools-2021-updates/)
