PR libfortran/29568 (subrecord patch)
Jerry DeLisle
jvdelisle@verizon.net
Fri Dec 1 03:38:00 GMT 2006
Thomas Koenig wrote:
> :ADDPATCH fortran:
>
> Hello world,
>
> after quite some time, here it is: The gfortran subrecord patch
> (aka implementing the Intel format for unformatted files). This was
> regression-tested on i686-pc-linux-gnu. A slightly earlier version
> (which was missing some casts) was extensively tested on 64-bit
> Linux and FreeBSD by Jerry DeLisle (thanks a lot, Jerry!)
>
> I introduced a new flag with this patch to specify a smaller
> maximum length of subrecords. This enables automatic
> regression-testing of the subrecod feature, which I think is
> important. It is very easy to break something in this
> area of the library, and not having a regression-test at all
> would be bad.
>
> With this patch, we're having a flag day: Unformatted sequential
> files written with default options in eariler versions of gfortran
> (including 4.1) will not be readable with default options.
> The minutes from the IRC planning meeting showed that this was
> preferred way over being incompatible with just about anybody
> else (and I agree, or I wouldn't have written the patch :-) We
> should update the wiki accordingly, and make an announcement on
> comp.lang.fortran.
>
> Still missing: a description of the subrecord format.
>
> I propose to apply this to 4.3, wait for some time (more than
> the customary week) for any problems to appear, and then backport
> to 4.2.
>
> OK?
I have completed my review and all testing. I confirmed that -frecord-marker=8
gives compatibility with the previous 64bit record marker scheme with previous
versions of gfortran. This should allow users to easily convert to the new
scheme or use the previous scheme.
For performance comparisons I created two small programs, one to write a large
file with huge(1_4)+ record size and one to read back in and check. The results
are shown below using the default record markers before the patch and after the
patch. The tests show only a very small change.
This patch is approved to commit to trunk.
Thanks much Thomas!
Before patch results: (The record size is what is returned by INQUIRE)
$ time ./xwrite
arraydim = 134217727
record size = -2147483640
First write done
Second write done
real 1m29.686s
user 0m1.289s
sys 0m17.537s
$ time ./xread
arraydim = 134217727
record size = -2147483640
First read done
Second read done
real 1m18.748s
user 0m2.827s
sys 0m5.362s
After patch results:
$ time ./subxwrite
arraydim = 134217727
record size = -2147483640
First write done
Second write done
real 1m33.688s
user 0m1.293s
sys 0m17.452s
$ time ./subxread
arraydim = 134217727
record size = -2147483640
First read done
Second read done
real 1m19.565s
user 0m2.793s
sys 0m5.386s
More information about the Fortran
mailing list