[Trilinos-Users] Interfacing fftw and trilinos

Veltz Romain romain.veltz at inria.fr
Thu Nov 29 11:28:46 MST 2012


Holger,

Right now it is not serial, I am using the pthreads in fftw but I would like to turn into MPI.

I figured out I would have to dig in parallel-fftw.html but I was hoping somebody have already done it.

Thank you for your help,

Romain


On Nov 29, 2012, at 4:49 AM, Holger Brandsmeier wrote:

> Romain,
> 
> your fftw implementation is serial only, right? And you would like to
> use that somehow in parallel? In that case you would have to dig into
> the fft implementation a bit, here is how you could parallelize it
> 
> http://www.fftw.org/parallel/parallel-fftw.html
> 
> -Holger
> 
> On Thu, Nov 29, 2012 at 12:02 AM, Veltz Romain <romain.veltz at inria.fr> wrote:
>> Mike,
>> 
>> I can distribute the data the way I want in the Epetra_Vector, there is no constraint except speed.
>> 
>> I have X, an epetra_vector that represents a 2d data (ultimately, 512^2 components). I have a kernel W (I don't know yet if it should be an Epetra_Vector), and I would like to compute the convolution :  W *conv X.
>> I would use MPI on a multicore processor (32 cores), I do not plan to spread my computations on different computers in the immediate future.
>> 
>> On the other hand, I also have a sparse matrix W_LR and I need to compute the matrix-vector product  W_LR * X. This sparse matrix is a Epetra_CrsMatrix but I do not have a lot of constraints about it. Each rwo is filled at about 5-7%.
>> 
>> Hence, I have to compute F = W *conv X   +  W_LR * X
>> 
>> I already have programed an operator for the Jacobian operations.
>> 
>> Is it enough information?
>> 
>> My problem is if I use fftw for example, how can I assure that the data X,W are correctly sent to fftw?
>> 
>> Thank you,
>> 
>> Romain
>> 
>> 
>> 
>> 
>> On Nov 28, 2012, at 2:40 PM, Heroux, Mike wrote:
>> 
>>> Romain,
>>> 
>>> I think Epetra_Operator is might still the right interface.  Please
>>> describe the operation you want to perform and how the data are
>>> distributed across the parallel machine.
>>> 
>>> Mike
>>> 
>>> On 11/28/12 4:36 PM, "Veltz Romain" <romain.veltz at inria.fr> wrote:
>>> 
>>>> Mike,
>>>> 
>>>> I am sorry because I was not clear enough.
>>>> 
>>>> My basic goal is to apply a FFT to an Epetra_Vector in parallel.
>>>> 
>>>> Romain.
>>>> 
>>>> 
>>>> On Nov 28, 2012, at 1:57 PM, Heroux, Michael A wrote:
>>>> 
>>>>> Romain,
>>>>> 
>>>>> If I understand your situation correctly, you will want to write an
>>>>> adapter for the pure virtual class Epetra_Operator, which is used by all
>>>>> Trilinos linear solvers to apply the linear operator.  A reasonable
>>>>> starting point for such a class is in
>>>>> Trilinos/packages/AztecOO/src/AztecOO_Operator.[h|cpp].
>>>>> 
>>>>> Depending on the details of what you are doing you may need to reverse
>>>>> the
>>>>> roles of Apply() and ApplyInverse() from what AztecOO_Operator does. You
>>>>> will implement Apply() or ApplyInverse() using the FFT library and you
>>>>> will indicate that the other is not implemented.  AztecOO_Operator
>>>>> implements ApplyInverse() and specifies that Apply() is not implemented.
>>>>> In fact you should be able to use AztecOO_Operator::Apply() basically
>>>>> as-is for one of your own methods.
>>>>> 
>>>>> I hope this helps.
>>>>> 
>>>>> Mike
>>>>> 
>>>>> On 11/28/12 2:46 PM, "Veltz Romain" <romain.veltz at inria.fr> wrote:
>>>>> 
>>>>>> Hello,
>>>>>> 
>>>>>> 
>>>>>> I would like to interface a Fast Fourier Transform library with Epetra.
>>>>>> More precisely, I am using NOX and LOCA to solve integral equations
>>>>>> which
>>>>>> involve the computations of Fourier Transform (in Matrix-Free
>>>>>> formalism)
>>>>>> and sparse Matrix-Vector products at the same time.
>>>>>> 
>>>>>> There is an old fftw code for serial 1d FFT in Thyra but it does not
>>>>>> fit
>>>>>> my needs.
>>>>>> 
>>>>>> Could you give me some advice me please,
>>>>>> 
>>>>>> Thank you for your help.
>>>>>> 
>>>>>> Romain
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> Trilinos-Users mailing list
>>>>>> Trilinos-Users at software.sandia.gov
>>>>>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Trilinos-Users mailing list
>>>> Trilinos-Users at software.sandia.gov
>>>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>>> 
>>> 
>> 
>> 
>> 
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>> 
> 
> 
> 
> -- 
> Holger Brandsmeier, SAM, ETH Zürich
> http://www.sam.math.ethz.ch/people/bholger





More information about the Trilinos-Users mailing list