Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: "G. Hugh SONG" <ghsong@\"Spamspoiler\"kjist.ac.kr>
Subject: Re: Forcing 32-bit integers and math
Date: 1998/10/14	[thread overview]
Message-ID: <701flh$njg$1@news.kjist.ac.kr> (raw)
In-Reply-To: 6vt65k$5hp$1@walter-fddi.cray.com

Jeff Drummond wrote:

> In article <YQsT1.507$525.1552696@ptah.visi.com>, epowell@visi.com (Edward J. Powell) writes:
> |>
> |> Okay, I'm attempting to learn Fortran on a Cray (gloat gloat), and I've
> |> run into a bit of a problem with what I'm working on.
> |>
> |> I need 32-bit integers.  Cray really wants to do 64-bit stuff.
>
> Yes, we really do.  You can get 32-bit integers on CRAY MPP (T3E) systems,
> but not on the CRAY PVP (C90/T90) systems.
>
> |> I define variables as integer*4.  This should make them 32-bit.
>
> No.  We generally regard integer*n as a request rather than a commandment.
> On CRAY PVP systems it may allow us to use a reduced precision model, but
> the container size will still be 64-bits.
>

It seems that the exact same thing happens with Alpha/Linux g77 fortran.
I was trying to enforce compatibility between Intel/Linux and Alpha/Linux
g77.

Here is what I did:
I created a simple fortran program:
      program OUTtest

      implicit none
      integer   UOUt, i, id(5)
      parameter(Uout = 11)
      integer*2 i2(5)
      integer*4 i4(5)
      real      rd(5)
      real*8    r8(5)

      do i = 1, 5
         i2(i) = i
         id(i) = i
         i4(i) = i
         r8(i) = i
         rd(i) =i
      end do

      open(Uout, file = 'i2.dt', form='unformatted')
      write(Uout) i2
      close(Uout)
      open(Uout, file = 'i4.dt', form='unformatted')
      write(Uout) i4
      close(Uout)
      open(Uout, file = 'id.dt', form='unformatted')
      write(Uout) id
      close(Uout)
       open(Uout, file = 'rd.dt', form='unformatted')
      write(Uout) rd
      close(Uout)
      open(Uout, file = 'r8.dt', form='unformatted')
      write(Uout) r8
      close(Uout)

      stop
      end

Then, I created two executables, test.ix for intel and test.ax for alpha.
The file sizes of the output files after running test.ix are
-rw-------   1 ghsong   faculty        28 Oct 14 11:47 i4.dt
-rw-------   1 ghsong   faculty        28 Oct 14 11:47 id.dt
-rw-------   1 ghsong   faculty        48 Oct 14 11:47 r8.dt
-rw-------   1 ghsong   faculty        28 Oct 14 12:21 rd.dt
-rw-------   1 ghsong   faculty        18 Oct 14 11:47 i2.dt

After running test.ax, they are
-rw-------   1 ghsong   faculty        36 Oct 14 11:35 i4.dt
-rw-------   1 ghsong   faculty        36 Oct 14 11:35 id.dt
-rw-------   1 ghsong   faculty        56 Oct 14 11:35 r8.dt
-rw-------   1 ghsong   faculty        36 Oct 14 12:18 rd.dt
-rw-------   1 ghsong   faculty        26 Oct 14 11:35 i2.dt

This result implies that the two output "record" files are
significantly different.
Even if they both use IEEE-format, there is extra bits of
information appended on the fortran output files must also
be different.

Reading the files from test.ax into IDL running on Intel/Linux
fails with the message such as "Corrupted input data".

It seems that the only solution to this incompatibility problem
is to let C-code handle all the  binary outputs or to use
ascii outputs only, which is unacceptable with huge data files.

Regards,

>
> Hope this helps,
>
> -Jeff    jjd@cray.com

--
G. Hugh Song

PS: Please remove "Spamspoiler" when replying






       reply	other threads:[~1998-10-14  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   ` G. Hugh SONG [this message]
1998-10-14  4:00     ` Forcing 32-bit integers and math Greg Lindahl
1998-10-15  4:00       ` H.W. Stockman
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
1998-10-16  4:00               ` Jeff Drummond
1998-10-16  4:00                 ` James Giles
1998-10-15  4:00         ` Jeff Drummond
1998-10-15  4:00       ` Jeff Drummond
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