Ilya Zakharevich on Thu, 24 Nov 2005 01:51:24 +0100


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

Re: pari_init and programs using libpari.


On Tue, May 17, 2005 at 02:37:52PM +0200, Bill Allombert wrote:
> Hello pari-dev,
> 
> We are considering adding a new function as an optionnal replacement for
> pari_init. The idea is to add a flag that would let the user some
> behaviour of pari_init tpht might interfer with the program, in
> particular the installation of a signa handler.
> 
> We consider adding a function:
> void pari_init_fancy(size_t parisize, ulong maxprime, long initops)
> 
> If you have ran into trouble with pari_init() and would like
> improvements, now it is time to speak up.

Sorry for entering into discussion late.

This is what Math::Pari is using for many years now:

   INIT_JMP_off;
   INIT_SIG_off;
   /* These guys are new in 2.0. */
   init_defaults(1);
#ifndef NO_HIGHLEVEL_PARI
   pari_addfunctions(&pari_modules,
   functions_highlevel,helpmessages_highlevel);
   init_graph();
#endif

   primelimit = SvIV(pri);
   parisize = SvIV(mem);
   init(parisize, primelimit); /* Default: take four million bytes of
			        * memory for the stack,   calculate
				* primes up to 500000. */

[Current version is a little bit different, since it tries to reinit()
PARI on the second call - not very successfully...]

Hope this helps,
Ilya