From 898a8dcaba6d86358ae73575926f8689d6ede155 Mon Sep 17 00:00:00 2001 From: Andrew <16061801+brada4@users.noreply.github.com> Date: Sat, 20 Oct 2018 10:55:04 +0300 Subject: [PATCH 1/3] init From c7bbf9c987a0473aafbd8a4f48ed07cd52fccc38 Mon Sep 17 00:00:00 2001 From: Andrew <16061801+brada4@users.noreply.github.com> Date: Sat, 20 Oct 2018 11:13:29 +0300 Subject: [PATCH 2/3] Attempt to tame _hemv threading #1820 --- interface/zhemv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/interface/zhemv.c b/interface/zhemv.c index d1996ad69..8995ca1c2 100644 --- a/interface/zhemv.c +++ b/interface/zhemv.c @@ -195,7 +195,12 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint n, void *VALPHA buffer = (FLOAT *)blas_memory_alloc(1); #ifdef SMP - nthreads = num_cpu_avail(2); + // see graph in issue #1820 for explanation and room for improvement + if (n<362) { + nthreads = 1 ; + } else { + nthreads = num_cpu_avail(2); + }; if (nthreads == 1) { #endif From a293bdcd5eaa610ed960264c4e1c48af662502e9 Mon Sep 17 00:00:00 2001 From: Andrew <16061801+brada4@users.noreply.github.com> Date: Sat, 20 Oct 2018 21:37:53 +0300 Subject: [PATCH 3/3] re-arrange new code for readability --- interface/zhemv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/interface/zhemv.c b/interface/zhemv.c index 8995ca1c2..9c31f31d9 100644 --- a/interface/zhemv.c +++ b/interface/zhemv.c @@ -43,6 +43,10 @@ #include "functable.h" #endif +// this is smallest dimension N of square input a to permit threading +// see graph in issue #1820 for explanation +#define MULTI_THREAD_MINIMAL 362 + #ifdef XDOUBLE #define ERROR_NAME "XHEMV " #elif defined(DOUBLE) @@ -195,8 +199,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint n, void *VALPHA buffer = (FLOAT *)blas_memory_alloc(1); #ifdef SMP - // see graph in issue #1820 for explanation and room for improvement - if (n<362) { + if (n