Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: lindahl@pbm.com (Greg Lindahl)
Subject: Re: Forcing 32-bit integers and math
Date: 1998/10/15	[thread overview]
Message-ID: <705o8j$g5f@news1.newsguy.com> (raw)
In-Reply-To: 705c5g$pl@bgtnsc01.worldnet.att.net

"James Giles" <jamesgiles@worldnet.att.net> writes:

> All Fortran I/O libraries I've seen (and I've even written one) have
> a record mark which contains both the length of the next record
> and the length of the preceeding record.

Conceptual difference: I call that 2 record marks. At the start of the
file there is only 1 record mark.

>  On Crays, this was represented
> as a 64-bit quantity: the first 32 were the length of the preceeding
> record and the second 32 were the length of the following record.

I just looked on a Cray and it seems to have changed formats between
f77 and f90. The new format is considerably different.

-- g

unicos% od o
0000000000000 000000 000000 000000 000001 000000 000000 000000 000020
              [       r1 length ?       ] [ record 1 data ]
0000000000020 100000 000000 000000 000001 000000 000000 000000 000021
              [ combo of r1 and r2 len? ] [ record 2 data ]
0000000000040 100000 000000 000000 000000 160000 000000 000000 000000
              [ r2 length?              ]
0000000000060 170000 000000 000000 000000 000000 000000 000000 000000
0000000000100 000000 000000 000000 000000 000000 000000 000000 000000
*
0000000010000

A bit satantic for my taste, with the reverse lengths reversed?

unicos% cat test.f
      program test
      open (unit=21, file = 'o', form='unformatted', status='unknown')
      write (21) 16
      write (21) 17
      close (unit=21)
      stop
      end

32-bit linux% od o
0000000 000004 000000 000020 000000 000004 000000 000004 000000
        ^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^
        little-endian     data      repeat of      length of 
        length in bytes             r1 length       record 2
0000020 000021 000000 000004 000000
        ^^^^^^^^^^^^^ ^^^^^^^^^^^^^
        record 2 data   repeat of r2 length

64-bit linux% od o
0000000 000004 000000 000000 000000 000020 000000 000004 000000
0000020 000000 000000 000004 000000 000000 000000 000021 000000
0000040 000004 000000 000000 000000
0000050

Note the 32-bit lengths are now 64-bit lengths.



  parent reply	other threads:[~1998-10-15  4:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <YQsT1.507$525.1552696@ptah.visi.com>
     [not found] ` <6vt65k$5hp$1@walter-fddi.cray.com>
1998-10-14  4:00   ` Forcing 32-bit integers and math G. Hugh SONG
1998-10-14  4:00     ` Greg Lindahl
1998-10-15  4:00       ` Jeff Drummond
1998-10-15  4:00       ` H.W. Stockman
1998-10-15  4:00         ` Jeff Drummond
1998-10-15  4:00         ` Greg Lindahl
1998-10-15  4:00           ` James Giles
1998-10-15  4:00             ` Richard Maine
1998-10-18  4:00               ` James Giles
1998-10-15  4:00             ` Greg Lindahl [this message]
1998-10-16  4:00               ` Jeff Drummond
1998-10-16  4:00                 ` James Giles
1998-10-15  4:00     ` Toon Moene
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox