How to use Plasma

Open forum for general discussions relating to PLASMA.

How to use Plasma

Postby maria » Wed Oct 07, 2009 11:34 am

Hi there,

Oour company has used LAPACK in our Fortrain application. I don't know much about LAPACK and the person who implemented LAPACK source files
into our fortran code is not here anymore. Recently, I started to check if we can improve our application computational speed. Then I found out PLASMA, which I think may increase our application performace. We want to implement PLASMA in our source code.
I have some very basic questions:
(1) our current source code contains the following CGETF2,CGETRF,CGETRS,XERBLA,CGERU,CTRSM, CSCAL, and CSWAP from LAPACK.
According to what I read, I need optimized BLAS to achive the performance, eg Intel MKL. However, intel MKL does not have highly optimized source codes available for CSCAL, CSWAP, CGERU, and CTRSM. Do you know where I can find source codes for optimized BLAS?
(2) I also download source codes from plasma 2.0.0. There are several folders insde.Where are LAPACK's equivalent source codes of CGETF2, CGETRF and CGETRS?


Many thanks, Maria
maria
 
Posts: 6
Joined: Wed Oct 07, 2009 9:31 am

Re: How to use Plasma

Postby admin » Wed Oct 07, 2009 12:27 pm

Maria,
I sounds like your goal is to incorporate PLASMA source code into your (your company's) code.
It is not as easy an exercise as it is with LAPACK.
PLASMA is parallel code that launches and manages its own threads.
You cannot really take a single routine, such as plasma_pzgetrf, and plug it into your code, like you would do with LAPACK :(

:idea: I suggest using PLASMA "out of the box" - building PLASMA on your system, linking your application with PLASMA (and optimized BLAS, e.g. MKL) and calling PLASMA's user-level routine, such as PLASMA_cgesv, to solve a system of linear equations (which is what your code seems to be doing).
You can also first factorize the matrix using PLASMA_cgetrf and then solve the system using PLASMA_cgetrs or a sequence of two calls to PLASMA_ctrsm 8-)

Your code operates on complex numbers in single precision (function names starting with "C").
PLASMA, provides such routines, e.g. PLASMA_cgesv, but they are not included in the tarball :shock:
Instead, they are created at compile time automatically from "reference" routines in complex double precision (prefix Z).
The single precision, "C" routines, will show up in the source code after installation 8-)

I hope it helps.
Please don't hesitate to post more questions.
Jakub :ugeek:
admin
Site Admin
 
Posts: 79
Joined: Wed May 13, 2009 1:27 pm

Re: How to use Plasma

Postby maria » Thu Oct 08, 2009 8:42 am

Thanks for your suggestions.

This is my understanding. Correct me if I am wrong. You mean that I can not really insert the PLASMA source code into my application as we did for LAPACK.
What I can do is to build my application, and link it with PLASMA.lib libary which is already built in your plasma/ lib/ folder from download. In addition, I need to link my appication with MKL library since I use Intel IVF compiler. But when I run my application, do I need plasma.dll file also? Anything else I missed in terms of compling and running my application using PLASMA? We will distrubute our appplications to our users. Will they be able to use it under different Operating system? One more question, MKL alo claims that they have multithreaded LAPACK. What's the difference of PLASMA and MKL LAPACK in terms of performance?

Maria
maria
 
Posts: 6
Joined: Wed Oct 07, 2009 9:31 am

Re: How to use Plasma

Postby admin » Thu Oct 08, 2009 10:58 am

I am sorry, I guess my response was not very clear.
You are more than welcome to take any portion of PLASMA's source code, plug it into your code and distribute it to your company's customers.
Since you compile PLASMA from source code, you should be able to make it work for different operating systems.
Explicit support for MS Windows will be included in the upcoming release at the time of the Supercomputing 2009 conference in November.
Jakub
admin
Site Admin
 
