home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / fortran / 5110 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.5 KB  |  45 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!haven.umd.edu!decuac!pa.dec.com!engage.pko.dec.com!e2big.mko.dec.com!dbased.nuo.dec.com!quark.enet.dec.com!lionel
  3. From: lionel@quark.enet.dec.com (Steve Lionel)
  4. Subject: Re: Fast I/O
  5. Message-ID: <1993Jan21.141503.22670@dbased.nuo.dec.com>
  6. Lines: 32
  7. Sender: news@dbased.nuo.dec.com (USENET News System)
  8. Reply-To: lionel@quark.enet.dec.com (Steve Lionel)
  9. Organization: Digital Equipment Corporation, Nashua NH
  10. References: <1jhqkhINNno3@bigboote.WPI.EDU> <1993Jan21.081105.4047@molene.ifremer.fr>
  11. Date: Thu, 21 Jan 1993 14:15:03 GMT
  12.  
  13.  
  14. In article <1993Jan21.081105.4047@molene.ifremer.fr>, 
  15. molagnon@ditigo.ifremer.fr (Michel Olagnon) writes:
  16. |>
  17. |>Many Fortran compilers are not efficient on I/O with implied DO loops.
  18. |>Replacing 
  19. |>      write (lu) (a (j), j=1,n)
  20. |>with
  21. |>      call fstwrt (lu, a, n)
  22. |>         .
  23. |>         .
  24. |>      subroutine fstwrt (lu, a, n)
  25. |>      double precision a (n)
  26. |>      write (lu) a
  27. |>      return
  28. |>usually gives dramatic improvement.
  29. |>
  30. |>I have a follow-up question : why don't compilers execute this optimization ?
  31. |>
  32.  
  33. Digital's VAX FORTRAN does.  It also optimizes some more complex implied
  34. DO-loops, including those with non-unity strides and with expressions in
  35. the array subscript, as long as it can tell that the stride is constant.
  36. If the stride is 1, the I/O operation occurs directly from the array memory
  37. rather than being copied to a buffer.
  38. --
  39.  
  40. Steve Lionel                    lionel@quark.enet.dec.com
  41. SDT Languages Group
  42. Digital Equipment Corporation
  43. 110 Spit Brook Road
  44. Nashua, NH 03062
  45.