Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- PARDISO optimization?

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

Jared_W_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-09-2014
07:03 AM

99 Views

PARDISO optimization?

Here goes,

Relevant information (I hope):

- Using Pardiso to solve linear set of equations
**Ax = b** - matrix
**A**can be extremely large & sparse, nonsymmetric, and is also put into csr format using mkl routine

Below is the section of code where I call Pardiso, it works great everything is fine. I was really hoping someone could look at my set up and let me know if there is something I can do to make it even faster, or if it is as fast as it's going to get.

I also use **mkl_set_num_threads(n)** above the code to make use of multiple cores according to the desired **n**.

**CODE**

// Call pardiso solver

MKL_INT pt[64], iparm[64];

for(i = 0; i < 64; i++) {

pt* = 0;
iparm = 0;
}
MKL_INT *perm;
perm = (MKL_INT*)mkl_malloc(m*sizeof(MKL_INT),16);
if (perm == NULL)
{
cout << ">>> error allocating perm" << endl;
return (0);
} *

MKL_INT maxfct, mnum, mtype, phase, nrhs, msglvl, error;

maxfct = 1;

mnum = 1;

mtype = 11;

nrhs = 1;

msglvl = 1;

iparm[0] = 1;

iparm[1] = 3;

iparm[26] = 1;

iparm[34] = 1;

iparm[60] = 0;

error = 0;

// Pardiso Direct Solver

phase = 13;

pardiso (pt, &maxfct, &mnum, &mtype, &phase, &n, acsr, ia, ja, perm, &nrhs, iparm, &msglvl, b, solution, &error);

if (error != 0) {

cout << "ERROR during symbolic factorization: " << error << endl;

}

Again all I am really seeking is whether or not my call could be any better, or if this is optimal. Let me know if there is any additional information needed, and I will be checking my email frequently today to respond quickly.

Sincerely, Jared

Link Copied

9 Replies

Alexander_K_Intel2

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-09-2014
09:35 AM

99 Views

Hi Jared,

What kind of optimal you need to have? If you want to achieve better performance it is recommended to switch off matrix checker (iparm[26])

Thanks,

Alex

Jared_W_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-09-2014
10:29 AM

99 Views

Alex,

Thanks for the quick response. I just want to make sure it solves the matrix A the fastest possible. I probably should have mentioned one thing I thought was interesting was it seems that the specification of **mkl_set_num_threads(n)** isn't affecting how quickly pardiso solves. Does this seem reasonable based on the set up I described?

Alexander_K_Intel2

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-09-2014
10:37 AM

99 Views

Hi,

Could you provide information of value of n and provide output of pardiso if you set msglvl to 1?

Thanks,

Alex

Jared_W_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-09-2014
11:08 AM

99 Views

Alexander_K_Intel2

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-09-2014
11:48 AM

99 Views

HI,

First of all your number of threads changes - number of

< Parallel Direct Factorization with #processors: >

is different.

Secondary - as i see factorization time decrease when number of threads increased that expected. In any case you matrix is quite small that's why not all part of PARDISO decrease significantly after using additional threads. Also, what version of MKL do you use?

Thanks,

Alex

Jared_W_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-09-2014
12:30 PM

99 Views

Alexander_K_Intel2

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-10-2014
02:17 AM

99 Views

You are correct. But i have a question - if you are worried about part of seconds time than you call pardiso several time - am I correct? May I ask you about model of using PARDISO in your code to help you modify model of using that could help in reducing overall time.

Thanks,

Alex

Jared_W_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-10-2014
03:53 AM

99 Views

Alex,

You're right, I am calling it several times. It is the solver in my finite element code for viscous, incompressible fluid flow. At my current largest mesh (30k degrees of freedom), it is actually solving quite fast at approximately 0.8 s, but this entire process iterates over and over until convergence. I have been looking at other parts of my code and it seems other spots are adding up to the majority of the time. One in particular though is the **ddnscsr** routine. It is taking approximately **2 seconds** to **convert sparse format to csr**, does this seem right to you?

Alexander_K_Intel2

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-10-2014
07:33 PM

99 Views

HI,

I can't recommend using converters on each step in such algorithm. It can significantly improve performance if you will calculate elements of matrix in csr format, but not in dense and convert it. Actually, your matrix structure didn't change, is it true?

Thanks,

Alex

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

For more complete information about compiler optimizations, see our Optimization Notice.