[Patch, fortran, RFC] PR 40958 Reduce size of module files

Salvatore Filippone filippone.salvatore@gmail.com
Mon Nov 28 16:26:00 GMT 2011


On Mon, Nov 28, 2011 at 5:12 PM, Mikael Morin <mikael.morin@sfr.fr> wrote:
>
>> PS: Heck, what about a simple and stupid approach for #1: Just read
>> the mod file into a big string, and then do the parsing from there?
>> Then a rudimentary implementation of #3 would be to just store
>> pointers to all the strings we have so far read, and the mod file name
>> in order to look it up.
> Yes, but in the case of a 400+ MB module file, it would be paging vs seeking,
> so the benefits might not be as high as expected.
>
To be precise, there is no single 400 MB module file, that's the
aggregated size. The largest single file is around 30 MB.
Moreover, at least for gfortran there is something funny going on. I
have just realized that I have the following:
  -rw-rw-r--.  1 sfilippo sfilippo 31356192 Nov 25 18:40 psb_psblas_mod.mod
  -rw-rw-r--.  1 sfilippo sfilippo  5537502 Nov 25 18:41 psb_base_mod.mod

where psb_base_mod.f90 is just this:
module psb_base_mod
  use psb_string_mod
  use psb_error_mod
  use psb_penv_mod
  use psb_check_mod
  use psb_descriptor_type
  use psb_linmap_mod
  use psb_vect_mod
  use psb_mat_mod
  use psb_serial_mod
  use psb_comm_mod
  use psb_psblas_mod
  use psb_tools_mod
end module psb_base_mod

in particular, it USEs psb_psblas_mod, and yet it's smaller.
Moreover, psb_psblas_mod USEs four other modules whose only contents
are subroutine interfaces, and each of them USEs other modules but
with ONLY clauses to limit the number of imported symbols. Looks like
there's a  lot of room for improvements.
Salvatore



More information about the Fortran mailing list