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 sparse right hand side iparm(31) = 1 (or iparm[30]=1 in C++)

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

Hailong_X_

Beginner

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

04-22-2013
05:23 PM

119 Views

Pardiso sparse right hand side iparm(31) = 1 (or iparm[30]=1 in C++)

Dear All

I am testing an example with sparse right hand side and sparse solution iparm[30 ]=1 in my C++.

What I have noticed that

the solution of (perm[0] = 0, b[0] !=0) and (perm[0], b[0]=0) are different.

But I expected that the solution should be the same since perm[0]= 0,

Furthermore the solution x[0] is 0th entry of the solution vectro.

However, from the pardiso manul of iparm(31), x[0] should be a random number, since I did't request to caculate it.

The attachment is my C++ code.

Could you tell me why this happened?

Hailong

Link Copied

7 Replies

Zhang_Z_Intel

Employee

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

04-23-2013
02:37 PM

119 Views

There is one problem in your code. On line 76, you set iparm[0] = 0. You should have set iparm[0] = 1, which guarantees you all iparm paramenters are not taking default values.

With this fixed, I don't see difference in x[2] (this is the only result you'd care about because perm[2] = 1), no matter what value given to b[0].

Other minor problems: You do not need iparm[2] and iparm[51]. These are not used by MKL PARDISO at present.

Hailong_X_

Beginner

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

04-23-2013
03:13 PM

119 Views

Hi Zhang

Thanks for your suggestions.

I have one more question. If I am running a program with 1 node 16 cores, how many cores will pardiso use?

I just need everything is serial not multi-threaded.

Hailong

Hailong_X_

Beginner

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

04-23-2013
03:28 PM

119 Views

Hi Zhang

I just tested with iparm[0]=1. Now b[0] has no effect on the solution. However, x[0] and x[1] seems to be caculated with iparm[30]=1.

From

x[0] and x[1] will be caculated only with iparm[30]=2 instead of iparm[30]=1 (which is the case in my code).

Hailong

Zhang_Z_Intel

Employee

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

04-23-2013
04:12 PM

119 Views

For this real tiny problem, it might be easier for MKL to just compute the whole x vector. It doesn't do any harm by giving you more than you asked, I believe :) You can always discard x[0] and x[1] if you do not need them.

To answer your earlier question, MKL by default automatically adjusts the number of threads at run time. For tiny/small problems, an MKL function uses only 1 thread (i.e. 1 core). For large problems, it uses more cores available on the system. If you want it to be serial, you should link with the sequential MKL (Use this tool to determine the exact link line). Or, you can call function mkl_set_num_threads() to set the number of threads to 1. You can also use env-variables like MKL_NUM_THREADS or OMP_NUM_THREADS.

Hailong_X_

Beginner

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

04-23-2013
04:33 PM

119 Views

Hi Zhang

Thanks a lot for your help.

I just tested another problem with the same matrix, but the only nonzero rhs at the 0th entry (b[0]), then x[1] and x[2] are not caculated as I hoped. With iparm[30] = 2, x[1] and x[2] are caculated. Since this functionality is crucial for my real and big application, I need to make sure it is working as I expected.

Here is another question, If my OMP_NUM_THREADS = 1, can I make sure it is serial?

Hailong

Zhang_Z_Intel

Employee

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

04-24-2013
09:01 AM

119 Views

Hailong X. wrote:

Here is another question, If my OMP_NUM_THREADS = 1, can I make sure it is serial?

Yes.

CHENG__JIM

Beginner

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

09-10-2019
02:11 AM

119 Views

Hailong X. wrote:Hi Zhang

Thanks a lot for your help.

I just tested another problem with the same matrix, but the only nonzero rhs at the 0th entry (b[0]), then x[1] and x[2] are not caculated as I hoped. With iparm[30] = 2, x[1] and x[2] are caculated. Since this functionality is crucial for my real and big application, I need to make sure it is working as I expected.

Here is another question, If my OMP_NUM_THREADS = 1, can I make sure it is serial?

Hailong

Dear Hailong, did you finally get a solution for your problem? I also met this problem. And still as you stated, the whole results were obtained since I want only part of the solution.

- 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.