public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC]" <matthew.thompson@nasa.gov>
To: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>
Subject: Help with long compile time of all-USE module
Date: Wed, 12 May 2021 13:52:59 +0000	[thread overview]
Message-ID: <E95DEBE5-6F51-45E9-9A3B-448AAD9FA7B9@nasa.gov> (raw)

All,

I'm hoping to rely on the wisdom of the gfortran gurus for some help on this.

I've been looking at trying to speed up the compilation of a library I help maintain because, well, always a worthy goal, especially with CI and Git. I did some profiling and found that the most expensive file to compile in our library (doing a debug build with GCC 10.3) is a "meta-module" that only has 'use foo' statements:

https://github.com/GEOS-ESM/MAPL/blob/main/base/MAPL_Mod.F90

It allows us to "gather" many use-statements so users don't need to "use" 50 different modules.

This really surprised me as there are other files in this library that are infinitely more complex and I can think of ways we could maybe refactor or break them up, but this file is...boring. I guess I could split it up, but almost doesn't seem worth the effort.

Now, it is the slowest compile when building with Debugging flags which are, for this model:

  FLAGS = -O0 -g -fcheck=all,no-array-temps -finit-real=snan -ffree-line-length-none -fno-range-check -Wno-missing-include-dirs -fbacktrace -ffpe-trap=zero,overflow -fbacktrace -fallow-argument-mismatch -fallow-invalid-boz -falign-commons -Jinclude/MAPL.base -fPIC -ffixed-line-length-132 -pthread -fopenmp

My naïve thought when I first saw this was the tall pole was "well, I'll degrade the optimization" but, well, already at -O0. So perhaps one of these other flags is triggering some sort of weirdness with an "only USE" file?

I might try a binary exclusion experiment to figure it out (remove half the flags, etc.), but maybe it's obvious to the experts.

Thanks,
Matt

--
Matt Thompson, SSAI, Ld Scientific Programmer/Analyst
NASA GSFC,    Global Modeling and Assimilation Office
Code 610.1,  8800 Greenbelt Rd,  Greenbelt,  MD 20771
Phone: 301-614-6712                 Fax: 301-614-6246
http://science.gsfc.nasa.gov/sed/bio/matthew.thompson

             reply	other threads:[~2021-05-12 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 13:52 Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC] [this message]
2021-05-12 14:39 ` Aw: " Martin Stein
     [not found] ` <trinity-b117cb0e-d53c-4676-8859-eba7e02836d5-1621246508030@3c-app-gmx-bs72>
2021-05-17 16:19   ` [EXTERNAL] " Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E95DEBE5-6F51-45E9-9A3B-448AAD9FA7B9@nasa.gov \
    --to=matthew.thompson@nasa.gov \
    --cc=fortran@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).