Bill Allombert on Fri, 30 Jun 2023 09:12:27 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: How to interrupt a MT calculation?
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: How to interrupt a MT calculation?
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Fri, 30 Jun 2023 09:07:43 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1688108856; c=relaxed/relaxed; bh=0MgF2gvMCVPk4VBMCmvKIsX/buJcJ5NxqSVWMnyO6GM=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=iVWPzP2W1ZXgSNOY7Pz5vR/f/OlSQDbPSaEclLk4rYYZAJknrtYpLRnoY8fxr/O2Y9AVHxsBKGeP55mAM1tu1OM9RXIx7YleiUwHsRppxn+SqkrUyscPvXLkaxhmdIor2RRBsBGWtUd3LyjhiviG7UPfWoviA2yi7ySxcpM3enomf12hGMZmJVrRMEXPtc5Ygbo+XdIEyRKTGPq5jCM7tlcZuzqS35oWFAPfeyMzN8lkKK73H8GMbQ8F1ZiH3lpv4gesu5adPTsFcGWk9524LP4NOKIoF787+I1MhCi9KLDKa+kfME4NLBz1xRhgzuowe2Dr2O41T50yqPVEmjr04vaQBXWg703uz1/rQxl7oEhofMPvSBeetv9F2oFKJLS60I4v9VDRYLMmQnV8IF5itVJQzv8LElpKdo1h9p2QJtY4k9rkbLnMjUK3mG8fjDBcS3oL7GmYSq4Wsac8Oa/UL8MwEXiczVEkftJ3Cha/RHdpVDB8GIWTnv7qpqnt4gv4MKvcxvObz70dcd1jX+7dqJR+eOtdwh2W4nvD8BQ5fRQzYvKBhQaGrrzo6UH9uWrumtm477MhTNYRl/XOArJtAmItNkDcUA8jmj9rStgAWlV8S8QF560oovwNf5oHN4iheg1HpnvnMHZEj8+gm4E7lURyi7gBXvjpTh7Wu0q4XV0=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1688108856; cv=none; b=SUML1pHa63sRvFHzSjwYtHDI37U4NY4sp96qpQ5ypQyd9fa+o7ZjT3XIPixiivNo9xmPwxqe1k3vX0n7w/BzQKlaVXmErLd54D4lj56uoEuLm4F8eS4f4u/SRm1rq2OqAi74jn1YiDc41UbDW8/8Oc8dAjULF3ihBYZUKra2vMPW5IY9M8MZO94VOExNsnLqx9WIsnMvEIX3IBaNzDLpyNIyycKhCBJVBu8BHjaPABOANYaAzVnRenPdetQq221wN6WVYVH8jHaVY7UBQuGqzM6ffEf9zO6s8WfNHSVnU82qo/GPpbM+EbtoiVC6TYvauBto0brf+mYxtl4RhE1oBI2pVTRSgp42ImLYRG2xGAPxP9UmjDsPcvWxeuEOPOTIirIXLa157Gb9uxma9W+9YH2O65NSK1fAG8MpebWyJ2PxjYu4ESLJswvHXngnwZjtz5/FFAYbBbbRrtotaokADneos9GpIavzCblK0bny/w5vWSyYlklsjEyz0ZXP+4jvGNrIGRC+EKCW+gVJ3p8wU5GqfelkeH5e9WTPcc86/KgZDeosl2DcoOIFMfOg0xEZYdQphWVtp5iza+Jf+Avnw4TwXFDxSquWTxLyyqKpCcGrCjug9+vnBMrj+ZUU1Rwcms8WSxS0KmBKupqJmR+Hx2Ke/YtaWWo1gkaGSYtyOuI=
- Authentication-results: smail; arc=none
- Delivery-date: Fri, 30 Jun 2023 09:12:27 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1688108856; bh=0MgF2gvMCVPk4VBMCmvKIsX/buJcJ5NxqSVWMnyO6GM=; h=Date:From:To:Subject:References:In-Reply-To:From; b=KYtQJ2uKX5Gp/PMdeXvbTTjXrL/ZMo4L1q9ANSWwZ+4L5UqSWyGJH1oBf07aF9sfB 2p5J5eV2r/TDwvVtEugL/89/sN1JUqpe26Lv9pO2GPzoq84ffa0VN7oL3sW4xvMk0K st2Tb26BhQjPWkaMC0pXC6tZkdFzEg9kU6QcvvmIoWbB8ABoVz3xHO2OnO+BAgLxon 2y62USoa2sT+GZ7+1YG+RnuG6MbNrUjYYlfdsQoIQ2h4VeIx11ds446yjtQqrWZhwJ PuPxeouakAedd7iqUnuVXFBnK6oX0334obDOwYDLBYD9HiGBUs/Ndacr6uci2/SYZg YIcysJs4fqijNiXDgjmEBt4Pom66z4EywA9BM/ZdmumAy6qOcSCt5HmSK27OlTkiQa ixXvJhlAVXSGvpFT8F4pIEyI3QTaEGIYcodorWdx37SrMU4UM+A0JHf1rkIgVcqA7x MVtY3J96iz87Ov5YMN87+y26gjPtaZxiM+Trpb7I1uroRDy2vVPp21xMgM6ut4hHnZ k5AAzfHMeClX8XIPFLQDorQE+7k4A+/cSSIShrgDnvDyQU2qBXFvH02KsfISVVaxEz iID+IFz+T6KSpyt1GR1L5XNTZDiZ/e8lb3cFD7S4F1rIVFzVaT01CN3j80ZJWoDgs1 bIy2ovaON2GCbgaSCf8RtmPQ=
- In-reply-to: <d9c3a3c6-3e96-0547-afe7-197183350994@free.fr>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <d9c3a3c6-3e96-0547-afe7-197183350994@free.fr>
On Fri, Jun 30, 2023 at 02:19:22AM +0200, Jean-Luc ARNAUD wrote:
> Hi all,
>
> In such a script:
>
> |time()=[getabstime(),getwalltime()];||
> ||export(time);||
> ||
> ||Factor2_MT(n)=||
> ||
> ||{my(t);||||
> ||
> || print(pareval([
> ()->t=time(); factorint(n, 1); time()-t,||
> || ()->t=time(); factorint(n, 3); time()-t,||
> || ()->t=time(); if (n>2^468-1, factorint(n, 7), factorint(n, 6));
> time()-t,||
> || ()->t=time(); factorint(n, 9); time()-t,||
> || ()->t=time(); factorint(n, 11); time()-t,||
> || ()->t=time(); print(factor(n)); time()-t
> ]))||
> ||};|
>
> How is it possible to programmatically stop the calculations, let say as
> soon as a result is returned?
This is not really advised, but you can do as follow
Use
default(factor_add_primes,1)
and then replace
factorint(n,...) by error(factorint(n, ...));
and then do
iferr(pareval([ .... ]),E,return(Vec(E)))
Cheers,
Bill