8000 BUG: sparse: work around alignment issue in f2py in Numpy 1.9.1 by pv · Pull Request #4241 · scipy/scipy · GitHub
[go: up one dir, main page]

Skip to content

BUG: sparse: work around alignment issue in f2py in Numpy 1.9.1 #4241

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

Merged
merged 1 commit into from
Dec 8, 2014

Conversation

pv
Copy link
Member
@pv pv commented Dec 7, 2014

This version of Numpy specifies complex dtype alignments that are not
guaranteed by system malloc on win32, so that np.zeros does not produce
sufficiently aligned arrays.

Work around this issue by using an aligned allocator for intent(inout)
arrays that are potentially complex valued.

Workaround for gh-4168, while waiting for Numpy be fixed

This should cover all complex-valued f2py inout arrays in Scipy

@pv pv added this to the 0.14.1 milestone Dec 7, 2014
@pv pv added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Dec 7, 2014
@pv pv force-pushed the f2py-aligned-alloc branch 6 times, most recently from 4df03bf to d65488e Compare December 7, 2014 16:05
This version of Numpy specifies complex dtype alignments that are not
guaranteed by system malloc on win32, so that np.zeros does not produce
sufficiently aligned arrays.

Work around this issue by using an aligned allocator for intent(inout)
arrays that are potentially complex valued.
@pv pv force-pushed the f2py-aligned-alloc branch from d65488e to ab4e751 Compare December 7, 2014 17:33
@pv
Copy link
Member Author
pv commented Dec 8, 2014

Would prefer to merge this today, so that this issue won't hold up releases.

@rgommers
Copy link
Member
rgommers commented Dec 8, 2014

Tested also on 32-bit Linux, no issues. I haven't followed this issue really, so I'm not going to review in detail. But OK to merge if it works I'd think.

@argriffing
Copy link
Contributor

I don't have skills at the intersection of numpy alignment hacking, ARPACK, and f2py, but I doubt anyone who does have them will review this before tomorrow so I'll go ahead and merge.

argriffing added a commit that referenced this pull request Dec 8, 2014
BUG: sparse: work around alignment issue in f2py in Numpy 1.9.1
@argriffing argriffing merged commit 06e75d9 into scipy:master Dec 8, 2014
@cournape
Copy link
Member

I can confirm that the arpack issue disappears with numpy 1.9.1 and this patch backported on 0.14.x.

I still see a few issues in linalg, but should be unrelated. Any issue against backporting this to 0.14.x ?

@pv
Copy link
Member Author
pv commented Dec 11, 2014

Yes, this should be backported to both branches

@cournape
Copy link
Member

I think this fix is not enough: the other errors I saw are actually linked to this, and if I instead apply my fix to tighten alignment, they disappear. See numpy/numpy#5365 for details

@pv
Copy link
Member Author
pv commented Dec 11, 2014

The fblas failures seem to be due to bugs in the tests only. For
intent(in,out), the tests should have used x = self.blas_func(...)
instead of self.blas_func(...), as intent(in,out) in f2py means that
a copy may be made if needed unlike for intent(inout).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0