- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code containing the following returns from pardiso with -1 in the error, saying 'something is wrong'.
Obviously pardiso knows what is wrong. It is a shame it won't tell me.
Furthermore there is a major lack of working examples of calling pardiso from C++ on Windows, so I can't even try another example to find out whether it is a source code problem, a link time problem, or a runtime problem.
This is a truely frustrating piece of software to use. Maybe that explains why all the major companies seem to be using another vendor's version - I would to if I could get a license for it https://pardiso-project.org/
/Bevin
bool SolveforX__AX_equal_B__usingMKL(
SparseMatrixForMKL_FormatCSR & A,
DenseMatrixForMKLParadiso & X,
DenseMatrixForMKLParadiso & B)
{
CHECK(A.nRows == A.nCols); // A has to be symmetric
CHECK(A.nCols == X.nRows); // Since A X = B
CHECK(A.nRows == B.nRows);
CHECK(X.nCols == B.nCols);
static size_t calls = 0;
if (!calls++) for (size_t n = 0; n < 64; n++) pt[n] = nullptr;
}
static const MKL_INT maxfct = 1;
static const MKL_INT mnum = 1;
const MKL_INT mtype = 2;
const MKL_INT *n;
const float *a;
const MKL_INT *ia;
const MKL_INT *ja;
A.cook(n, a, ia, ja);
CHECK(*n == A.nCols);
CHECK(*n == A.nRows);
std::vector<MKL_INT> perm(*n);
std::fill(perm.begin(), perm.end(), 0);
const MKL_INT nrhs = B.nCols;
MKL_INT iparm[64];
{
for (size_t n = 0; n < 64; n++) iparm[n] = 0;
iparm[0] = 1; // we are filling in all the parameters
iparm[1] = 2; // Sequential nested dissection algorithm
iparm[7] = 2; // Maximum number of iterative refinement steps that the solver performs
iparm[9] = 13; // The default value for nonsymmetric matrices
iparm[10] = 1; // Enable scaling. Default for nonsymmetric matrices.
iparm[12] = 1; // Enable matching. Default for nonsymmetric matrices
iparm[17] = -1; // Enable reporting. The default value is -1.
iparm[26] = 1; // Enabble checking the input matrices
iparm[27] = 1; // single precision inputs and internal temporaries
iparm[34] = 1; // 1 means Row and col numbers start at 0, not 1
iparm[36] = 0; // Use CSR format for matrix storage.
}
MKL_INT msglvl = 1; // pardiso generates output, pardiso seems to modify this!
MKL_INT error = 0;
auto const bData = B.data();
auto const xData = X.data();
auto doPhase = [&](const MKL_INT phase) {
pardiso(
pt,
&maxfct,
&mnum,
&mtype,
&phase,
n,
a,
ia,
ja,
perm.data(),
&nrhs,
iparm,
&msglvl,
bData,
xData,
&error);
CHECK(!error);
};
doPhase(11);
doPhase(22);
doPhase(33);
doPhase(-1);
return true;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I finally stumbled across the fact that pardiso writes errors to stdout! It would have been helpful if the manual had mentioned this fact. I work in VS environment creating tests and the stdout is not going somewhere that I usually look!
Now I can see the error messages, I can see what my issues are and I have a trivial case working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bevin,
Thanks for reaching out to us.
>> It would have been helpful if the manual had mentioned this fact. I work in VS environment creating tests and the stdout is not going somewhere that I usually look!
We regret the inconvenience caused.
We are working on your issue and will get back to you soon with an update regarding the same.
>>pardiso with -1 in the error, saying 'something is wrong'.
According to the MKL developer reference manual if the error value is -1 it indicates that the input is inconsistent.
You can refer to the below link for more details
Additionally, could you please let us know the MKL version you are using?
Regards,
Vidya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bevin,
For the examples of oneMKL Pardiso, we have many in the package at $MKLROOT/share/doc/mkl/examples/examples_core_c.zip (for oneMKL versions after 2024.0). You can find them in the sparse_directsolvers folder.
For the error message, please refer to Vidya's post.
Thanks,
Fengrui
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page