From a7ed60bfe93a73df853be560244aa33a774088ac Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 21 Dec 2023 20:05:23 +0100 Subject: [PATCH] Add lower limit for multithreading --- interface/lapack/gesv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/interface/lapack/gesv.c b/interface/lapack/gesv.c index 1753503299..546c2bed2d 100644 --- a/interface/lapack/gesv.c +++ b/interface/lapack/gesv.c @@ -114,7 +114,14 @@ int NAME(blasint *N, blasint *NRHS, FLOAT *a, blasint *ldA, blasint *ipiv, #ifdef SMP args.common = NULL; - args.nthreads = num_cpu_avail(4); +#ifndef DOUBLE + if (args.m*args.n < 40000) +#else + if (args.m*args.n < 10000) +#endif + args.nthreads=1; + else + args.nthreads = num_cpu_avail(4); if (args.nthreads == 1) { #endif