delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/15/20:22:16

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <001601c2d559$61c807e0$9d68d6d1@oemcomputer>
From: "Charles D. Russell" <worwor AT bellsouth DOT net>
To: "cygwin cygwin" <cygwin AT cygwin DOT com>
Subject: Big fortran arrays: is this behavior expected?
Date: Sat, 15 Feb 2003 19:18:20 -0600
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019