non-advancing IO internals



Dear Fortran Experts,

I observe a very strange behavior of a non-advancing
IO in a program compiled with
Absoft 64-bit Fortran 95 9.0 with Service Pack 1
on x86_64. It appears like very slow read access...

Does anybody know about similar glitches or internal working
of (Absoft) Fortran compilers?

The story is like that:

1) "strace -p" shows read() syscall slurping 8K from the disk

2) immediately after that "strace" shows an mmap() syscall
with 80M length (!!), though the file is ~20K.
( from now on no syscall activity except of debug prints on tty)

3) Fortran non-advancing IO iterates over lines and characters
collecting together non-whitespace into CHARBUF and reading
by e.g. Fortran statement read(CHARBUF,*) real_num
( it goes so for hours(!!) and then completes without error messages )

It seems the critical step is *reading a character* by
read(io,'(A)', advance='no')
because whenever I interrupt the program i see in gdb this:

(gdb) where 10
#0 0x00000000021e9c21 in _fmemcpy ()
#1 0x00000000021eb3ff in _copybuf ()
#2 0x00000000021ee4f4 in _f_rterm3 ()
#3 0x00000000021dcb0b in __A_FRF ()
#4 0x0000000000eb522f in __READ_CHAR_in_IO ()

Is there anything in the
source of __READ_CHAR_in_IO with non-advaning IO
which I could have done wrong:

subroutine read_char(io,res,stat)
implicit none
integer(IK),intent(in) :: io
character, intent(out) :: res
integer(IK),intent(out) :: stat
! *** end of interface ***

stat = IO_OK

read(io,'(A)', advance='no',EOR=1001,END=1002) res
return

1001 continue ! EOR exeption
DPRINT 'io::read_char: EOR!'
stat = IO_EOR
return

1002 continue ! EOF exeption
DPRINT 'io::read_char: EOF!'
stat = IO_EOF
return
end subroutine read_char

Unfortunately I cannot reproduce the problem in
"clean lab" conditions...

Thank you in advance,

Alexei

.



Relevant Pages

  • Re: Midband
    ... The concept is to produce a quick game (perhaps not quite as quick as ... Quick) starting from the beginning of stat gain, ... and give the character a lot more gold. ... going to have to rebalance the monster lists quite heavily as some monsters ...
    (rec.games.roguelike.angband)
  • Re: |[4E] multiclassing will be very weird...?
    ... bits about Rich Baker's character: ... That comes to a net +11 stat ... It *does* make you hard to damage, ... "Hit to damage" is the DnD paradigm, ...
    (rec.games.frp.dnd)
  • Re: What state is the NPP alpha in?
    ... The problems, as I see it, are that the stat effect tables have ... and Charisma is useless. ... Con: this also seems undesirable. ... robust character with 17 Con has barely more ...
    (rec.games.roguelike.angband)
  • Re: Six-twelves character
    ... You roll twelve. ... this is a perfectly good character; ... Go cleric and ask the DM if you can make the character older than starting age, with attendant stat penalties and benefits. ... Actually, a Draconic Half-Orc would have total stat mods +4 Str, +2 Con, -2 Wis, and make a passable barbarian. ...
    (rec.games.frp.dnd)
  • Re: allocated array
    ... the only reason to use stat= is if you want to do error ... Fortran Library: http://www.fortranlib.com ... Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html ... offering compilers on the same platforms, ...
    (comp.lang.fortran)