- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to use pardiso to solve a matrix inversion problem. I have made a small example to test out my calls to the solver. When I run my example I receive the following message:
*** glibc detected *** free(): invalid next size (fast): 0x00000000009f34b0 ***
Abort
The code for my example is as follows:
void *pt[64];
for(int i=0;i<64;i++) {pt = 0;}
int maxfct = 1;
int mnum = 1;
int mtype = -2; // real symmetric positive indefinite
int phase = 13; // do all steps, analysis, factor, solve, refine
int n = 6;
int *perm = NULL; // pardiso does it's own permutation
int nrhs = 18; // number of equations = num columns of E = size of interface
int *iparm = NULL;
if(!(iparm = (int *)malloc(64*sizeof(int)))) exit(-1);
iparm[0] = 0; // use default values for now
iparm[2] = 1; // MUST be equal to num threads
mkl_set_num_threads(1);
int msglvl = 1; // print out statistics for now
int error = 0;
double nzval[12] = {109.018, -12.8205, -0.0437675, -83.3333, 31.9348, -0.0437675, 12.5438, -6.25, 18.7938, 83.3333, 1, -20};
int colidx[12] = {0, 1, 2, 4, 1, 3, 2, 3, 3, 4, 5, 5};
int rowptr[7] = {0, 4, 6, 8, 9, 11, 12};
double B[108] = {0, -12.8205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12.8205, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6.25, 0, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
double X[108];
cout << "starting ";
pardiso_(pt, &maxfct, &mnum, &mtype, &phase, &n, nzval, rowptr, colidx, perm, &nrhs, iparm, &msglvl, B, X, &error);
I am using C++ code with the gcc compiler and am statically linking with the libmkl_solver_lp64.a library. The compilation and linking steps produce no errors or warnings.
Any clues why this does not work?
Also, is B expected in row-major or column-major order?
For example, if b(i) = i; Then the matrix B should be:
1 2 3
4 5 6
7 8 9 = row-major
or
1 4 7
2 5 8
3 6 9 = col-major
Thanks,
-Michael-
*** glibc detected *** free(): invalid next size (fast): 0x00000000009f34b0 ***
Abort
The code for my example is as follows:
void *pt[64];
for(int i=0;i<64;i++) {pt = 0;}
int maxfct = 1;
int mnum = 1;
int mtype = -2; // real symmetric positive indefinite
int phase = 13; // do all steps, analysis, factor, solve, refine
int n = 6;
int *perm = NULL; // pardiso does it's own permutation
int nrhs = 18; // number of equations = num columns of E = size of interface
int *iparm = NULL;
if(!(iparm = (int *)malloc(64*sizeof(int)))) exit(-1);
iparm[0] = 0; // use default values for now
iparm[2] = 1; // MUST be equal to num threads
mkl_set_num_threads(1);
int msglvl = 1; // print out statistics for now
int error = 0;
double nzval[12] = {109.018, -12.8205, -0.0437675, -83.3333, 31.9348, -0.0437675, 12.5438, -6.25, 18.7938, 83.3333, 1, -20};
int colidx[12] = {0, 1, 2, 4, 1, 3, 2, 3, 3, 4, 5, 5};
int rowptr[7] = {0, 4, 6, 8, 9, 11, 12};
double B[108] = {0, -12.8205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12.8205, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6.25, 0, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
double X[108];
cout << "starting ";
pardiso_(pt, &maxfct, &mnum, &mtype, &phase, &n, nzval, rowptr, colidx, perm, &nrhs, iparm, &msglvl, B, X, &error);
I am using C++ code with the gcc compiler and am statically linking with the libmkl_solver_lp64.a library. The compilation and linking steps produce no errors or warnings.
Any clues why this does not work?
Also, is B expected in row-major or column-major order?
For example, if b(i) = i; Then the matrix B should be:
1 2 3
4 5 6
7 8 9 = row-major
or
1 4 7
2 5 8
3 6 9 = col-major
Thanks,
-Michael-
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I may have missed this somewhere in the documentation, but apparently even the C version of Pardiso expects 1 based indexing.
The code above provides correct results when you increment every element of the colidx and rowptr arrays (corresponding to ja and ia in the documentation).
The code above provides correct results when you increment every element of the colidx and rowptr arrays (corresponding to ja and ia in the documentation).

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