Posts: 79
Joined: Wed May 13, 2009 1:27 pm

Re: How to use Plasma

Postby maria » Wed Mar 17, 2010 9:51 pm

Hi, Thanks for your reply. It has been a while since my first question. I just came back to work on this problem again.
I was confused a little by your reply. First you say that I can not just plug in PLASMA into our code like what we did for LAPACK.
Then you said that I can take 'any portion of PLASMA's source code, plug it into your code and distribute it to your company's customers'.
Can I do either way? Any performace difference between these two?
The reason we perfer plug in is to make it work for different operating systems just like you said.

Our current code in Fortran has three plug-in LAPACK routines: CGETF2, CGETRF, and CGETRS & all auxiliary routines associated with these subroutines.
From core_lapack folder downloaded from your site, I can find CGETF2 subroutine, and two auxiliary routines CLASWP and XERBLA. I am wondering if I can replace CGETR2 with the new CGETR2. What should I do with external subroutines called inside CGETF2, like CGERU, CSCAL, CSWAP? I can not find these subroutines in the folder.

Many Thanks, Maria
maria
 
Posts: 6
Joined: Wed Oct 07, 2009 9:31 am

Re: How to use Plasma

Postby admin » Thu Mar 18, 2010 10:15 am

We just changed the way PLASMA interacts with LAPACK.
There are no LAPACK routines in PLASMA any more.
Instead PLASMA needs to be linked with LAPACK.
If you already have LAPACK, you can provide the path at installation time.
If you don't have LAPACK, PLASMA's installer will download it and build it for you.
The new version has not been released yet. Be on a lookout for a new release.
Jakub
admin
Site Admin
 
Posts: 79
Joined: Wed May 13, 2009 1:27 pm

Re: How to use Plasma

Postby maria » Thu Mar 18, 2010 8:38 pm

Great! What's the time frame of new release? In a couple of months or longer?

One more question, the other parts of our code is hard to parallelize. If we leave the rest of the code to be serial, it will not change the performace of
PLASMA, right? I mean replacing LAPACK with PLASMA will speed up this part of computation. Thanks.
maria
 
Posts: 6
Joined: Wed Oct 07, 2009 9:31 am

Re: How to use Plasma

Postby admin » Fri Mar 19, 2010 1:46 pm

Three months is a likely timeframe.
Jakub
admin
Site Admin
 
Posts: 79
Joined: Wed May 13, 2009 1:27 pm

Re: How to use Plasma

Postby admin » Fri Mar 19, 2010 2:40 pm

Replacing LAPACK with PLASMA will speed up the corresponding part of the computation.
It will not affect the performance of the other parts.
Other parts may become performance bottlenecks (Amdahl's law).
Jakub
admin
Site Admin
 
Posts: 79
Joined: Wed May 13, 2009 1:27 pm

Re: How to use Plasma

Postby maria » Wed Mar 24, 2010 9:05 am

Thanks.

Our software work like this: we just insert LAPACK routines in our own code. We use three subroutines of Lapack, CGETR2, CGETRF and CGETRS, and the associated auxiliary routines in these subroutines. To some users, we distribute the complete source code to users, and they will compile themselves without knowing anything about LAPACK. To them, LAPACK routines are just parts of subroutines. To most other users, we distribute executible file to them. The users just prepare input and get output from program.

I am not quite understand what you said that 'Instead PLASMA needs to be linked with LAPACK.
If you already have LAPACK, you can provide the path at installation time.
If you don't have LAPACK, PLASMA's installer will download it and build it for you'. You mean that I don't need to change our current code and will just need to provide the path? What of for our case, LAPACK already becomes parts of our subroutines?

Another question: does the next version of PLASMA has the three subroutines we need, CGETR2,CGETRF and CGETRS?

Thank you so much for your time.
maria
 
Posts: 6
Joined: Wed Oct 07, 2009 9:31 am

Next

Return to User discussion

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron