[openblas] 01/01: fork-handler.patch: fixes hangs of OpenBLAS when called from a program using OpenMP (Closes: #739331)
Sébastien Villemot
sebastien at debian.org
Wed Feb 19 18:00:51 UTC 2014
This is an automated email from the git hooks/post-receive script.
sebastien pushed a commit to branch wheezy
in repository openblas.
commit eb6ae4f12897c67c7e63b5f3b9f942264e23267e
Author: Sébastien Villemot <sebastien at debian.org>
Date: Wed Feb 19 18:44:02 2014 +0100
fork-handler.patch: fixes hangs of OpenBLAS when called from a program using OpenMP (Closes: #739331)
---
debian/changelog | 7 +++++++
debian/patches/fork-handler.patch | 36 ++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 44 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index bc6bcdf..42bc378 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+openblas (0.1.1-6+deb7u3) wheezy; urgency=low
+
+ * fork-handler.patch: fixes hangs of OpenBLAS when called from a program
+ using OpenMP (Closes: #739331)
+
+ -- Sébastien Villemot <sebastien at debian.org> Wed, 19 Feb 2014 18:41:55 +0100
+
openblas (0.1.1-6+deb7u2) stable; urgency=low
* power7.patch: new patch, fixes FTBFS on powerpc machines with Power7 arch
diff --git a/debian/patches/fork-handler.patch b/debian/patches/fork-handler.patch
new file mode 100644
index 0000000..1ef83df
--- /dev/null
+++ b/debian/patches/fork-handler.patch
@@ -0,0 +1,36 @@
+Description: Add fork handler
+ This patches fixes hangs of OpenBLAS when called from a program using OpenMP.
+ Note that this will only work if OpenBLAS is compiled with pthreads
+ (i.e. no OpenMP).
+Origin: upstream, https://github.com/xianyi/OpenBLAS/issues/294#issuecomment-33536895
+Bug: https://github.com/xianyi/OpenBLAS/issues/294
+Bug-Debian: http://bugs.debian.org/739331
+Last-Update: 2014-02-17
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/driver/others/memory.c
++++ b/driver/others/memory.c
+@@ -1220,6 +1220,14 @@ static void gotoblas_memory_init(void) {
+ }
+ #endif
+
++static void openblas_fork_handler()
++{
++ int err;
++ err = pthread_atfork (BLASFUNC(blas_thread_shutdown), blas_thread_init, blas_thread_init);
++ if(err != 0)
++ fprintf(stderr, "OpenBLAS cannot install fork handler. You may meet hang after fork.\n");
++}
++
+ /* Initialization for all function; this function should be called before main */
+
+ static int gotoblas_initialized = 0;
+@@ -1228,6 +1236,8 @@ void CONSTRUCTOR gotoblas_init(void) {
+
+ if (gotoblas_initialized) return;
+
++ openblas_fork_handler();
++
+ #ifdef PROFILE
+ moncontrol (0);
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
index 0fa8a38..50d8af0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@ sgemv_uninitialized_buffer.diff
gemv_crash_big_data.diff
dot_uninitialized_buffer.diff
power7.patch
+fork-handler.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/openblas.git
More information about the debian-science-commits
mailing list