This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [fortran,patch] Don't write common more than once in a module file (PR 30285)
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, gcc-patches list <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 11 Nov 2007 20:47:32 -0800
- Subject: Re: [fortran,patch] Don't write common more than once in a module file (PR 30285)
- References: <26954C8E-C987-4CD4-9887-310B6D00F004@gmail.com>
FX Coudert wrote:
PR 30285 is about deeply nested module files containing commons, which
take a huge amount of memory when they're read back (and loads of disk
space, but that's not so much of a problem). This commonly happens with
MPICH and openmpi, and leads some people to run out of memory when
compiling mpi-enabled programs.
The problem is that we write each common name more than once (a number
of times that grows exponentially with the nesting). I tried to change
the way we load modules, to avoid creating these duplicate symbols, but
the diagnostics code for commons with binding labels requires this
creation of multiple symbols, so I went for something that is a bit of a
hack: we get rid of duplicate common names (specificaly: duplicate pairs
of name and binding label) when writing the module files, by creating a
list of them as we go through and checking them against that list.
I agree it's not a perfect solution, but I couldn't make it work in any
other way (see the PR for a tentative patch), and I think it's worth
committing now, as it's a serious problem for our users. Regtested on
x86_64-linux, OK to commit?
FX
:ADDPATCH fortran:
Reviwed and with Heralds positive report. OK to commit.
Jerry