[Insight-developers] Thread-safety issues - netlib

Karthik Krishnan Karthik.Krishnan at kitware.com
Sun Jul 10 02:30:30 EDT 2005


Hi,

This discussion has cropped up before. I was having some issues with
thread safety of LAPACK. 

The recently added class itkDiffusionTensor3DReconstructionImageFilter
is threaded, but the threading does not work (at present). Users of the
filter need to SetNumberOfThreads(1). Turns out this is because of the
static defs in dsvdc.c and other related files.

LAPACK's thread safety (therefore vnl's thread safety):
http://sourceforge.net/mailarchive/forum.php?thread_id=7325117&forum_id=2132

In a recent mail from Andrew Fitzgabbon, he suspects not all statics
must be removed.
http://www.itk.org/mailman/private/insight-developers/2005-May/006637.html

The issue has been on vxl's todo list for a while
http://cvs.sourceforge.net/viewcvs.py/vxl/vxl/TODO.txt?rev=1.12

f2c seems to have some options to generate code without static defs and
I've been able to compile and generate a few LAPACK C routines from the
provided FORTRAN files in netlib. 

Invoke f2c with the following options
f2c -a -C++ file.f

This does produce cleaner code. However some of the vxl folks seem to
have modified some of the .C files after conversion. Besides I can't
seem to find all the .f corresponding to the .c files. 

I am wondering if the solution is simply to start weeding out static
defs from netlib or to look for better faster libraries.. 

Thanks
Regards
Karthik



More information about the Insight-developers mailing list