ATLAS not threadsafe?

Asked by Richard Furse

Looks like the current build of ATLAS + Netlib LAPACK might not be threadsafe (3.6.0-24ubuntu1).

I've been running multiple calls to cgels() in parallel on a multicore system and have finally noticed that the results returned aren't consistent. Putting a mutex around the cgels() calls fixes the problem.

The ATLAS and LAPACK docs both suggest that the libraries should be threadsafe, though ATLAS recommends some compile switches be set. Is it possible this hasn't been done? Or am I doing something stupid?

Thanks!

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu atlas Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Richard Furse (richard-muse440) said :
#1

I should add that this is 64bit Ubuntu and this is a 12 core hyperthreaded system running a process with 24 threads, spending most of its time in cgels(). I'm choosing lwork=min(m,n)+max(m,n,nrhs). None of the matrices (including the workspace) are shared between threads.

Revision history for this message
Richard Furse (richard-muse440) said :
#2

Hmm. Looking through the ATLAS and LAPACK source, I'm seeing three different implementations of cgels():

 clapack_cgels() in atlas-3.9.25/interfaces/C/src/lapack/clapack_cgels.c
 CGELS [fortran] in atlas-3.9.25/interfaces/lapack/F77/src/cgels.f
 CGELS [fortran] in lapack-3.2.2/SRC/cgels.f

The C implementation has a different function prototype to the Fortran routines and the two Fortran implementations seem to interpret the TRANS parameter differently. I'm actually calling cgels_() through a clapack.h header, so I guess I'm getting the second or third implementation, though I couldn't tell you which.

Have been using ATLAS with good, fast results for some years! I'm guessing this is just a build/packaging subtlety of some kind, or something I'm doing wrong - any clues appreciated! I'm going to see if I can fix things by using a local build of ATLAS, though I'm now a bit unclear about whether or not I need to combine it with code from LAPACK (I also use SVD heavily).

Best wishes

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.