[petsc-users] MatMatMult involving MPIAIJ and MATNEST

Bikash Kanungo bikash at umich.edu
Mon May 11 12:41:12 CDT 2015


Hi Patrick,

I have M^{-1} computed explicitly and stored as MATNEST. Providing
MATCOMPOSITE of M^{-1}H to SLEPc standard eigenvalue solvers seems an
option. Does it has any additional cost over explicitly building M^{-1}H
(assuming I have a way to do so) and then providing it to standard
eigenvalue solvers?

Thanks,

Bikash

On Mon, May 11, 2015 at 1:37 PM, Bikash Kanungo <bikash at umich.edu> wrote:

> Hi Patrick,
>
> I have M^{-1} computed explicitly and stored as MATNEST. Providing
> MATCOMPOSITE of M^{-1}H to SLEPc standard eigenvalue solvers seems an
> option. Does it has any additional cost of explicitly building
> On May 11, 2015 1:30 PM, "Patrick Sanan" <patrick.sanan at gmail.com> wrote:
>
>> Are you storing M^{-1} explicitly? In that case you could use
>> MATCOMPOSITE to define M^{-1}H and feed that to SLEPc's standard solver. If
>> you only have M explicitly, you could use MATSHELL to define your own
>> operator which applies M^{-1}H and use that with SLEPc's standard solver
>> (though of course SLEPc would be free to implement its generalized
>> eigensolvers this way and/or in better ways for certain problems - I am not
>> enough of an expert on that library to say more).
>>
>> On Mon, May 11, 2015 at 7:12 PM, Bikash Kanungo <bikash at umich.edu> wrote:
>>
>>> Hi Matthew,
>>>
>>> Yes SLEPc does allow me to solve a generalized eigenvalue problem. But
>>> the generalized solvers are not as robust as the standard eigenvalue
>>> solvers. That's the reason I want to use explicit MatMatMult so that I can
>>> use standard eigenvalue solvers.
>>>
>>> Thanks,
>>> Bikash
>>> On May 11, 2015 1:00 PM, "Matthew Knepley" <knepley at gmail.com> wrote:
>>>
>>>> On Mon, May 11, 2015 at 8:47 AM, Bikash Kanungo <bikash at umich.edu>
>>>> wrote:
>>>>
>>>>> Hi Patrick,
>>>>>
>>>>> Thanks for the clarification. I want it to be an efficient operation.
>>>>> The idea is to convert a generalized eigenvalue problem (H*x = lamda*M*x)
>>>>> to a standard one (M^{-1}*H*x = lambda*x). The M^{-1} is of type MATNEST
>>>>> whereas H is MPIAIJ. In my problem M^{-1} is computed once whereas H
>>>>> changes every iteration. So performing low-level matrix multiplication or
>>>>> creating H as MATNEST and assembling it from its sub-matrices at every
>>>>> iteration sounds inefficient.
>>>>>
>>>>
>>>> You can solve these types of things with SLEPc without explicit MatMat.
>>>>
>>>>    Matt
>>>>
>>>>
>>>>> Regards,
>>>>> Bikash
>>>>>
>>>>> On Mon, May 11, 2015 at 9:21 AM, Patrick Sanan <
>>>>> patrick.sanan at gmail.com> wrote:
>>>>>
>>>>>> MatMatMult with MATNEST does not seem to be supported, based only on
>>>>>> the fact that there are no functions of the form MatMatMult_*_MatNest
>>>>>> defined with the MATNEST implementation :
>>>>>> http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/nest/matnest.c.html
>>>>>>
>>>>>> Does this operation need to be efficient? (That is, are you forming
>>>>>> this matrix for debugging or experimental purposes, or with the intention
>>>>>> of using it within an efficient, scalable piece of code?). If not, it
>>>>>> should be possible to use lower-level matrix operations as defined by the
>>>>>> API to extract the appropriately-sized submatrices from A and (assuming
>>>>>> that MatMatMult is defined between MATMPIAIJ and the submatrices of your
>>>>>> Matnest), perform the matrix multiplications and additions "by hand" .
>>>>>>
>>>>>> On Mon, May 11, 2015 at 2:44 PM, Bikash Kanungo <bikash at umich.edu>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have two matrices: A of type MPIAIJ and B of type MATNEST. Is
>>>>>>> there any way to perform A*B after B has been assembled from its
>>>>>>> sub-matrices?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Bikash
>>>>>>>
>>>>>>> --
>>>>>>> Bikash S. Kanungo
>>>>>>> PhD Student
>>>>>>> Computational Materials Physics Group
>>>>>>> Mechanical Engineering
>>>>>>> University of Michigan
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Bikash S. Kanungo
>>>>> PhD Student
>>>>> Computational Materials Physics Group
>>>>> Mechanical Engineering
>>>>> University of Michigan
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> What most experimenters take for granted before they begin their
>>>> experiments is infinitely more interesting than any results to which their
>>>> experiments lead.
>>>> -- Norbert Wiener
>>>>
>>>
>>


-- 
Bikash S. Kanungo
PhD Student
Computational Materials Physics Group
Mechanical Engineering
University of Michigan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150511/738dfa53/attachment.html>


More information about the petsc-users mailing list