Developers:Restart-files benchmark

From OctopusWiki
Jump to: navigation, search

Currently, the restart files in octopus may be written in three different formats:

  • The old "plain" (just binary files, in the way that the Fortran "write" instruction produced -- which is compiler dependent)*
  • NETCDF format -- in an effort to ensure portability of files across wildly different platforms.
  • The recent "binary" format that Xavier has introduced.

I have done some quick tests, checking first that they all work (they do), and then how fast it is to read and write (although octopus is usually not I/O intensive, it is worth to watch this since it may be I/O intensive at some point).

I just activated the ProfilingMode of the code and looked at the DISK_ACCESS tag. The results are the following (each number refers to one "disk access"):


(a) Intel(R) Pentium(R) 4 CPU 3.20GHz; Linux 2.6.14; Intel Fortran 9.1 (Package ID: l_fc_c_9.1.037)

GROUND STATE RUN TIME-DEPENDENT RUN
plain netcdf binary plain netcdf binary
0.233 s 0.342 s 0.116 s 0.181 s 0.342 s 0.172 s

(b) AMD Opteron(tm) Processor 248; Linux 2.6.16.25-smp-1; Intel Fortran 9.1 (Package ID: l_fce_c_9.1.036)

GROUND STATE RUN TIME-DEPENDENT RUN
plain netcdf binary plain netcdf binary
0.0058 s 0.0290 s 0.0051 s 0.0085 s 0.0494 s 0.0077 s


So it seems that writing in C is faster than writing in Fortran. This may be compiler-biased (it would be good to check with other compilers), but I would expect that the numbers would in any case be similar. Therefore I would suggest removing from the code the "plain" format.

(* Most compilers produce compatible files. gfortran 4.0 and 4.1, however, use 64-bit record markers while nearly all other compilers [incl. gfortran 4.2 and 4.3] use 32bit record markers; use -frecord-marker=4 with gfortran 4.1 to be compatible; TB)