Bill Allombert on Fri, 19 May 2023 00:00:15 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Help running parfor...
|
- To: wraithx@morpheus.net
- Subject: Re: Help running parfor...
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Thu, 18 May 2023 23:55:17 +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=1684446908; c=relaxed/relaxed; bh=3pYAP8wvZjWsGLl7KkfbW4yVk1hEthg800yXAlS3x/w=; h=DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=BYT+PF4lFqKWDymu1KJly/+LWY2COgttUnn1KavSctYKIVrVaGSbPMDhpWSHW8PdOtltoPGtX88hbZyElFUDvjVLvF1PWicH7vVikqDDQMRuYbT3wnY6GS9no2/VG7otDRro4pO8s26CoCKYDfeaPiDiQNLE3VTFMCmYWYjHzGBQSVqNHCisJbDdAITkVUaGS7C1BFowH00Ik5F1KxvCrU2Orl43/ZL1+t1FHmwMhm/RxseJMcpwYI3TC4lmNTUZy7oSMRavQvDxMfHOtpXOoJl72QGP5xk+a78UPSJD0i+1WOWLN43OrNWEqSOyDr65wu980hRFKSPwgNqt61J32FoupXCMIiRS0MbfYGAuI8QnpgqalcBPbDoso1QnSJGSULWzGdoIVBjWtC5vcdN0R/FaLfOdFk3B9lN/RfFHYlwLm5jCPMyk9nfjTIK4Jg+k5BxqrlrXXLeh2LAzHHgzRe8LeZ/CRGcrozEy51R+Z5/xvsucKh52Ldlr4w0AIC22NsYo502tUYsnrdPsegCgYRwtbheE/y4KPO6ZiOyfD8jiehHGC6F+yEAowOahdiyonE1IxjNYQ62az53Lr0UWlz+ZP8VYtbD9mLiystYpRBXBCmGhwSylBXCVeAP8jnmwwyIi9SvxlzcHHq4PoRtpmv36Gd6jkwxmvZuAdcZhSf4=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1684446908; cv=none; b=aF4rf3S861DXF4SPcVYxOPxLXWiwrrma/Io9ZGUaouGQ8RxjKzIUB8GnXJm7vr16blTDJqMg6F1WduDxugWr9sSDAyTZlELA/dg3Ml27+mxFE46LryMFHkN3mVGcZmmXRPC8YwZcdX2zjiHzjcjl/NRv+U1s2ZW2lgvkTxv2HoWv8FJGm/hqLsDhMNowckVM5XPvhYxI9ErlpOndvjg92dXWwNZtC4vTpP0ozSZH4/azKaPVWr5XsXTBOCUs65+5gOMqnikz0pEt8tKt794Qs9VHkSbbEWCrBqJUngzBikkH3MvVfRYwDboBhJi/lxjk0J7vzrxyK1cvVu4w8mDcxVMGmwdtkYUmWUtenu5RYIYnRkd/75NqKrn5wu/EHsS7onuUmeyWu0ouuYtzF2XmfxWCjOyzeTwkT8L1Qe3VAHkJ1DY5cFmN81LBK8BIbqHnhIxynVo/UMGIxCaTdFi4IQRN1YI/EKy4RFdQzlmRh2vscRdl4bFM5VdRDVNqsAb5e6WSLcyBkbkxSqwOx7I7clX99iC7zK1WU/thpi46Q0p3oM8dE+4R5g5OK+duTk/ORrbYTXrNF17EFBkLnD5a7mW8uIsvwd3wRP20VvJ8C2EaT29Oi/HVZVUfH4s/iCManf9GCP4mv1CljN4vDRQaQgrrP5IZ9ioLVFt2HLD3Vmw=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Cc: pari-users@pari.math.u-bordeaux.fr
- Delivery-date: Fri, 19 May 2023 00:00:15 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1684446907; bh=3pYAP8wvZjWsGLl7KkfbW4yVk1hEthg800yXAlS3x/w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TDN9ILWeRDB8z/cnHFBTMQWvMwjw3w4I4yypLPxCoSsAQjJHtIl0VMpwRO71j0Stm jGVBUsp4AojRfIwX6+y/KVVK+MkMy0uP9qw2z8buJ2InASEjpmRIF0lVGLkKaB20G1 ZmneyUp/geYrUlEm17fViTKo9/eSEw7KzjBcmLLK8lkyHqVQqYUwm2Pcd3HryYy/pS HgNCj+4I5IV77RxjZssfk/y6yBrY+xOy5bhAhV3iRVF4ZCzn57EEsfgKN3rIfnUxF0 2n1cB4mXIhKp7C2RtVIydDUrTE4T6VpJ1AgIRiJHpJiXzZq5LHWWpd4j/sPmgmCd+H Poswb5eHkAkm1L92R/ztb0S6qFcVtZG15Jdu7FXrJ6qCVBf1Iee3dsSVeAkAiprrja TOrFoLZRLG3fb/OzoL6qQpeBuaAUdbZS0QtI3ih5Z7PfJaTo0w6H3fsRpHpf2J67yV OOe3xvxbxnyGRi4svnQHj60XJ+ZURj52VxZtn5i4UasqLhMDSq0RmrrKmGSpcII1g/ 1mPjXyKD6KlKzhmisgOoSGXKtJDv9IWo0PSu4NP09K6i6eX/6kcT6GmJ8yOil6jykV O0UVL6ybG4zlRdCxhQis5kcuTy2W3FXbU4s0Py6iq6S2R/cW6kxiWz0cggSwlnF2+4 /OIxwr33wZqqdAmCpXoC3fVE=
- In-reply-to: <646697B2.4070703@morpheus.net>
- Mail-followup-to: wraithx@morpheus.net, pari-users@pari.math.u-bordeaux.fr
- References: <646697B2.4070703@morpheus.net>
On Thu, May 18, 2023 at 04:25:06PM -0500, wraithx@morpheus.net wrote:
> Hello,
>
> I think I'm having trouble using parfor. I just downloaded and installed
> Pari64-2-15-3-pthread.exe. I'm trying to use parfor, but it seems like it
> is only using a single thread. I've created some test code to use 4
> threads, and it seems to run the first iteration until completion, then it
> starts running the second iteration to completion, and so on until the last
> iteration until completion. I put in print statements hoping to see it
> randomly working on different iterations, depending on which thread executed
> the print statement. But it's printing each iteration in order with no sign
> of parallelism here.
parfor(i = first_n, last_n,
get_fname(p,i),
fname,
parallel_g(fname, p, i, range)
);
When using parfor the first sequence of instructions (3rd arhument, here get_fname(p,i)) is run
in parallel, but not the second one (5th argument, here parallel_g) which is sequentially.
This is on purpose.
So yes, the call to parallel_g are done sequentially in this example.
Maybe you wanted to do simply:
parfor(i = first_n, last_n,
my(fname=get_fname(p,i));
parallel_g(fname, p, i, range)
);
Beware that on Windows Pari64-2-15-3-pthread.exe might be much slower than Pari64-2-15-3.exe
It is better to use the Windows subsystem for Linux.
Cheers,
Bill.