- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
#include
#include
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
}
printf("\n");
return 0;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Valery,
I guess you are trying to work on ia32 architecture, therefore you have to
1)setting L"/opt/intel/mkl/10.2.1.017/lib/32
and
2) using another linking line:
-Wl,--start-group -lmkl_intel -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread
As a result your linking line should be like:
icc stuff.c -I"opt/intel/mkl/10.2.1.017/include/" -L"/opt/intel/mkl/10.2.1.017/lib/32" -Wl,--start-group -lmkl_intel -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread
for more info how to link properly please refer to the KB article: http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Documentation says that when all eigenvalues are computed either by "A" parameter of by "I" parameter with i = 1 and j = n (this lines don't work), the routine references array isuppz, but it seems valid to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well. At the first glance all input parameters are correct.
Valery, can you check the problem when all arrays will be allocated dynamically.
For the reproducing the problem - what is the CPU type you are working on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have done it with dynamical memory, but segfault remains. Also, it's intresting, when I uncomment bzero call, the program finishes normally.
#include
#include
#include
#include
int main(){
int n = 3;
// 1 2 3
// 2 4 5
// 3 5 7
double MM[1000] = {1, 2, 3, 2, 4, 5, 3, 5, 7};
double *M = (double *) malloc( sizeof(double) * 1000);
memcpy(M, MM, sizeof(double) * 9);
//bzero(M, sizeof(double) * 1000);
double a,b;
int i,j;
double accuracy = 1e-6;
int m;
double *eigVal = (double *) malloc( sizeof(double) * 1000);
double *eigVect = (double *) malloc( sizeof(double) * 1000);
int *isuppz = (int *) malloc( sizeof(int) * 1000);
double *work = (double *) malloc( sizeof(double) * 1000);
int *iwork = (int *) malloc( sizeof(int) * 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
}
printf("n");
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
..
Ubuntu* 8.10 (IA-32 / Intel 64)
But I will check the problem and will back if any upadates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
btw, originally i checked the problem on win32 and got the following output:
-0.600823 0.695387 11.905435
Do you have the similar results on ubuntu?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
btw, originally i checked the problem on win32 and got the following output:
-0.600823 0.695387 11.905435
Do you have the similar results on ubuntu?
No, I have got -0.247820, 0.338816, 11.908962. But I checked them with maxima and online solvers, they are correct.
For myself, I made a = -1e20 and b = 1e20 with "V" option, and make error in my subroutine if dsyevr doesn't find all values.
And I will try it in Ubuntu 8.10 this week.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, I have got -0.247820, 0.338816, 11.908962. But I checked them with maxima and online solvers, they are correct.
For myself, I made a = -1e20 and b = 1e20 with "V" option, and make error in my subroutine if dsyevr doesn't find all values.
And I will try it in Ubuntu 8.10 this week.
the segmentaion problem was reproduced on RHEL 4, but no problem on win32. we will investigate the problem and will back to you asap.
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the segmentaion problem was reproduced on RHEL 4, but no problem on win32. we will investigate the problem and will back to you asap.
--Gennady
Valery,
the problem you reported has been fixed in the latest MKL v.10.2 Update 2 available now.
You can download it from intel registratin center.
The version is shipped with Intel Compiler Proffesional Edition, version 11.1 for Linux ( build 056 ).
See the log i 've got running your test:
[root@XXXXX 555076]# ./fix.out
FIRST STEPS
SECOND STEPS
THIRD STEPS
4 STEPS
-0.600823 0.695387 11.905435
--Gennady
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page