- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm a beginner in using MKL library , Actually I want to solve a system of equation by calling dgetf and dgetrs function , but the segmentation fault error always appear when I run my program. The equation is Ax=B, which A is a dim*dim array and B is a dim array. Here is the part of my program which solves the system of equation
void Solve(int dim, double* A, double* B)
{
int* piv = new int [dim];
int info = 0;
int nhrs = 1;
char p = 'T';
dgetrf(&dim, &dim, A, &dim, piv, &info);
if(info)
{
printf("Fact failed -- %d\\n", info);
for(int i = 0; i < dim; i ++)
{
for(int j = 0; j < dim; j ++)
printf("%e\\t", A[i*dim+j]);
printf("\\n");
}
exit(0);
}
cout<<"\\n","\\n";
dgetrs(&p, &dim, &nhrs, A,&dim, piv, B, &dim, &info);
if(info)
{
printf("Solve failed -- %d\\n", info);
exit(0);
}
free(piv);
}
It would be highly appreciated if you can hel me .Link Copied
10 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have posted a fragment of a program. There is no point in listing all the possible ways in which that fragment could be expanded into a runnable program that causes a runtime error. Nor is there much to gain from posting one example of code that runs correctly, even though this is quite a bit easier to do.
Present a complete example and you will improve the chances that someone will tell you what the mistakes are.
Present a complete example and you will improve the chances that someone will tell you what the mistakes are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanksfor your comment , I didn't get your meaning , here is the function which should solve my system of equation Ax=B, where A is the Matrix ofcoefficient, and in a n*n array , and b is the right side of my equation which is a n array . This is a complete example forexampleif youputA={1,2,1,2,1,1,1,1,0} and B={230} and send it ti the Sole the error segmentation fault appears.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I checked the problem with the version 10.2 Update7. win7. 32bit. No exceptions were found with the inputs you pointed.
for example - see the results after dgetrf
dgetrf passed -- 0
2.000000e+000 5.000000e-001 5.000000e-001
1.000000e+000 1.500000e+000 3.333333e-001
1.000000e+000 5.000000e-001 -6.666667e-001
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply , can you please say me the libraries you have linked ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
B={230} and send it ti the Sole the error segmentation fault appears
B={230} initializes only B[0], leaving B[1] and B[2] unset.
send it ti the Sole
????
B={230} initializes only B[0], leaving B[1] and B[2] unset.
send it ti the Sole
????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry I mean B={2,3,0} not {230}.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib"
if you need I can send the VS2008 project with yourexample.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much, my question is that do you know which libraries are equal to this library in linux version , I'm using a linux version of mkl library so I don't know which library I should link for this new version because the guide library for last version is omitted in this version .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Enough has changed since the MKL which had libguide, and enough depends on input from you, that the link advisor at the top of this forum would be better than taking a guess, although basically there's a direct correspondence between libraries needed for Windows and those for linux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page