[Insight-developers] Thread-safety issues - netlib

Miller, James V (Research) millerjv at crd.ge.com
Mon Jul 11 11:02:42 EDT 2005


Turns out we can't just define static in f2c.h to test this out.

The f2c generated files have a section called

/* Table of constant values */
static integer c__1 = 1;
static integer c_n1 = -1;
static integer c__2 = 2;
static ftnlen cc__2 = 2;
static integer c__65 = 65;

where constants are defined.  

We probably only want to redefine (remove statics) from the local variables.

Jim

-----Original Message-----
From: Miller, James V (Research) 
Sent: Monday, July 11, 2005 9:43 AM
To: 'Karthik.Krishnan at kitware.com'; Insight Developers List
Subject: RE: [Insight-developers] Thread-safety issues - netlib


Karthik, 

When you use f2c to generate a file without statics, are the differences
between that file and the one in vxl just the "statics"?  Or is the code
different in another manner?

We should be able to dig up the original fortran.  But if the only difference
between the f2c generated code with and without statics is to not use the
keyword static on those lines, when we should just be able to edit them out.

I am not sure how much editting the vxl folks did on the f2c generated code.
I am aware of one change where they change the mapping of a "long".

Is it possible to run a quick experiment where we edit f2c.h and insert a

#define static

Jim


-----Original Message-----
From: insight-developers-bounces+millerjv=crd.ge.com at itk.org
[mailto:insight-developers-bounces+millerjv=crd.ge.com at itk.org]On Behalf
Of Karthik Krishnan
Sent: Sunday, July 10, 2005 2:31 AM
To: Insight Developers List
Subject: [Insight-developers] Thread-safety issues - netlib


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

_______________________________________________
Insight-developers mailing list
Insight-developers at itk.org
http://www.itk.org/mailman/listinfo/insight-developers


More information about the Insight-developers mailing list