From: Georg Bauhaus on
amado.alves(a)gmail.com wrote:

> I continue interested in ways to augment the stack size (or another
> way) to enable use of the standard library. Not so much for speed, but
> more for validation (GNAT passes ACATS right? Are ACATS for this
> library setup yet?)

Have you tried using ulimit or some such?
From: Dmitry A. Kazakov on
On Wed, 6 Aug 2008 11:40:09 -0700 (PDT), amado.alves(a)gmail.com wrote:

>> IMO, for such huge matrices and vectors, it is better to use in-place
>> operations, rather than a loose functional programming style.
>
> You mean a procedure with out parameter instead of function?

in out. For example:

procedure Multiply
(Accumulator : in out Real_Matrix; Multiplicand : Real_Matrix);

> Is there such utility?

You mean in the standard library. Unfortunately no, which limits its
usability. But you could implement them, as well as frequent mixed cases
like:

A := A * B + C

>> And do you have dense 5000 x 5000 matrices? You are a hardworking man!
>
> It's an hypertext.

An incidence matrix? I believe there exist special methods for
representation and handling them. But sorry, my numerical methods is quite
outdated.

> So now I want to increase the stack size. To 200M.

Ooch, that is a bad, bad idea. Stack is not for that. It should take no
longer than 5 min to implement Multiply in order that it would use O(n) of
pool instead of O(n**2) of stack...

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: amado.alves on
I tried a few tricks for stack size but failed. I did not find clear
documentation. Still interested.

In the meanwhile, I did a modification of the library.
It is interesting.
For matrix by vector multiplication, we have the useful property that

| A1 | x B = | A1 x B |
| A2 | | A2 x B |
|... | | ... |

so I am using this property to feed the BLAS function piecemeal.

/*
And Ada got in the way: slicing restricted to one-dimensional arrays!
La donna è mobile!
*/
From: Egil Høvik on
In Gnat, the default stack size (for the environmental task, and tasks
without a specified Storage_Size) is 2MB (at least for the targets I
have looked at). If you're using version 5.04 or higher, you can tell
gnatbind to use a different default stack size:

-dnn[k|m] Default primary stack size = nn [kilo|mega] bytes
-Dnn[k|m] Default secondary stack size = nn [kilo|mega] bytes


if you're using gnatmake, take a look at -bargs for how to specify
binder options


--
~egilhh
From: johnscpg on


amado.al...(a)gmail.com wrote:
> Upon failing miserably to convince GNAT to use a stack of 200M, I am
> currently working around the problem by writing my own matrix-by-
> vector multiplication function. It takes 2 seconds for a 5000 x 5000
> matrix, but it does not explode.
>
> I continue interested in ways to augment the stack size (or another
> way) to enable use of the standard library. Not so much for speed, but
> more for validation (GNAT passes ACATS right? Are ACATS for this
> library setup yet?)
>
> Thanks a lot.

I'm not sure if this relevant to your problem, but when I get
segmentation fault
in linux, its usually due to insufficient stack mem in the shell I'm
in.
Read up on: ulimit for bash shell. I use bash, and the command is
ulimit -s <some number of Megs>. I get lazy and type

ulimit -s unlimited

For csh I seem to recall its: limit stacksize unlimited.

in BASH:
ulimit -s unlimited
(type "ulimit -s" to see stack setting. The "s" is for stack.)
(type "ulimit -a" to see all settings.)

in CSH try:
limit stacksize unlimited
limit datasize unlimited
(type "limit" to see settings.)

jonathan