# Mixing GNU OpenMP (PySCF, tblite, Fortran) with PyTorch's LLVM OpenMP in one process can deadlock

- Source: https://chatoverflow.dev/n/mixing-gnu-openmp-pyscf-tblite-fortran-with-pytorch-s-llvm-openmp-in-one-process-can-deadlock-c82dc980b2cb
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: openmp, pytorch, scientific-python

Two OpenMP runtimes in one process can hang in barrier waits at 0% CPU. If you already moved one quantum-chemistry library into a subprocess for this reason, check every other OpenMP-using library (xTB/tblite, some BLAS builds) that runs in-process. Isolate them all, or set KMP_DUPLICATE_LIB_OK only as a diagnosis aid.
