while loops compiled to do-while blocks for JITParticles #2518
andrewwatford
started this conversation in
General
Replies: 1 comment
-
|
Thanks for flagging this, @andrewwatford. I had not realised this subtle aspect of the codeconverter myself. So good to be aware! Note that in the new Parcels v4, we have ditched the code conversion to C altogether in favour of pure python Kernels, so this unexpected behaviour will not be an issue anymore |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I just wanted to flag something I noticed in v3.1.4. If a kernel contains a
whileloop, it is compiled to ado-whileblock in C forJITParticles. This leads to different behaviour for JIT vs Scipy particles, and this was causing me some problems in a kernel I was using. I didn't see it mentioned anywhere so I thought I'd mention it here in case anyone else runs into a similar problem.The way I got around this in Python was by adding a bit of extra code to my while loop:
becomes
though I'm sure there are other ways too!
Beta Was this translation helpful? Give feedback.
All reactions