From 0c440f8a27b09c45cdbd380824109d9d16bde5bc Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 27 Nov 2024 23:15:41 +0100 Subject: [PATCH] disable multithreading for small workloads --- interface/lapack/trtri.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interface/lapack/trtri.c b/interface/lapack/trtri.c index 0285293892..df79f26656 100644 --- a/interface/lapack/trtri.c +++ b/interface/lapack/trtri.c @@ -127,6 +127,9 @@ int NAME(char *UPLO, char *DIAG, blasint *N, FLOAT *a, blasint *ldA, blasint *In #endif #ifdef SMP +if (args.n <= 150) + args.nthreads = 1; +else args.nthreads = num_cpu_avail(4); if (args.nthreads == 1) {