[petsc-dev] [petsc-users] FFT Matrix Examples/Tests: Compiletime error

Hong Zhang hzhang at mcs.anl.gov
Wed Jul 11 08:12:46 CDT 2012


Thomas:

>
>
> Thx Hong. I tried the ex148, but I doesn't work as I have complex
> petsc scalars. Instead I tried ex154, where I did the following
> modification to be able to compile it
>

ex148.c only works with real precision:
#if defined(PETSC_USE_COMPLEX)
  SETERRQ(PETSC_COMM_WORLD,PETSC_ERR_SUP, "This example requires real
numbers");
#endif

As you see, these examples were written last summer,
and have not been checked/tested with FFTW since then, therefore
messy and buggy. I'll check what you reported below
and get back to you soon.

Thanks for reporting the problems,

Hong

>
>
>  hg diff
> diff -r b800705fa966 src/mat/examples/tests/ex154.c
> --- a/src/mat/examples/tests/ex154.c    Tue Jul 10 21:23:47 2012 -0500
> +++ b/src/mat/examples/tests/ex154.c    Wed Jul 11 11:06:03 2012 +0200
> @@ -46,7 +46,7 @@
>    ierr = VecGetSize(input,&vsize);CHKERRQ(ierr);
>    printf("The vector size of output from the main routine is %d\n",vsize);
>
> -  ierr = InputTransformFFT(A,input,x);CHKERRQ(ierr);
> +  ierr = VecScatterPetscToFFTW(A,input,x);CHKERRQ(ierr);
>  //  ierr = VecAssemblyBegin(x);CHKERRQ(ierr);
>  //  ierr = VecAssemblyEnd(x);CHKERRQ(ierr);
>  //  ierr = VecView(x,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);
> @@ -54,7 +54,9 @@
>    ierr = MatMult(A,x,y);CHKERRQ(ierr);
>    ierr = MatMultTranspose(A,y,z);CHKERRQ(ierr);
>
> -  ierr = OutputTransformFFT(A,z,output);CHKERRQ(ierr);
> +  ierr = VecScatterFFTWToPetsc(A,z,output);CHKERRQ(ierr);
> +
> +  /* Check accuracy */
>    fac = 1.0/(PetscReal)N;
>    ierr = VecScale(output,fac);CHKERRQ(ierr);
>
> Running this program with a single node (mpirun -n 1 ex154) works but
> with multiple (mpirun -n 2 ex154) I get a segfault
> http://pastie.tk/view.php?id=29C95711
>
> ex143 with -use_FFTW_interface YES and-use_FFTW_interface NO  works
> for both single and multiple nodes. ex145 only for more than one node
> (as expected).
>
> Regards
> Thomas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120711/b388f7a0/attachment.html>


More information about the petsc-dev mailing list