"Jürgen v.Hagen" <[log in to unmask]> wrote:
> I made comparisons (very restricted and preliminary ones) with
> the HP compilers (f90 1.2 and C pretty recent) for computations
> of finite difference schemes. The f90 code was not only easier
> to write in 1D 2D and 3D, but also always at least as fast as
> the C code. The C code was only as fast as the f90 code when
>
Well.
For reasons the attached program demonstrates, I am not so happy with
the HP f90. The problem is that passing a pointer array to a subroutine
with explicit shape for the arguments always triggers a copy. As a consequence,
a derived type with large arrays (where allocatable is not allowed) and
using old code in f77 from a library are almost mutually exclusive.
Note that the copy is not necessary, as the pointer array is "compact", which
other compilers are able to exploit.
[log in to unmask] wrote:
> There are many more ways to write slow code in C++ than in C, and the same may
> be said between C and Fortran, but there are enough ways to write slow code
> even in f77.
Agreed. But in F90, there are also more ways to write slow code compared to f77.
Klaus
|