Big fortran arrays: is this behavior expected?

Charles D. Russell worwor@bellsouth.net
Sun Feb 16 02:06:00 GMT 2003


There is still a problem with big fortran arrays even after resetting
heap_chunk_in_mb 1024. The subsequent test program exits with no output and
no error message. When run in gdb, a segmentation fault is reported.
Following a suggestion from comp.lang.fortran, I increased the stack size
using compiler flag -Wl,--stack,0x400000. With this change I can now access
a bit over 770 Mb, above which the program fails with an erroneous message
saying that I have multiple copies of cygwin1.dll. However, this smells like
a bug, for the following reasons:

1) Crashing with no message. I've used cygwin for more than a year on
smaller systems and have not encountered any flaky behavior.

2) After increasing stack size, the test program fails at a different point,
this time with a message, but an incorrect one (it thinks I have multiple
cygwin1.dll's).

3) Should one need a big stack just to declare one matrix and assign
values to a couple of elements?

Converting the program to C by means of f2c also leads to failure, and
increasing the stack size is not a successful fix in that case. I don't know
enough C to interpret this, beyond noting that f2c creates one large static
one-dimensional array, and fiddling with some simple test routines suggests
to me that cygwin/gcc doesn't like such large static arrays.

Although I can now successfully port all my fortran code from unix to
cygwin, the stacksize fixup seems flaky and I fear it might collapse with
the next change in either cygwin or Windows.

Apropos of recent remarks about how the simple setup routine has degraded
the user base, I confess to being one of the degraded users. For years I ran
fortran from my desktop using telnet in a DOS box, connecting to a unix
workstation. Cygwin provides a virtually identical environment. Cygwin
eliminated the workstation and Cygwin setup eliminates the system
administrator that kept the workstation running. It is heavenly to gain a
solid fortran platform without having to learn anything about either unix
administration or Windows. Thanks to all the Cygwin folks, even the mean
ones.

      implicit double precision (a-h,o-z)
c ny=300 works (240 Mb), 400 doesnt
      parameter(nx=100000,ny=400)
      dimension a(nx,ny)
c dimension a1(nx,ny)
      write(6,*) 'megabytes= ',nx*ny*8/1d6
      a(1,1)=1d0
      a(nx,ny)=1d0
      write(6,*) 'extremes initialized'
      end


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list