[Q-e-developers] Speed up of dos.x

Paolo Giannozzi giannozz at democritos.it
Wed Jul 11 16:17:42 CEST 2012


Hi Gabriele

this is an old problem whose root lies in the cancerous growth of  
routine
"read_file" from a realtively simple routine reading a file into a  
big mess.
If you look into the TODO file in the svn distribution, you will find  
this:

   4.4.2 Avoid monster routines that do too many things at the same time
         depending on the value of too many variables. An example:  
read_file

Anyway: I think it is time to release a 5.0.1 version fixing a few bugs
(especially a very serious one affecting stress calculation) and with  
a few
additions, so I would postpone any change that may introduce new bugs
two more weeks. Then, the simplest path is to split read_file into more
subroutines, e.g.: read_data_file, read_wfc_files, extract all  
initialization
that is not needed to read the files, make smaller and more focused
subroutines that can be separately called (and in the process, solve
your problem and another one: the existence of a separate read_file
for xspectra)

P.

> The post-processing code PP/src/dos.f90 is rather simple and usually
> very fast and it can be run in serial mode (indeed it is not  
> parallelized).
> However, when it is executed on a very large system one can run into
> memory problems (and significant slow-down as well) because the
> charge and the wave functions are read even if they are not actually
> used (inside the call to PW/src/read_file.f90).
> I see two very simple solutions to this problem, but I'm not sure that
> they don't know have any drawback, and I can't judge which is  
> preferable
> from the code maintenance point of view.
> 1. modify read_file.f90 by adding an input variable that specifies  
> if we need
> or not wave functions, charge, etc. This would require changes in  
> all codes
> calling that subroutine.
> 2. just modify dos.f90 by replacing the call to read_file with  
> those sections
> of read_file that are strictly needed. This might pose some issues  
> of code maintenance.


---
Paolo Giannozzi, Dept of Chemistry&Physics&Environment,
Univ. Udine, via delle Scienze 208, 33100 Udine, Italy
Phone +39-0432-558216, fax +39-0432-558222







More information about the developers mailing list