Bug 1149032 - ATLAS is not built thread safe
Summary: ATLAS is not built thread safe
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: atlas
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Frantisek Kluknavsky
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1181369
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-03 01:11 UTC by Susi Lehtola
Modified: 2015-02-19 02:59 UTC (History)
4 users (show)

Fixed In Version: atlas-3.10.1-18.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-19 02:59:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Susi Lehtola 2014-10-03 01:11:44 UTC
Hi,


it seems the version of ATLAS in Fedora 20 is not thread-safe. Namely, calling ATLAS functions within OpenMP sections of my code produces insane results, while the same code runs properly in sequential mode.

I also have no problems using the OpenMP version of OpenBLAS.

Looking at the library
$ ldd /usr/lib64/atlas/libatlas.so
	linux-vdso.so.1 =>  (0x00007fffcb3fc000)
	libc.so.6 => /lib64/libc.so.6 (0x0000003936e00000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003937600000)
	libm.so.6 => /lib64/libm.so.6 (0x0000003937a00000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003936a00000)

it would seem that it's threading by itself, which might have to do with the problem.

Comment 1 Frantisek Kluknavsky 2014-10-03 09:52:59 UTC
Hi,

There are libraries:
/usr/lib64/atlas/libcblas.so
/usr/lib64/atlas/libf77blas.so
They provide single threaded interface.

Then other libraries:
/usr/lib64/atlas/libptcblas.so
/usr/lib64/atlas/libptf77blas.so
provide multi-threaded interface.

/usr/lib64/atlas/libatlas.so is the backend for all of them. Yes, it is linked against pthreads and it does or does not it's own threading as requested. Or at least such is the idea, I do not know if it has bugs or not. Threading itself has known bugs and it will be probably rewritten substantially in the future.

If you use libatlas.so directly, which functions and how?

Comment 2 Susi Lehtola 2014-12-15 13:27:12 UTC
I've noticed that dsyev fails to get accurate eigenvectors when called in parallel sections, even on Fedora 21.

Comment 3 Susi Lehtola 2014-12-18 14:01:45 UTC
Actually, I've noticed the same issue with OpenBLAS. This was due to LAPACK not being built thread safe.

I've fixed the issue in LAPACK, and will do rebuilds of OpenBLAS and ATLAS which might fix this issue as well.

Comment 4 Susi Lehtola 2014-12-19 05:24:39 UTC
Well, actually, since ATLAS doesn't use the lapack package at all, this problem won't be resolved.

You should use the object files from the lapack{,64}-static package in ATLAS. Failing that, adding -frecursive to the LAPACK compile flags should fix the thread safety.

Comment 5 Susi Lehtola 2014-12-21 12:03:02 UTC
The problem with ATLAS is indeed in LAPACK, as well. Rebuilding ATLAS with a LAPACK built with -frecursive fixes the thread safety problems I've seen.

The fix is in atlas-3.8.4-14.fc20.x86_64.rpm, but F21 and rawhide need addressing as well. If you build against system LAPACK as the ATLAS used to do (and as OpenBLAS still does), this problem will be solved as well.

Comment 6 Susi Lehtola 2015-01-13 02:20:57 UTC
I fixed the issue in Fedora 20, but Fedora 21 still needs fixing.

Comment 7 Fedora Update System 2015-02-02 19:22:37 UTC
atlas-3.10.1-17.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/atlas-3.10.1-17.fc21

Comment 8 Fedora Update System 2015-02-03 12:03:11 UTC
Package atlas-3.10.1-17.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing atlas-3.10.1-17.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-1591/atlas-3.10.1-17.fc21
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2015-02-08 08:39:21 UTC
atlas-3.10.1-18.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/atlas-3.10.1-18.fc21

Comment 10 Fedora Update System 2015-02-19 02:59:36 UTC
atlas-3.10.1-18.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.