Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workaround for the OpenBLAS v0.3.1 matrices multiplication issue #8396

Merged
merged 7 commits into from May 28, 2019
@@ -18,13 +18,23 @@ sources = ['v%(version)s.tar.gz']
patches = [
('large.tgz', '.'),
('timing.tgz', '.'),
# this patch together with buildopts = 'USE_SIMPLE_THREADED_LEVEL3=1'
# is a workaround for the matrix multiplication issues
# https://lists.ugent.be/wws/arc/easybuild/2019-05/msg00006.html
# https://github.com/eylenth/Openblas_matrix_issue
'OpenBLAS-%(version)s_disable-special-handling-of-OpenMP-thread-memory-allocation.patch',
]
checksums = [
'1f5e956f35f3acdd3c74516e955d797a320c2e0135e31d838cbdb3ea94d0eb33', # v0.3.1.tar.gz
'f328d88b7fa97722f271d7d0cfea1c220e0f8e5ed5ff01d8ef1eb51d6f4243a1', # large.tgz
'999c65f8ea8bd4eac7f1c7f3463d4946917afd20a997807300fe35d70122f3af', # timing.tgz
# OpenBLAS-0.3.1_disable-special-handling-of-OpenMP-thread-memory-allocation.patch
'c85de436d6fff5d9cec1e24127ea9921551cdee373319dbade922d5cd3facd6a',
]

# added as workaround for the matrices multiplication issue. see the patches above
buildopts = 'USE_SIMPLE_THREADED_LEVEL3=1'
This conversation was marked as resolved by pescobar

This comment has been minimized.

Copy link
@boegel

boegel May 28, 2019

Member

@pescobar Please add a comment above this line to explain why this is being added?

This comment has been minimized.

Copy link
@pescobar

pescobar May 28, 2019

Author Member

done


# extensive testing can be enabled by uncommenting the line below
# runtest = 'PATH=.:$PATH lapack-timing'

@@ -0,0 +1,60 @@
From b14f44d2adbe1ec8ede0cdf06fb8b09f3c4b6e43 Mon Sep 17 00:00:00 2001
From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Date: Thu, 19 Jul 2018 08:57:56 +0200
Subject: [PATCH] Temporarily disable special handling of OPENMP thread memory
allocation

for issue #1673
---
driver/others/memory.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/driver/others/memory.c b/driver/others/memory.c
index 98bcfb216..772c1f232 100644
--- a/driver/others/memory.c
+++ b/driver/others/memory.c
@@ -140,7 +140,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif

#ifndef BUFFERS_PER_THREAD
-#ifdef USE_OPENMP
+#ifdef USE_OPENMP_UNUSED
#define BUFFERS_PER_THREAD (MAX_CPU_NUMBER * 2 * MAX_PARALLEL_NUMBER)
#else
#define BUFFERS_PER_THREAD NUM_BUFFERS
@@ -363,7 +363,7 @@ int blas_get_cpu_number(void){
#endif

// blas_goto_num = 0;
-#ifndef USE_OPENMP
+#ifndef USE_OPENMP_UNUSED
blas_goto_num=openblas_num_threads_env();
if (blas_goto_num < 0) blas_goto_num = 0;

@@ -494,7 +494,7 @@ static const int allocation_block_size = BUFFER_SIZE + sizeof(struct alloc_t);
#endif

/* Holds pointers to allocated memory */
-#if defined(SMP) && !defined(USE_OPENMP)
+#if defined(SMP) && !defined(USE_OPENMP_UNUSED)
/* This is the number of threads than can be spawned by the server, which is the
server plus the number of threads in the thread pool */
# define MAX_ALLOCATING_THREADS MAX_CPU_NUMBER * 2 * MAX_PARALLEL_NUMBER +1
@@ -532,7 +532,7 @@ static BLASULONG alloc_lock = 0UL;

/* Returns a pointer to the start of the per-thread memory allocation data */
static __inline struct alloc_t ** get_memory_table() {
-#if defined(SMP) && !defined(USE_OPENMP)
+#if defined(SMP) && !defined(USE_OPENMP_UNUSED)
# if !defined(HAS_COMPILER_TLS)
# if defined(OS_WINDOWS)
int local_memory_table_pos = (int)::TlsGetValue(local_storage_key);
@@ -1057,7 +1057,7 @@ static volatile int memory_initialized = 0;
/* 2 : Thread */

static void blas_memory_init(){
-#if defined(SMP) && !defined(USE_OPENMP)
+#if defined(SMP) && !defined(USE_OPENMP_UNUSED)
next_memory_table_pos = 0;
# if !defined(HAS_COMPILER_TLS)
# if defined(OS_WINDOWS)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.