Can be a subroutine slower when is placed in a module?
Jorge D'Elia
jdelia@intec.unl.edu.ar
Fri Feb 19 21:21:00 GMT 2016
Hi folks,
I'm using the experimental version GNU Fortran (GCC) 6.0.0 20151107
(soon I will build the last experimental version!), on a
x86_64 machine (i7-3930K, 3.20GHz) with:
Linux version 4.2.3-200.fc22.x86_64
(mockbuild@bkernel01.phx2.fedoraproject.org)
(gcc version 5.1.1 20150618 (Red Hat 5.1.1-4)
(LE)) # 1 SMP Thu 8 October 03: 2015 23:55 UTC.
Question: is expected that the computational time increases fairly
when the task routines are placed in a module? e.g. in simple LU
tests using one core (please, see attached tgz file):
$ test1.exe # simple LU test without a "module" o "includes"
size; nn = 1000
elapsed time; tdelta = 0.16185099999999999
Mflops (dp) ; Mflops = 4131.3718584788885
$ test2.exe # simple LU test using "includes"
size; nn = 1000
elapsed time; tdelta = 0.16450000000000001
Mflops (dp) ; Mflops = 4064.8429584599794
$ test3.exe # simple LU test using a "module"
size; nn = 1000
elapsed time; tdelta = 0.27818599999999999
Mflops (dp) ; Mflops = 2403.6675701389236
from these values, e.g.
octave:1> ratio_31 = 0.27818599999999999/0.16185099999999999
ratio_31 = 1.7188
octave:2> ratio_21 = 0.16450000000000001/ 0.16185099999999999
ratio_21 = 1.0164
Thus, the CPU time using the single test1 is comparable
with the obtained with test2 that uses "includes".
However, the CPU time increased by 170%, more or less, in
the test3 where a module is used. Question: it is expected
behavior, or there's something that I missing? e.g. in the
GFortran compilation flags, or in the coding style used? etc.
Thanks in advance.
Jorge.
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lu-test.tgz
Type: application/x-compressed-tar
Size: 2547 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160219/b05dd58d/attachment.bin>
More information about the Fortran
mailing list