Possible Code Performance Disparity using "parameter"
John L. Males
jlmales@gmail.com
Mon Mar 12 22:03:00 GMT 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I am using GFortran 4.4.5. I have discovered by accident an
issue in the performance of the generated code where at least
one variable changed from having a "parameter" attribute to not
causes at least more than 100% increase execution time for a
statical program.
The only reason the variable had the "parameter" attribute
removed was to enable the variable to have a different same
during different execution was to enable different values for
the statical analysis. This would avoid different versions of
code for the obvious different execution values normal in a
statical analysis.
integer (kind=1), parameter :: foo1
874.9 real 871.4 user 0.3 sys
vs
integer (kind=1) :: foo1
1838.4 real 1836.8 user 0.2 sys
whose value is for execution is
determined via get_command_argument.
Otherwise the variable is only read in the core part of both
variants of the code that uncovered this issue. The code often
involves at least 400000000000 iterations in a small loop for a
statical calculation.
The command line to compile was "gfortran -Wall -O2"
Any thoughts or comments with regards to this discovery?
Regards,
John L. Males
Toronto, Ontario
Canada
12 March 2012 18:03
<mailto:jlmales@gmail.com>
==============================================================
2012-03-12 17:40:18.982824669-0400-EDT
12 Mar 17:40:18 ntpdate[19975]: ntpdate 4.2.6p2@1.2194-o Sun
Oct 17 13:35:14 UTC 2010 (1)
12 Mar 17:40:37 ntpdate[19980]: step time server 129.128.5.211
offset 0.004778 sec
Linux 2.6.32-5-amd64 #1 SMP Mon Jan 16 16:22:28 UTC 2012
Modified Debian GNU/Linux 6.0.3 (squeeze)
Planning, Upgrade, Modifications from Highly modified
Debian 4.x Etch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAk9ecp8ACgkQ+V/XUtB6aBBojgCgw8RFZ2XZEd1PZyff3OWxpYmh
+JgAnirC+eVGKzszRMWxVvk906UN8ISB
=t3EX
-----END PGP SIGNATURE-----
More information about the Fortran
mailing list