Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct wrong array order and several bugs returning fortran ordered arrays #1180

Draft
wants to merge 28 commits into
base: devel
Choose a base branch
from

Conversation

EmilyBourne
Copy link
Member

@EmilyBourne EmilyBourne commented Aug 12, 2022

Correct wrong array order when initialising from a fortran ordered array (fixes #1171). Implemtation of tests showed several bugs when returning fortran ordered arrays. These are also fixed.

Commit Summary

  • Update version patch number
  • Add a test for np.array which returns an array and checks flags
  • [BUGFIX] Ensure numpy is aware that it owns the data returned by a function to ensure that this memory is freed
  • [BUGFIX] Only transpose 2d arrays saved to Fortran ordered objects if the transpose is required
  • [BUGFIX] pyccel and numpy handle slicing differently which requires a more complicated _ndarray_to_numpy_strides function to return a fortran ordered array
  • [BUGFIX] Correct numpy type when returning an array with rank>1

@EmilyBourne EmilyBourne marked this pull request as draft August 12, 2022 11:03
@yguclu
Copy link
Member

yguclu commented Nov 8, 2022

Hi @EmilyBourne, what's the status of this PR?

@EmilyBourne
Copy link
Member Author

This PR is supposed to fix a memory leak (I think some of the other bug fixes have been fixed in other branches since). It works perfectly for linux and mac but on Windows it is raising "double free". I need someone with a windows machine to run the test with a tool such as drmemory. I haven't been able to find anyone who has a windows machine and would be able to debug this. I managed to install pyccel on a very old Windows machine, but so far I haven't convinced it to run without getting stuck so I haven't been able to test myself. I can "fix" the problem with an ifdef macro but I am not sure that there wouldn't be a windows memory leak

yguclu pushed a commit that referenced this pull request Apr 9, 2024
In the Windows installation, do not use the `sleep` command to wait for
an executable to finish, as this leads to random crashes. Instead, use
the proper Windows commands (taken from PR #1180) to wait for the
execution.
EmilyBourne added a commit that referenced this pull request May 6, 2024
In the Windows installation, do not use the `sleep` command to wait for
an executable to finish, as this leads to random crashes. Instead, use
the proper Windows commands (taken from PR #1180) to wait for the
execution.
EmilyBourne added a commit that referenced this pull request May 7, 2024
In the Windows installation, do not use the `sleep` command to wait for
an executable to finish, as this leads to random crashes. Instead, use
the proper Windows commands (taken from PR #1180) to wait for the
execution.
@EmilyBourne EmilyBourne self-assigned this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong array order (memory layout)
3 participants