Ruud H.G. van Tol on Fri, 20 Sep 2024 13:03:12 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: concurrent computation of a function
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: concurrent computation of a function
- From: "Ruud H.G. van Tol" <rvtol@isolution.nl>
- Date: Fri, 20 Sep 2024 13:03:06 +0200
- Delivery-date: Fri, 20 Sep 2024 13:03:13 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=isolution.nl; s=soverin; t=1726830187; bh=9vZoRW+BwRMlAWedqtXK0ZfjpomAAu3tiyD9GZ1y8f8=; h=Date:Subject:To:References:From:In-Reply-To:From; b=QyLwM/tN4Sk/R2DpJfM2mDFOFgaB04jidqcSNV354g6yYgISX8ylN7CXppdroyU69 xUCHf14CFEhy7CBHFGujMvhLB2PejSypKVJ1R7cFUQUzu4sS1PNsVf2XGEWhD9xg2s HfaMAnQahm8kOMcjUkfjP1lSrB6EAhq490LgV9nS0GlM6KzL3NuricFYirJF874gBg 0CxvlJGA8omi+e3+Wd9uURHfFQEyBX4QZwpOkRJhB/n0LvgZPH+Eg5wyLYt9+0GPal Qn0JI8rWpObGYA4tY9eWZD3gNDAi5E8ZNAesLHPDB5WLfvoRQxVrVt0+9SwKUR8J/3 +q7Qyno+9qh8A==
- In-reply-to: <CAJkPp5NVqG51fQ_UiGFc1MbVLUiV6QhY5fCg1O67R-SkhhG-5g@mail.gmail.com>
- References: <CAJkPp5NVqG51fQ_UiGFc1MbVLUiV6QhY5fCg1O67R-SkhhG-5g@mail.gmail.com>
On 2024-09-19 16:40, Max Alekseyev wrote:
Suppose I have two functions func1(x) and func2(x) computing the same
entity, where depending on the input one may be much faster than the
other (or vice versa).
For the same input x, I'd like to compute them in parallel and return
the result as soon as one of them completes, and terminate execution
of the other.
Is there a way to achieve this in PARI/GP?
PS. Here are possible solutions for SageMath/Python:
https://ask.sagemath.org/question/59480/
In some cases you could effectively use a "stopfile", or some other
global resource.
Each variant then has to check for its existence-or-state, at key points
in its iterations, and can then stop gracefully.
-- Ruud