From: amado.alves on
I manage to process 1000 x 1000 matrices with the respective Ada 2005
standard library with GNAT GPL 2008. Processing includes
multiplication by a vector.

Now I want larger matrices, say 5000 x 5000. The objects seem to be
allocated ok (dynamically), but mutiplication gives a "segmentation
fault."

Any tips on how to overcome this?

Thanks a lot.
From: Georg Bauhaus on
amado.alves(a)gmail.com schrieb:

> Now I want larger matrices, say 5000 x 5000. The objects seem to be
> allocated ok (dynamically), but mutiplication gives a "segmentation
> fault."
>
> Any tips on how to overcome this?

Have you tried having gnatmake recompile the library
units (-a,-f,-s) with, say, -g, -O, -gnata, -gnato,
and -fstack-check? Might yield a better diagnostic.


--
Georg Bauhaus
Y A Time Drain http://www.9toX.de
From: amado.alves on
> Have you tried having gnatmake recompile the library
> units (-a,-f,-s) with, say, -g, -O, -gnata, -gnato,
> and -fstack-check?  Might yield a better diagnostic. (Bauhaus)

I'll try that and let you all know. Thanks a lot for this great first
orientation in the miriad set of compiler options.
From: amado.alves on
It's a Storage_Error with the message "stack overflow detected".

My program does not use the stack, so probably the multiplication is
implemented as a function with parameters passed on the stack and this
overflows, like it does if I trie to create the large arrays as static
objects.

Next I will try to increase the stack size, but I bet I'm gonna hit
the 2G ceiling :-(

(Recently I saw memory pointers being defined as 32-bit integers.)
From: Dmitry A. Kazakov on
On Wed, 6 Aug 2008 10:29:09 -0700 (PDT), amado.alves(a)gmail.com wrote:

> It's a Storage_Error with the message "stack overflow detected".
>
> My program does not use the stack, so probably the multiplication is
> implemented as a function with parameters passed on the stack and this
> overflows, like it does if I trie to create the large arrays as static
> objects.

IMO, for such huge matrices and vectors, it is better to use in-place
operations, rather than a loose functional programming style.

And do you have dense 5000 x 5000 matrices? You are a hardworking man!
(:-))

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de