Richard Maine wrote:
> "topvis" <top...@163.com> writes:
> > Could anyone told me the differnce between:
> > REAL:: A(:) and REAL:: A(*)
> [..]
> There are many other secondary differences, for example in
> performance implications, but the above are basics to start with.
I just happened to collect some *preliminary* performance numbers
last week. The intent was to examine the relative performance
of using arrays accessed by various methods, i.e., through argument
lists with assumed size, assumed shape, and derived types; and accessed
via module data. The numbers are elapsed time normalized by that
required by the assumed size arrays.
For the IO tests I am merely reading data from disk and for the work
tests I am doing operations typical of our main code base. These
results are for arrays of 200,000 elements, but the trends are similar
for larger arrays. Both real and integer arrays are used. Default
compiler settings were used, i.e., no flags, and the data represents
the average of ten separate runs.
Lahey/Fujitsu lf95 compiler on i686/Linux:
IO tests:
Assumed-size: 1.00000000
Assumed-shape: 1.16666639
Use Module: 8.08333492
Derived type: 8.49999809
Work tests:
Assumed-size: 1.00000000
Assumed-shape: 1.04831302
Use Module: 1.06288338
Derived type: 1.05291426
Absoft f95 compiler on i686/Linux:
IO tests:
Assumed-size: 1.00000
Assumed-shape: 1.02256
Use Module: 1.03008
Derived type: 1.00000
Work tests:
Assumed-size: 1.00000
Assumed-shape: 1.12665
Use Module: 1.14474
Derived type: 1.18421
Intel ifc compiler on i686/Linux:
IO tests:
Assumed-size: 1.000000
Assumed-shape: 0.9444444
Use Module: 1.055556
Derived type: 1.111111
Work tests:
Assumed-size: 1.000000
Assumed-shape: 1.131188
Use Module: 1.138614
Derived type: 1.121287
NAG f95 compiler i686/Linux:
IO tests:
Assumed-size: 1.0000000
Assumed-shape: 1.0326086
Use Module: 1.0217385
Derived type: 1.2282608
Work tests:
-Abort-
NA Software f95 compiler i686/Linux:
IO tests:
Assumed-size: 1.000000
Assumed-shape: 0.9947917
Use Module: 1.015625
Derived type: 1.031250
Work tests:
Assumed-size: 1.000000
Assumed-shape: 0.8864198
Use Module: 0.8930864
Derived type: 1.074815
Portland pgf90 compiler on i686/Linux:
IO tests:
Assumed-size: -nan
Assumed-shape: -nan
Use Module: -nan
Derived type: -nan
Work tests:
Assumed-size: 1.000000
Assumed-shape: 1.055556
Use Module: 1.166667
Derived type: 1.277778
SGI f90 compiler iris4d/Linux:
IO tests:
Assumed-size: 1.
Assumed-shape: 33.0572739
Use Module: 36.2234993
Derived type: 33.699028
Work tests:
Assumed-size: 1.
Assumed-shape: 1.22804034
Use Module: 1.33691001
Derived type: 1.27308822
Compaq fort compiler on alpha/Linux:
IO tests:
Assumed-size: 1.000000
Assumed-shape: 1.010757
Use Module: 1.000001
Derived type: 6.494653
Work tests:
-Abort-
Sun f95 compiler on sun4u/SunOS
IO tests:
Assumed-size: 1.0
Assumed-shape: 1.044771
Use Module: 1.0526927
Derived type: 1.0494714
Work tests:
Assumed-size: 1.0
Assumed-shape: 1.0914603
Use Module: 1.0350938
Derived type: 1.1422796
As you can see, I'm having some troubles with Portland's
implementation of cpu_time as well as my "work" tests for
the NAG and Compaq compilers. And, until a recent update
to our SGI compiler, it was giving numbers in the hundreds
for anything but assumed-size!
If there is interest I can post the code I'm using. I would
appreciate any suggestions/criticisms.
--
Bil Kleb
NASA Langley Research Center
Hampton, Virginia, USA