This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Memory and disk layout of real*10 variables


On Sun, Jul 17, 2005 at 02:39:44PM +0200, Erik Schnetter wrote:
> This has several disadvantages.  It is different from I would naively 
> expect (which does not mean much), and it is different from binary C 
> I/O (which could also be ignored).  However, it is likely also rather 
> inefficient if large arrays are written to disk, because a single call 
> to write() or fwrite() now has to be split up into one call per array 
> element, so that the padding is removed.

Well, we already split up array i/o into a lot of function calls for
every array element in the io-list. This is likely to be the reason
why gfortran performance for unformatted i/o is so poor. For a little
bit of discussion on this, see
http://gcc.gnu.org/ml/fortran/2005-06/msg00084.html
 
> I have opened a PR for this because this set of behaviours is very 
> different from other compilers and detrimental to performance.

My understanding is that the reason to use padding is to get 16 byte
alignment, which is faster (for most common architectures, AFAIK). As
to why one would use 12 byte storage, I don't know.



-- 
Janne Blomqvist


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]