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

crash in zscal #174

Closed
juliantaylor opened this issue Dec 20, 2012 · 4 comments
Closed

crash in zscal #174

juliantaylor opened this issue Dec 20, 2012 · 4 comments
Labels
Milestone

Comments

@juliantaylor
Copy link

yet another crash, x86 32 bit in kernel/x86/zscal_sse2.S:131, fedora 11 gcc 4.4.1, git head
and x86_64 in kernel/x86_64/zscal_sse2.S:115, SLC 5.5 gcc 4.4.0, git head

also reproduced on ubuntu 13.10 with gcc 4.7.2 and the openblas package (0.2.5)

the code works perfectly fine with gsl or atlas on all tested platforms
decreasing k to to ~ 600 works,

#include <stdio.h>
#include <stdlib.h>
#include <cblas.h>

int main(int argc, const char *argv[])
{
    blasint m = 100;
    blasint k = 6000;
    double * a = calloc(m*k,sizeof(double complex));
    double * b = calloc(m*k,sizeof(double complex));
    double * c = calloc(m*k,sizeof(double complex));
    printf("%gMB\n", m*k*sizeof(double complex)/1024./1024.);
    double complex alpha = 1;
    double complex beta = 1;
    cblas_zhbmv(CblasRowMajor, CblasLower, m*k, 0, (double*)&alpha, a, 1, b, 1, (double*)&beta, c, 1);

    return 0;
}
@xianyi
Copy link
Collaborator

xianyi commented Dec 21, 2012

Thank you for the feedback.

We will debug next week

Xianyi

@xianyi
Copy link
Collaborator

xianyi commented Dec 26, 2012

Hi @juliantaylor ,

I already found the reason for the bug. This bug only happens with multithreading. Thread 0 created a buffer about 32MB. Every thread uses a part of this buffer to storing m complex numbers.

In your case, m is 6000*100 about 9.25MB. When OpenBLAS starts 4 threads, it will need 37MB which overflows the buffer.

Xianyi

xianyi added a commit that referenced this issue Feb 13, 2013
…d sbmv.

Instead of using thread 0 buffer, each thread uses its own sb buffer.
Thus, it can avoid overflowing thread 0 buffer.
@xianyi
Copy link
Collaborator

xianyi commented Feb 13, 2013

Hi @juliantaylor ,

I think I already fixed this bug on develop branch. Could you test it?

Xianyi

@juliantaylor
Copy link
Author

seems to work now, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants