Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: Mark Hadfield Subject: Re: Memory for large arrays in cygwin/g77 Date: Mon, 10 Jan 2005 10:27:28 +1300 Lines: 92 Message-ID: <41E1A1C0.10101@niwa.co.nz> References: <41E173A8 DOT 46D95FCF AT northwestern DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: clam.niwa.cri.nz User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) In-Reply-To: <41E173A8.46D95FCF@northwestern.edu> X-IsSubscribed: yes Dante R. Chialvo wrote: > Thanks for the suggestions > Bottom line both ideas work fine in my case: > > 1) Install the g95 compiler, > or > 2) Use g77 using the Wl option, ie, > > g77 -O2 -o mybigprogram -Wl,--stack,100000000 mybigprogram.f > > So thanks a lot, That's odd. Increasing the stack size definitely does not work for me. It just causes the program to terminate silently, with no output. My test script is below. with comments describing the results on my system. Would anyone care to try it out and compare? I have an up-to-date Cygwin system on Windows 2000. Very ordinary and uncustomised except for heap_chunk_in_mb set to 1024. G77 version is... 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) Test script: --------------------------------- #! /bin/bash # Investigate g77/Cygwin memory limits set -e srcfile=/tmp/g77test.f exefile=/tmp/g77test.exe # With g77 -mno-cygwin, the program works for n of at least # 250000000. With this value the program requires 954 MiB and # takes 10-20 s to execute, so I haven't pushed it any further. # With default g77 command, producing a Cygwin executable, the # maximum value of n supported is 40876200 (corresponding to an # array size of 156 MiB). Beyond that it produces the error: # D:\Temp\g77test.exe (1788): *** MapViewOfFileEx(0x224, in_h 0x224) # failed, Win32 error 6 # I can increase the stack size with -Wl,--stack=s. However if I # set s much above (what I believe to be) the default of 2 MiB # (s=2097162) then no output is produced. The maximum value of # s for which output is produced with n=40876200 is 2162688, and # there seems to be no value of s which allows n to be increased # above 40876200. cat > $srcfile << EOF 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) end EOF g77 -Wl,--stack=2097152 $srcfile -o $exefile $exefile --------------------------------- -- Mark Hadfield "Ka puwaha te tai nei, Hoea tatou" m DOT hadfield AT niwa DOT co DOT nz National Institute for Water and Atmospheric Research (NIWA) -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/