Karim BELABAS on Mon, 13 Nov 2000 14:55:30 +0100 (MET)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: *** the PARI stack overflows !!!


[James G. McLaughlin:]
> The version of gp in use here may be an old one (not sure) so maybe this
> problem no longer exists.

Easy to ascertain. What are the first few lines GP outputs upon startup? Mine
reads
                GP/PARI CALCULATOR Version 2.1.0 (development)
                 UltraSparc (MicroSparc kernel) 32-bit version
               (readline v1.0 enabled, extended help available)

> My problem is this: If I run a gp program from a file and the PARI stack
> overflows gp doubles the stack size but then quits

If GP doubles the stack by himself, then version <= 2.0.17 [released
24/09/1999] (was changed for 2.0.18)

> , unless I have another copy of the program following the first (and if the
> stack overflows several times I need several copies of the program in
> succession, one for each time the stack overflows).

What do you mean by "another copy of the program following the first" ???

> I know one way around this is to allocate a lot of memory but usually I do
> not know how big the job will get so I do not like this, particularly as
> there are other users on the system.

Also too large a stack usually results in less efficient operation.

> Is there a way to get gp to go back to the beginning of a program and start
> over again, once it has doubled the stack size, rather than just quitting,
> if there is not a new copy of the program to start on.

There's no way to have GP restart a program after you double the stack (or
you let GP double it in older versions). Recent versions (>= 2.0.18) let you
'trap' the "stack overflow" and recover, but they don't let you allocate more
memory as part of the recovery.

Cheers,

    Karim.
-- 
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://www.parigp-home.de/