A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/cython/cython/issues/5564 below:

[BUG] Compiled `prange` loop isn't able to exit section · Issue #5564 · cython/cython · GitHub

Describe the bug

ref david-cortes/hpfrec#14

With the latest cython==3.0.0, some 'for' loops using prange in .pyx files are being compiled into something that isn't able to finish the loop (this is about just deterministically-numbered for's), but will work correctly (that is, the program is able to exit from the loop) if switched to regular range or if compiled with an older cython version.

I haven't been able to produce a minimally reproducible example and am not sure what exactly is wrong, nor how to debug it, but I have this particular example here:
https://github.com/david-cortes/hpfrec/blob/aac53899f9b93071a1a2267f41f61f603c4a33d9/hpfrec/cython_loops.pxi#L579

If adding printf lines, I am seeing that the code is able to enter the loop, and at least some individual iterations are able to reach the last line inside the 'for' chunk if I add a printf in each loop iteration, but if adding a printf statement right outside of the 'for' indentation, it never reaches that line.

The issue happens with both GCC and CLANG.

Attached is the generated C file in case it helps. The translated chunk starts at L21624 in the C file.
cython_double_nonwindows.zip

Code to reproduce the behaviour:

https://github.com/david-cortes/hpfrec/blob/aac53899f9b93071a1a2267f41f61f603c4a33d9/hpfrec/cython_loops.pxi#L579

Expected behaviour

The prange loop should reach the end of the execution in the code above, which is deterministic and not dependant on any variable that would get modified inside the loop.

OS

Linux

Python version

3.9

Cython version

3.0.0

Additional context

No response


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4