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
- mkl_progress with parallely running calculations

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

Boris_Sunik

Beginner

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

10-01-2013
12:18 AM

358 Views

mkl_progress with parallely running calculations

I have many matrixes to solve. My intention is to do it in a multithreading application where every matrix is solved by its dedicated thread.

As I understand, the mkl library has to support the parallel calculations, because each matrix has its own handle.

My quesion is how can I differ between different threads in the mkl_progress() ?

Thanks in advance

Boris

.

Link Copied

10 Replies

Boris_Sunik

Beginner

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

10-07-2013
07:12 AM

358 Views

Hello all,

I didn't get the answer during the past week, probably my question wasn't understood, hence I try to explain it in other words.

I have several matrix, which I want to solve with PARDISO linear solver. My intent is to start the solving process simultaneously, each invocation of . PARDISO solver in its own thread, which I start in the calling application. As I understand, it has to be possible, because each matrix has its own _MKL_DSS_HANDLE_t handler.

Furhtermore, I want to use** mkl_progress(**) for interrupting the calculation of a particular matrix. In order to do it, I need to find out, with which matrix this function is just invocated. It seems that the **ithr **pointer is irrelevant in this issue. My questions are:

- It is possible to to solve many matrixes simultaneously?
- Can mkl library start further threads for a single matrix solved in such a way?
- If parallel solution of several matrix is possible, how can I differ between different invocations of the PARDISO solver?

I hope on your answer?

Boris

Ying_H_Intel

Employee

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

10-08-2013
10:55 PM

358 Views

Hi Boris,

The first question seems easy to answer.

Yes, it is possible to solve many matrixes simultaneously.

But the second question regarding mkl_progress() is a little complex as the thread schedule is not controled by developers, so it is hard to differ the invocation. But i guess, it is still doable as generally, thread should be able to provide the interface to return itself status, then we may add such status into mkl_progress().

How do you thread your application? could you provide a exact implementation, then we may try to add such information to mkl_progress()?

Best Regards,

Ying

P.S Here is one discussion on call dss in pthread for your reference

Boris_Sunik

Beginner

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

10-09-2013
11:55 PM

358 Views

I start the normal window thread with** AfxBeginThread()**.** **Currently I start calculation threads from a non-main thread , but I can change the starting thread to the main thread wenn necessary. All calls of mkl routines occur in the same calculation thread.

I see that if **ithr **pointer in mkl_progress is null this routine is called from the same thread. What have I to do when **lhtr** pointer gets non-zero value?

Ying_H_Intel

Employee

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

10-10-2013
01:37 AM

358 Views

Hi Boris,

Could you please attach one test case so we can investigate it specifically?

Best Regards,

Ying

Boris_Sunik

Beginner

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

10-10-2013
03:32 AM

358 Views

Konstantin_A_Intel

Employee

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

10-11-2013
02:49 AM

358 Views

Hi Boris,

Let me answer your questions in some more details:

1) As Ying mentioned, it's Ok to solve a few matrices simultaneously by MKL PARDISO/DSS. You only need own data structures for PARDISO in each thread.

2) Indeed, this question is tricky. You call MKL from different Windows threads. So, you may force MKL to not generate more threads if:

- link with sequential version of MKL library.

- set MKL_NUM_THREADS or OMP_NUM_THREADS variables to 1.

Otherwise, MKL will create as much threads as possible per your own thread (the number of threads will be equal to the number of physical cores or equal to the values of variables specified above).

3) Unfortunately, there's no way to distinguish from which Windows thread MKL PARDISO is called. It will always return ithr equal to 0 (it's so because MKL does not understand from which Windows thread you called it. It only knows the number of OpenMP threads inside MKL. And MKL PARDISO always reports progress from OpenMP thread number 0 ).

Best regards,

Konstantin

Boris_Sunik

Beginner

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

10-11-2013
02:58 AM

358 Views

**MKL PARDISO always report progress from OpenMP thread number 0**. If this is the same thread from which I call mkl then I can get it in **mkl_progress()** with **GetCurrentThread()**? Am I right?

If above assumpiton is wrong then two further questions:

- Do you plan to extend mkl_progress in future releases?
- If not, can I call certain threads with MKL_NUM_THREADS==1 and other thread(s) with other values of this variable?

Zhang_Z_Intel

Employee

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

11-05-2013
11:25 AM

358 Views

We will extend mkl_progress if there are reasonable customer requirements and if we believe it can bring value to our customers.Please be specific about what kind of extension you have in mind.

It is possible to set different values of MKL_NUM_THREADS for different user threads, by using the function "mkl_set_num_threads_local". See the documentation of it here: http://software.intel.com/en-us/node/471138

Boris_Sunik

Beginner

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

11-07-2013
01:03 AM

358 Views

I start calculation by producing a thread with the handler-function "caclulate()". This function consequently invokes

dss_create(), dss_define_structure() etc.

the next matrix will start yet further thread.

My idea ist that if have a set of calculate()'s thread handlers I can identifiy the thread in mkl_progress() by calling GetCurrentThread() and finding its hundler in my set.

Am I right?

Zhang_Z_Intel

Employee

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

11-07-2013
03:10 PM

358 Views

My idea ist that if have a set of calculate()'s thread handlers I can identifiy the thread in mkl_progress() by calling GetCurrentThread() and finding its hundler in my set.

Am I right?

You can give it a try. It may work.

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.