LAPACK Archives

[Lapack] Question for array size in Lapack subroutine

And James writes:
My data segment size is exceeding 2GB.  That's what is causing
problems.  This would require to allocate memory dynamically.
How to fix this problem?  How to revise it?

Some compilers start generating garbage if you declare static
arrays over 2GiB, so the link failure may have saved you some
painful debugging.  And you're entering the area where
offset computations may be incorrect if the intermediate results
are computed in 32-bit integers.

I would strongly advise using dynamic allocation to handle your
immediate problem.  It's not at all difficult in modern Fortran:

  real(kind(0.0d0)), allocatable:: bigarray(:), bigarray2(:,:)
  integer:: M, N

  allocate ( bigarray(N), bigarray2(M,N) )

The allocate() call will abort if it fails to allocate enough
memory for all its arguments.  Optional arguments permit
different error handling options.  The "final committee drafts"
of the Fortran standards (documents right before final voting)
are available through http://www.j3-fortran.org/ and provide
the full specifications for allocate.

We avoid dynamic allocation within LAPACK proper for historical
reasons and for use in particular applications (validated
systems where "dynamic allocation" is forbidden).

Jason

<Prev in Thread] Current Thread [Next in Thread>


For additional information you may use the LAPACK/ScaLAPACK Forum.
Or one of the mailing lists, or