This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

fortran io with g77 on redhat 7.2 for itanium ( IA64 )


Hello,

I have question, which might be already solved, if I had 
RedHat Enterprise Linux 2.1 WS or AS installed, but I did not get a
copy of those products. Redhat 7.2 still has gcc 2.96 + g77 0.5.26

I have a program which has a large array ( 3 GB ) and I want to
write this array with 1 IO statement to disk. The program fails - 
but this did not surprise me, because fortran uses 4 byte length fields, 
which limits the maximum recordsize to 2 GB, as long as you don't use 
unsigned integers, but this would just replace the limit of 2 GB to 4 GB. 

Now my questions - do you have already a solution for large records 
( > 2 or 4 GBytes ) and how does it look like, and when it will be available.

I know that some commerical fortran vendors have already a solution -
so IBM uses on AIX with XL fortran 8 byte lengthfields, which are
controlled by a run-time option ( a solution which is almost suitable,
except for one point, it changes all length fields for IO - so I think,
this switch should work by fortran IO-channel )

Many thanks in advance for your information.

Take care,

Winfrid

My small test programs ( seq. IO ) :
 
        real*8 a(1024,1024,384)
        real*8 t1,t2,t0,element
        real*8 second
        integer irc
        element=0.
        do l=1,384
          do j=1,1024
            do i=1,1024
              element=element+1.d0
              a(i,j,l)=element
            enddo
          enddo
        enddo
        write (unit=*,fmt=*) " array a set "
        write (unit=*,fmt=*) a(1,1,1)," ... ",a(1024,1024,384)
        write (unit=*,fmt="(z17.16,g16.5)") t1,t1
        t1=  second()
        write (unit=10) t1,a
        write (unit=10) t1,a
        t2=  second()
        write (unit=*,fmt="(z17.16,g16.5)") t2,t2
        write (unit=*,fmt=*) 384*8*6, " mbytes written in ",
     *  t2-t1, " seconds "
        write (unit=*,fmt=*) a(1,1,1)," ... ",a(1024,1024,384)
        rewind (unit=10)
        do l=1,384
          do j=1,1024
            do i=1,1024
              a(i,j,l)= 0.d0
            enddo
          enddo
        enddo
        t1=  second()
        read (unit=10) t0,a
        write (unit=*,fmt=*) a(1,1,1)," ... ",a(1024,1024,384)
        read (unit=10) t0,a
        t2=  second()
        write (unit=*,fmt=*) " partial read in ",
     *  t2-t1, " seconds "
        end

For direct access IO, which should already work, because there is no
length field, but it fails 
time ./dir-iog77
  open returned  0
  array a set
  1. ...   402653184.
 E890000000000000    -0.46719+196
do_ud: off end of record
apparent state: unit 10 named fort.10
lately writing direct unformatted external IO
Abort (core dumped)
39.378u 22.397s 2:13.84 46.1%   0+0k 0+0io 0pf+0w

        real*8 a(1024,1024,384)
        real*8 t1,t2,t0,element
        real*8 second
        integer*8 recl
        integer irc
        recl=1024d0*1024d0*384.d0*8.d0
        element=0.
        open (unit=10,access="direct",recl=recl,iostat=irc,
     *        form="unformatted")
        write (unit=*,fmt=*) " open returned ",irc
        do l=1,384
          do j=1,1024
            do i=1,1024
              element=element+1.d0
              a(i,j,l)=element
            enddo
          enddo
        enddo
        write (unit=*,fmt=*) " array a set "
        write (unit=*,fmt=*) a(1,1,1)," ... ",a(1024,1024,384)
        write (unit=*,fmt="(z17.16,g16.5)") t1,t1
        t1=  second()
        write (unit=10,rec=1) t1,a
        write (unit=10,rec=2) t1,a
        t2=  second()
        write (unit=*,fmt="(z17.16,g16.5)") t2,t2
        write (unit=*,fmt=*) 384*8*6, " mbytes written in ",
     *  t2-t1, " seconds "
        write (unit=*,fmt=*) a(1,1,1)," ... ",a(1024,1024,384)
!       rewind (unit=10)
        do l=1,384
          do j=1,1024
            do i=1,1024
              a(i,j,l)= 0.d0
            enddo
          enddo
        enddo
        t1=  second()
        read (unit=10,rec=1) t0,a
        write (unit=*,fmt=*) a(1,1,1)," ... ",a(1024,1024,384)
        read (unit=10,rec=2) t0,a
        t2=  second()
        write (unit=*,fmt=*) " partial read in ",
     *  t2-t1, " seconds "
        end


-- 
_______________________________________________________________________________

Fujitsu Siemens Computers
OEA VC HPC                   Email: winfrid dot tschiedel at hpc dot fujitsu-siemens dot com
Otto-Hahn-Ring 6             Tel. : ++49-89-636-45652
81739 Muenchen               Fax  : ++49-89-636-43604 

MS Exchange : winfrid dot tschiedel at fujitsu-siemens dot com


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