private components in module files
Andrew Benson
abenson@carnegiescience.edu
Thu Oct 24 15:01:00 GMT 2019
On Thursday, October 24, 2019 11:26:27 AM PDT Janne Blomqvist wrote:
> On Wed, Oct 23, 2019 at 7:07 PM Andrew Benson
>
> <abenson@carnegiescience.edu> wrote:
> > Hi all,
> >
> > I've been slowly trying to educate myself about the structure of gfortran
> > module files, in the hope that I can eventually work on making some
> > improvements (I'm particularly interested in anything that would reduce
> > the
> > file size or speed up parsing).
>
> AFAICS the big improvements, thought absolutely not low-hanging fruit
> (which is why it hasn't been done), is
>
> 1) Not including transitive dependencies in .mod files. Implying that
> .mod files would need to have the equivalent of USE statements, so
> that the module parser knows it might need to parse other modules to
> resolve all symbols.
>
> 2) Caching parsed module files. This is likely necessary to get (1) to
> work decently.
>
> AFAIK the NAG Fortran compiler does something like this.
>
> See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40958#c13
>
> Also see previous discussion in
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25708
Thanks for the links to the previous discussion on this. For my own usage of
gfortan it's 2) that would probably be the most useful improvement - the size
of the .mod files in itself isn't a problem, but the long compile times which
arise from (re-)reading them is. My guess is that implementing caching for
parsed module files is well beyond my current abilities and understanding of
gfortran, but I'll dig around the code anyway - maybe I'll at least get a
better understanding of how the module parsing works.
-Andrew
--
* Andrew Benson: http://users.obs.carnegiescience.edu/abenson/contact.html
* Galacticus: https://github.com/galacticusorg/galacticus
More information about the Fortran
mailing list