[Patch, libgfortran, 4.5] PR25561, 37754: New low level I/O library
Dominique Dhumieres
dominiq@lps.ens.fr
Thu Jan 8 12:37:00 GMT 2009
Hi Janne,
I have applied your patch in
http://gcc.gnu.org/ml/fortran/2009-01/msg00075.html on a clean tree of
i686-apple-darwin9. First the god news: it regtested without regression
and my NIST testsuite passed for both -m32 and -m64; I see the speed
improvement for unformatted write:
unpatched gfc -m64 -O3 IO_perf.f90
Unformatted sequential write performance test
Record size MB/s
================================
4 5.5993388198961620
8 7.4793002075283219
16 10.866773532402469
32 17.165706271034924
64 28.460467625254942
128 45.496996344593001
256 72.012566925508892
512 96.633305309305015
1024 110.66870232125038
2048 111.34043526016019
4096 105.74522966710947
8192 156.75644642594767
16384 246.79700599827905
32768 343.65024852758239
65536 457.39986636369247
131072 540.66200958727222
262144 601.36693859508853
524288 626.05532938624162
4.881u 6.710s 0:38.69 29.9% 0+0k 40+80io 31pf+0w
patched gfc -m64 -O3 IO_perf.f90
Unformatted sequential write performance test
Record size MB/s
================================
4 10.813002095241160
8 14.092293335580440
16 20.070869469471486
32 30.740473125399852
64 48.170370698139074
128 71.158336484321254
256 100.45156268770435
512 125.81038021510702
1024 138.18200039555481
2048 145.64013285668358
4096 133.40498332295562
8192 166.92994066261576
16384 240.92061911529214
32768 348.36583935169870
65536 454.29682572143855
131072 537.49385060699592
262144 576.82790874873228
524288 602.51514953193987
3.369u 4.569s 0:36.34 21.7% 0+0k 33+41io 0pf+0w
Note that, as far as I understand it, this is testing the MB/s relative to
the CPU time and not the actual bandwith of the disk subsystem (I'ld be
glad to have such a throughput on my macbook!-). The picture is less clear
for formatted IOs: although I did not see any timing regressions, the
improvement ranges from 0 to 10%, still twice slower than executables from
g77.
Now the bad news: I see two regressions on my own tests:
(1) the following test aborts:
character(len=20) :: b
! write something no advance
open(10,FILE="fort.10",POSITION="REWIND")
write(10, '(a,t1,a)',advance='no') 'XXXXXX', 'ABC'
close(10)
! append some data
open(10,FILE="fort.10",POSITION="APPEND")
write(10, '(a)') 'DEF'
close(10)
! check what is in the first record
open(10,FILE="fort.10",POSITION="REWIND")
read(10,'(a)') b
IF (b.NE."ABCXXX") CALL ABORT()
END
(2) countlines.f does not work correctly on file containing the ascii
character 255, as shown by the file
if (iachar ("ÿ")/= 255) call abort
end program main
for which the executable returns 0 instead of 2 (note that it is likely
that "ÿ" will be messed by the mailing systems).
Thanks for the work,
Dominique
More information about the Fortran
mailing list