This is the mail archive of the cygwin mailing list for the Cygwin 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 for large arrays in cygwin/g77

Dante Chialvo wrote:
I have similar problem than the one posted a while ago in

Using cygwin/g77, in a PC with 1024 Mb of physical memory. After compiling and running the following test program the limit of 160 Mb cannot be surpassed.

implicit double precision (a-h,o-z)
c ny=200 works (160 Mb), > 200 doesnt (message error see beloww)
dimension a(nx,ny)
c dimension a1(nx,ny)
write(6,*) 'megabytes= ',nx*ny*8/1d6
write(6,*) 'extremes initialized'

error message after running
C:\cygwin\home\dchialvo\test.exe (1972): *** MapViewOfFileEx(0x71C, in_h 0x71C) failed, Win32 error 6

I follow each one of the recomendation described here:

setting the limit at 1024 Mb,etc, the registry shows that there
1024 allocated however the problem persist, no more than 160 mb can be allocated.

Just to provide another data point, I have the same problem. I have g77, g95 and grfortran (gfc) installed (see below). With heap_chunk_in_mb set to 1024, on a machine with 1024 MiB RAM< I can run a simple Fortran program with an array of up to ~ 1023 MiB. With g77 & gfc the limit is 156 MiB and beyond that it fails with something like

  gfctest.exe (844): *** MapViewOfFileEx(0x224, in_h 0x224)
  failed, Win32 error 6

Here is an example test program

      program main
      integer n
      parameter (n=40876200)
      real a(n)
      integer i
      do i=1,n
        a(i) = i
      end do
      write (unit=*, fmt=*) a(1), a(n)

And here is the -v output for each compiler:

hadfield $ g77 -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls --without-included-gettext --enable-libgcj --with-system-zlib --enable-interpreter --enable-threads=posix --enable-java-gc=boehm --enable-sjlj-exceptions --disable-version-specific-runtime-libs --disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
hadfield $ gfc -v
Reading specs from /usr/local/share/irun/bin/../lib/gcc/i686-pc-cygwin/4.0.0/specs
Configured with: ../gcc-4.0-20041114/configure --prefix=/irun --enable-languages=f95 --with-gmp=/usr/local/gmp --with-mpfr=/usr/local/gmp
Thread model: single
gcc version 4.0.0 20041114 (experimental)
hadfield $ g95 -v
Using built-in specs.
Configured with: ./configure --enable-languages=c --disable-nls
Thread model: single
gcc version 3.5.0 20040824 (experimental) (g95!) Dec 15 2004

> Any suggestions will be appreciatted

Use g95

Mark Hadfield            "Ka puwaha te tai nei, Hoea tatou"
National Institute for Water and Atmospheric Research (NIWA)

-- Unsubscribe info: Problem reports: Documentation: FAQ:

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