Can be a subroutine slower when is placed in a module?

Thomas Koenig tkoenig@netcologne.de
Sat Feb 20 05:48:00 GMT 2016


Hi Jorge,

> 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.
  --

Without having tested the code myself, there are two things that
will almost definitely make an improvement:

- Link-time optimization (use -flto for this)

- setting the "contiguous" attribute on dummy array arguments

Regards

	Thomas



More information about the Fortran mailing list