On Thu, May 12, 2022 at 07:52:25PM -0700, 'Nasser M. Abbasi' via FriCAS -
computer algebra system wrote:
> Fyi,
>
> Using just released sagemath 9.6 RC 4, the sagemath pexpect interface
> seems
> to allow timeout and it works on initial tests.
BTW: Developement version of FriCAS has preliminary implementation
of timeouts. It works only with sbcl, but IIUC you use sbcl
and sbcl is best for performance (and extra features).
> Since it is much simpler than using spawn and multiprocessing, then CAS
> integration
> test will use it for summer 2022 test report.
>
> Here is an example show it works
>
> ```
> #!/usr/bin/env sage
>
> import os, sys, time, datetime, ntpath
> from sage.all import *
>
> if __name__ == "__main__":
>
> x = var('x')
> integrand = sin(x)
> fricas(2) #just to start fricas and attach to it
>
> fricas._expect.timeout = 0.0000001 #set time out
>
> try:
> anti = integrate(integrand,x,algorithm="fricas")
> print("did not time out. Result is ",anti)
> except Exception as ee:
> print("Exception raised! " + type(ee).__name__)
> ```
>
> >sage ./test_one_integral_in_sage_direct_not_using_spawn.sage
> Exception raised! TIMEOUT
> >
>
> Changing the timeout to 60 now gives
>
> >sage ./test_one_integral_in_sage_direct_not_using_spawn.sage
> did not time out. Result is -cos(x)
>
> Using the above makes the rest script simpler (this will be done in a loop).
> But now the issue is with clearing the fricas kernel cache which you should
> will produce better result.
>
> How would this be done from sagemath script above? I now do not know.
There are FriCAS commands:
)clear scaches
)clear all
First clears kernel cache and few other caches. The second primarlly
is intended "refersh" FriCAS, that is forget various things like
variable settings but also clear caches.
OTOH it is not clear for me if you need clearing. On 10000 random
exp-log examples run as single file FriCAS needs to create a
lot of kernels and can do the integrals in 3 minutes (on a fast machine).
IIUC you run each file separately and other files have
smaller nuber of example than 10000 file.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/20220513131025.GA7591%40fricas.math.uni.wroc.pl.