# Container with both petsc and tespy

**URL:** <https://discourse.opengeosys.org/t/container-with-both-petsc-and-tespy/1736>\
**Category:** Help & Support\
**Created:** [November 19, 2025, 2:50pm UTC](https://discourse.opengeosys.org/t/container-with-both-petsc-and-tespy/1736 "2025-11-19T14:50:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![einsor](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/e/bcef8e/32.png) [@einsor](https://discourse.opengeosys.org/u/einsor)\
**Post date:** [November 19, 2025, 2:50pm UTC](https://discourse.opengeosys.org/t/container-with-both-petsc-and-tespy/1736/1 "2025-11-19T14:50:04Z")

</div>

I am looking for a way to run my coupled ogs-tespy project where we have a system of interconnected boreholes with a parallel solver to speed up the calculations. The official containers does not seem to support the need callback functionality required to interface between tespy and ogs, We have tried to compile from source also but stumble into problems, seems like we need the OGS\_BUILD\_WHEEL option but then we get the error:  
Missing in Pythons binaries\_list: [‘binaryToPVTU’]  
CMake Error at CMakeLists.txt:248 (message):  
Binary list comparison failed. Please update binaries\_list in  
provide\_ogs\_cli\_tools\_via\_wheel.py!

Anyone have a proven method to have:

- petsc
- python callback ( import ogs.callback)
- tespy

---

<div class="post-metadata">

**Author:** ![M\_Jaeschke](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@M\_Jaeschke](https://discourse.opengeosys.org/u/M_Jaeschke)\
**Post date:** [November 19, 2025, 7:16pm UTC](https://discourse.opengeosys.org/t/container-with-both-petsc-and-tespy/1736/2 "2025-11-19T19:16:10Z")

</div>

Dear Einsor,

really nice that you use the feature of coupling ogs with tespy. In the current version of ogs, the Heat-Transport-BHE process did not support the parallelization with petsc. During the last year, we have implemented some settings to speed up the calculation of the BHE process. First of all, you can use the option `use_algebraic_bc` [OGS: [tag] use\_algebraic\_bc](https://doxygen.opengeosys.org/6.5.6/d2/dcd/ogs_file_param __prj__ processes __process__ HEAT_TRANSPORT_BHE__use_algebraic_bc.html)

Please check carefully, if your equation system is linear - if so, the `linear` option is valid and allows a faster calculation: [OGS: [tag] linear](https://doxygen.opengeosys.org/6.5.6/db/dcb/ogs_file_param __prj__ processes __process__ HEAT_TRANSPORT_BHE__linear.html)

If you activate the `use_algebraic_bc`, I recommend to use `solver_type` the `LeastSquareCG` and the `precon_type` `LeastSquareDIAGONAL`. With the environment variable OMP\_NUM\_THREADS you can control, how many cores are used from the linear solver - be careful, from my experience only large models show a speed up in calculation with more cores.

Please let me know, if it helps or if you problems to use this advanced options.

Best regards,  
Max

---

<div class="post-metadata">

**Author:** ![bilke](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/bilke/32/868_2.png) [@bilke](https://discourse.opengeosys.org/u/bilke)\
**Post date:** [November 20, 2025, 7:04am UTC](https://discourse.opengeosys.org/t/container-with-both-petsc-and-tespy/1736/3 "2025-11-20T07:04:13Z")

</div>

PETSc is not supported when building wheels. But regular PETSc builds (either from source or by downloading and using a pre-built container) can use the Python interfaces.
