So why do we do this? Because many programs are to be executed many times,
but only linked once. The time for compile/link becomes insignificant
compared to the repeated hit of the equivalent executable statements,
or even worse, waiting for disk I/O. Fortran is used where (executable)
performance matters. If the compilation and linking are fast too, that's
a bonus but not the main point at issue.
Cheers,
Len
--
[log in to unmask]:+61 3 9669 8109: CSIRO/Bureau of Meteorology
High Performance Computing and Communications Centre
24th floor, 150 Lonsdale St | GPO Box 1289K, Melbourne, VIC 3001 Australia
On Wednesday, 7 November 2001, at 8:33,
"Lionel, Steve" <[log in to unmask]> wrote:
> Richard Maine writes:
> > The second case of initialization is where there really are a
> > bazillion different numbers to load into some array, not reducable to
> > reasonably simple forms. (Things like big data tables). These cases
> > are often best handled by putting the bazillion numbers into a data
> > file and reading them in at run-time.
>
> And I'll elaborate on this - I occasionally see complaints from users that
> the compiler is slow, or that it doesn't allow enough continuation lines.
> The programs in question often contain hundreds if not thousands of line of
> DATA statements, initializing huge arrays to "a bazillion different
> numbers". Optimizing compilers don't deal well with this - each value
> requires some amount of intermediate representation which then has to be
> processed by the optimizer, sometimes for the purpose of value propagation,
> and this can cause compilation virtual memory and CPU usage to shoot up.
> And limits on continuation lines are real - I thought that we were being
> exceedingly generous in allowing 511 continuation lines, but some people
> want more! The standard says 39 lines (for free-form source).
> Just because you CAN represent something in DATA statements doesn't mean
> that you SHOULD do it that way!
|