Array Descriptor Update

Janne Blomqvist blomqvist.janne@gmail.com
Fri Sep 26 14:17:00 GMT 2008


Daniel Kraft wrote:
> What I heard from the talk about 4.3 ABI breakage, I got the idea that 
> in the past each major version of gfortran broke it anyways (maybe 
> except the upcoming 4.4 now?).

Yes, only with 4.3 libgfortran has symbol versioning, allowing it to 
support multiple ABI version at the same time. Though making it actually 
do so takes effort.

While ABI compatibility probably doesn't affect individual users much as 
they recompile their software all the time anyway, it matters for 
distributions. Breaking the libgfortran ABI would require recompilation 
of all Fortran libraries and applications that depend on these. E.g. 
lapack, blas, python-numpy, octave and countless others. And also 
non-open source libraries like ACML etc.

>  So for a descriptor rework in favor of 
> new features like allocatable scalars or CLASS, I would see it 
> reasonable to simply go along and do the best of design we can come up 
> with, not introducing any kludges to try preserving the ABI.  But that's 
> of course only my personal opinion, as someone who didn't really use any 
> Fortran for large projects yet and does not have any compiled code lying 
> around...

Well yes, certainly I think ABI compatibility is important, but not 
important enough to stand in the way of progress in a significant way.

Regarding array descriptors, would it be possible to make the library 
support both old and new descriptors by converting them back and forth? 
As the new descriptors should contain a superset of the existing 
functionality, it should be possible without losing information, albeit 
with a (slight?) performance impact.

E.g. if we have the symbols foo@GFORTRAN_1.1 (old descriptor) and 
foo@GFORTRAN_1.2 (new descriptor), wouldn't it be possible to implement 
foo@GFORTRAN_1.1 as something like

void
foo_r4_old(gfc_array_r4 * bar, ...)
{
   gfc_new_array_r4 * new; // Or whatever the new descriptor is called.
   convert_old_to_new_descriptor(new, bar);
   foo_r4_new(new, ...);
   convert_new_to_old_descriptor(bar, new);
}

That would isolate the old style descriptor to a thin interface layer, 
without requiring to duplicate every function that uses array descriptors.

-- 
Janne Blomqvist



More information about the Fortran mailing list