Re: CCL:large array, fortran 90, SGI compiler



On Fri, 10 Mar 2000, Wang Xiaogang wrote:
 > Dear CCLers,
 >
 >  The question is about how to handle large array in fortran 90.
 >
 >  An example:
 >
 >  program
 >  real*8 a(10000,10000)  ! an 800MB array
 >  common /test/a
 >  end
 >
 >  However on one SGI origin2000, MIPSpro Fortran 90 Version 7.3,
 > the compiling fails.
 >
 >  On another SGI origin2000, Ragnarok Compilers: Version 6.2,
 > the compiling passes.
 >  It also passes on DEC Alpha with Digital f90 compiler.
 >
 >  It seems that the SGI f90 compiler (version 7.3) puts the common block
 > data to the stack segment instead of data segment. The error message
 > is 'exceeds 268,435,455 bytes, the maximum storage size available'
 >
 > Any hints? Thanks.
 >
 > Xiaogang
 Xiaogang,
 This is not related to stack vs data segment allocation. All common blocks
 are allocated in the data segment. The problem here is a limitation in
 the current f90 to statically allocate any array that exceeds 256 MB when
 you compile with -n32. The workarounds are to compile with -64 if
 possible (i.e. you are not planning to run on 32-bit kernels) or to
 use dynamic allocation. The 6.2 f90 didn't have that problem because it
 was a different compiler.
 Omar.
 +---------------------------------------------------------------------+
 Omar G. Stradella, Ph.D.
 SGI / Chemistry and Biology Applications Group
 1 Cabot Rd, Suite 250, Hudson, MA 01749, USA    N 42 22'40" W 71
 33'44"
 E-mail: omar %! at !% sgi.com        Phone: +1-781-839-2258 FAX: +1-978-562-7450
 http://www.sgi.com/chembio                  http://reality.sgi.com/omar
 +--------  Ph-nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn  -------+