[petsc-users] Using PFFT within PETSc
Giuseppe Pitton
gpitton at sissa.it
Mon Nov 23 09:51:11 CST 2015
Dear Matt,
I cannot rewrite this example using the MatCreateFFT calls because it is
not clear to me which is the shape and the ordering of the vectors
produced by MatScatterPetscToFFTW. Furthermore, if I understand
correctly this function returns the c2r / r2c Fourier transforms, and
not the c2c transforms (unless PETSc is configured for complex data).
However, I have rewritten the example using FFTW instead of PFFT
(attached), and it runs fine both in serial and in parallel (with a cpu
count that should be a power of two). However, I prefer using PFFT over
FFTW, so if somebody has comments on this library, it would be great to
know.
Thank you,
Giuseppe
On 11/23/2015 03:09 PM, Matthew Knepley wrote:
> On Mon, Nov 23, 2015 at 1:31 AM, Giuseppe Pitton <gpitton at sissa.it
> <mailto:gpitton at sissa.it>> wrote:
>
> Dear users and developers,
> I am trying to interface PETSc with the parallel fast Fourier
> transform library PFFT
> (https://www-user.tu-chemnitz.de/~potts/workgroup/pippig/software.php.en
> <https://www-user.tu-chemnitz.de/%7Epotts/workgroup/pippig/software.php.en>),
> based in turn on FFTW. My plan is to build a spectral
> differentiation code, and in the attached files you can see a
> simple example.
>
>
> Is it possible to write this example using the existing calls?
>
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateFFT.html
>
> That way we would have a baseline we could both run that works, and
> then we could look
> at something broken.
>
> Thanks,
>
> Matt
>
> The code works correctly in serial, but in parallel there are some
> problems regarding the output of the results, I think due to some
> differences in the way PETSc and PFFT store data, but I'm not sure
> if this is really the issue.
> In the attached code, the number of processors used should be
> specified at compile time in the variable "ncpus". As long as
> ncpus = 1, everything works fine, but if ncpus = 2 or an higher
> power of 2, the code terminates correctly but the results show
> some artifacts, as you can see from the generated hdf5 file, named
> "output-pfft.h5".
> In the makefile the variables PFFTINC, PFFTLIB, FFTWINC and
> FFTWLIB should be set correctly.
> Thank you,
> Giuseppe
>
>
>
>
> --
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151123/5573a166/attachment-0001.html>
-------------- next part --------------
PFFTINC = /pfft-1.0.8/include
FFTWINC = /fftw-3.3.4/include
PFFTLIB = /pfft-1.0.8/lib
FFTWLIB = /fftw-3.3.4/lib
CFLAGS =-std=c99 -I${PFFTINC} -I${FFTWINC} -L${PFFTLIB} -L${FFTWLIB}
CLEANFILES = output-pfft.h5 test-pfft
NP = 1
include ${PETSC_DIR}lib/petsc/conf/variables
include ${PETSC_DIR}lib/petsc/conf/rules
test-fftw: test-fftw.o chkopts
-${CLINKER} -o test-fftw test-fftw.o -lm -lfftw3 -lfftw3_mpi ${PETSC_LIB}
${RM} test-fftw.o
test-pfft: test-pfft.o chkopts
-${CLINKER} -o test-pfft test-pfft.o -lm -lpfft -lfftw3 -lfftw3_mpi ${PETSC_LIB}
${RM} test-pfft.o
include ${PETSC_DIR}lib/petsc/conf/test
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-fftw.c
Type: text/x-csrc
Size: 5423 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20151123/5573a166/attachment-0001.c>
More information about the petsc-users
mailing list