- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried to encapsulate PARDISO with a simple wrapper, why doesn't this kind of encapsulation work? Not only in C++, but also in C language, errors occur when using `pt` across functions. This is the minimal unit for reproducing the error. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I hardcoded your code by allocating the solution array and solution has been passed:
void NumericalAlgebra::solve(double* b, double* result)
{
MKL_INT phase=33;
double* x = (double*)mkl_malloc(N*sizeof(double), 64);
pardiso(m_pt,&m_maxfct,&m_mnum,&m_type,&phase,&N,values, rowindex,colindex,&idum,&nrhs,m_iparm,&m_msglvl, b, /*result*/ x, &m_error);
if( m_error != 0 ) {
printf("... Failure. Pardiso Fails at the Solution ( phase == 33 ) stage. m_error == %lld \n", m_error );
} else {
printf("... Passed - Pardiso at the Solution ( phase == 12) stage \n");
}
}
here is the log output:
....
number of non-zeros in U: 1
number of non-zeros in L+U: 6
gflop for the numerical factorization: 0.000000
gflop/s for the numerical factorization: 0.000027
... Passed - Pardiso at the Solution ( phase == 12) stage
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how do you allocate solution array ( which is double *result into your code)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I hardcoded your code by allocating the solution array and solution has been passed:
void NumericalAlgebra::solve(double* b, double* result)
{
MKL_INT phase=33;
double* x = (double*)mkl_malloc(N*sizeof(double), 64);
pardiso(m_pt,&m_maxfct,&m_mnum,&m_type,&phase,&N,values, rowindex,colindex,&idum,&nrhs,m_iparm,&m_msglvl, b, /*result*/ x, &m_error);
if( m_error != 0 ) {
printf("... Failure. Pardiso Fails at the Solution ( phase == 33 ) stage. m_error == %lld \n", m_error );
} else {
printf("... Passed - Pardiso at the Solution ( phase == 12) stage \n");
}
}
here is the log output:
....
number of non-zeros in U: 1
number of non-zeros in L+U: 6
gflop for the numerical factorization: 0.000000
gflop/s for the numerical factorization: 0.000027
... Passed - Pardiso at the Solution ( phase == 12) stage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much. I made a very stupid mistake. I thought pardiso could allocate memory automatically. Thank you!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page