This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[fortran,patch] Don't write common more than once in a module file (PR 30285)
- From: FX Coudert <fxcoudert at gmail dot com>
- To: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>
- Cc: gcc-patches list <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 10 Nov 2007 01:09:35 +0000
- Subject: [fortran,patch] Don't write common more than once in a module file (PR 30285)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:to:message-id:content-type:cc:subject:from:date:x-mailer; bh=XhAgLMXwip0g2JkZ62Ep1lqhoQulIjN8MPFK6dlXecw=; b=qYkYlty9PZW7qJJZY2HHbcdoIXafuMalaQ3v/F5uKrQ1SnUU6YA0ReInifc8DGfXnhjsR6P08YaFR8XJjZZ57VrnFOlnR1FUz8Jz/vYVYOFLCg0YGW9CYbf0X0VdWANG+oWWNk7eOz4TWu81VIH8cC/B9r7IyLvZqO/QtgYJTjg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:to:message-id:content-type:cc:subject:from:date:x-mailer; b=d8MR0yaWm51Ru7bc9YAEhJgSAK6mEgU60YzLDBJIA0c9O5PmCYvUWG1kGi/vujzP1gzX8qqiupQHEf7MkOu/7Etje6lVQW1s4BZe5I4RLfzUI3hfekv+4BUwgT86ZaR7Mh1UQ/5awe1rDWNPptLHWB97GNSSQe8SJBqeehrO5lI=
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:
Attachment:
pr30285.ChangeLog
Description: Binary data
Attachment:
pr30285.diff
Description: Binary data