<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> Roland,<div class=""><br class=""></div><div class=""> If you store your matrix as described in a parallel PETSc dense matrix then you should be able to call </div><div class=""><br class=""></div><div class="">fftw_plan_many_dft() directly on the value obtained with MatDenseGetArray(). You just need to pass the arguments regarding column major ordering appropriately. Probably identically to what you do with your previous code.</div><div class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 4, 2020, at 6:47 AM, Roland Richter <<a href="mailto:roland.richter@ntnu.no" class="">roland.richter@ntnu.no</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
<div class=""><p class="">Ideally those FFTs could be handled in parallel, after they are
not depending on each other. Is that possible with MatFFT, or
should I rather use FFTW for that?</p><p class="">Thanks,</p><p class="">Roland<br class="">
</p>
<div class="moz-cite-prefix">Am 04.12.20 um 13:19 schrieb Matthew
Knepley:<br class="">
</div>
<blockquote type="cite" cite="mid:CAMYG4GkcMcZcU_vM7kMK8_jDPNA_+dFEdqdz2=TQW68Lw9bUPQ@mail.gmail.com" class="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
<div dir="ltr" class="">
<div dir="ltr" class="">On Fri, Dec 4, 2020 at 5:32 AM Roland Richter
<<a href="mailto:roland.richter@ntnu.no" moz-do-not-send="true" class="">roland.richter@ntnu.no</a>> wrote:<br class="">
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">Hei,<br class="">
<br class="">
I am currently working on a problem which requires a large
amount of<br class="">
transformations of a field E(r, t) from time space to
Fourier space E(r,<br class="">
w) and back. The field is described in a 2d-matrix, with the
r-dimension<br class="">
along the columns and the t-dimension along the rows.<br class="">
<br class="">
For the transformation from time to frequency space and back
I therefore<br class="">
have to apply a 1d-FFT operation over each row of my matrix.
For my<br class="">
earlier attempts I used armadillo as matrix library and FFTW
for doing<br class="">
the transformations. Here I could use fftw_plan_many_dft to
do all FFTs<br class="">
at the same time. Unfortunately, armadillo does not support
MPI, and<br class="">
therefore I had to switch to PETSc for larger matrices.<br class="">
<br class="">
Based on the examples (such as example 143) PETSc has a way
of doing<br class="">
FFTs internally by creating an FFT object (using
MatCreateFFT).<br class="">
Unfortunately, I can not see how I could use that object to
conduct the<br class="">
operation described above without having to iterate over
each row in my<br class="">
original matrix (i.e. doing it sequential, not in parallel).<br class="">
<br class="">
Ideally I could distribute the FFTs such over my nodes that
each node<br class="">
takes several rows of the original matrix and applies the
FFT to each of<br class="">
them. As example, for a matrix with a size of 4x4 and two
nodes node 0<br class="">
would take row 0 and 1, while node 1 takes row 2 and 3, to
avoid<br class="">
unnecessary memory transfer between the nodes while
conducting the FFTs.<br class="">
Is that something PETSc can do, too?<br class="">
</blockquote>
<div class=""><br class="">
</div>
<div class="">The way I understand our setup (I did not write it), we
use plan_many_dft to handle</div>
<div class="">multiple dof FFTs, but these would be interlaced. You
want many FFTs for non-interlaced</div>
<div class="">storage, which is not something we do right now. You
could definitely call FFTW directly</div>
<div class="">if you want.</div>
<div class=""><br class="">
</div>
<div class="">Second, above it seems like you just want serial FFTs.
You can definitely create a MatFFT</div>
<div class="">with PETSC_COMM_SELF, and apply it to each row in the
local rows, or create the plan</div>
<div class="">yourself for the stack of rows.</div>
<div class=""><br class="">
</div>
<div class=""> Thanks,</div>
<div class=""><br class="">
</div>
<div class=""> Matt</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
Thanks!<br class="">
<br class="">
Regards,<br class="">
<br class="">
Roland<br class="">
<br class="">
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before
they begin their experiments is infinitely more
interesting than any results to which their
experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" moz-do-not-send="true" class="">https://www.cse.buffalo.edu/~knepley/</a><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div></blockquote></div><br class=""></div></body></html>