| Thread Tools | Search this thread |
|---|
valeriyfedotov
| July 6, 2009 2:08 PM PDT Segmentation fault in dsyevr. | ||||
Hello. I cant make dsyevr work properly. After some tries I wrote simple example of my problem. There are two calls to dsyevr that work and two that don't. But the arguments look fine and differ with working examples too little. I can't understand what's the problem. My MKL version is 10.2.1.017, and I compile it with command icc stuff.c -I"opt/intel/mkl/10.2.1.017/include/" -L"/opt/intel/mkl/10.2.1.017/lib/" -lmkl_core -lmkl_intel_thread -lguide -lpthread -lmkl_lapack -lmkl_intel Source code (all arrays are of 1000 elements to ensure there is enough memory): #include <stdio.h> #include <mkl_lapack.h> #include <unistd.h> int main(){ int n = 3; // 1 2 3 // 2 4 5 // 3 5 7 double M[1000] = {1, 2, 3, 2, 4, 5, 3, 5, 7}; double a,b; int i,j; double accuracy = 1e-6; int m; double eigVal[1000]; double eigVect[1000]; int isuppz[1000]; double work[1000]; int iwork[1000]; int many = 1000; int status = 0; // First two work: a = -100; b = 100; dsyevr("V", "V", "L", &n, M, &n, &a, &b, &i, &j, &accuracy, &m, eigVal, eigVect, &n, isuppz, work, &many, iwork, &many, &status); i = 1; j = 2; dsyevr("V", "I", "L", &n, M, &n, &a, &b, &i, &j, &accuracy, &m, eigVal, eigVect, &n, isuppz, work, &many, iwork, &many, &status); // Second two make segfaults: i = 1; j = 3; dsyevr("V", "I", "L", &n, M, &n, &a, &b, &i, &j, &accuracy, &m, eigVal, eigVect, &n, isuppz, work, &many, iwork, &many, &status); dsyevr("V", "A", "L", &n, M, &n, &a, &b, &i, &j, &accuracy, &m, eigVal, eigVect, &n, isuppz, work, &many, iwork, &many, &status); int k; for(k = 0; k < n; k ++){ printf("%f ", eigVal[k]); } printf("\n"); return 0; } | |||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
| 8442 users have contributed to 31547 threads and 100373 posts to date. |
|---|
| In the past 24 hours, we have 11 new thread(s) 33 new posts(s), and 44 new user(s). In the past 3 days, the most popular thread for everyone has been /fpp interferes with breakpoints/stepping through code - again The most posts were made to Help with hitting maximum record length in the compiler with debug info? The post with the most views is You could save the pre-proce Please welcome our newest member mrnm |