[petsc-users] [petsc-maint #101696] complex + float128

Jed Brown jedbrown at mcs.anl.gov
Sun Jan 15 16:18:33 CST 2012


On Sun, Jan 15, 2012 at 16:06, Xavier Garnaud <
xavier.garnaud at ladhyx.polytechnique.fr> wrote:

> Here is the error message I got.
>
> Building C object CMakeFiles/petsc.dir/src/sys/draw/interface/dsflush.c.o
> /home/garnaud/local/petsc/petsc-3.2-p5/src/sys/draw/interface/dsetpause.c:
> In function  PetscDrawSetPause:
>
> /home/garnaud/local/petsc/petsc-3.2-p5/src/sys/draw/interface/dsetpause.c:33:3:
> error: MPIU___FLOAT128 undeclared (first use in this function)
>
> /home/garnaud/local/petsc/petsc-3.2-p5/src/sys/draw/interface/dsetpause.c:33:3:
> note: each undeclared identifier is reported only once for each function it
> appears in
>

You will need something like the following, and also some code at about
src/sys/objects/pinit.c:750 to create MPIU_C___FLOAT128_COMPLEX. Let us
know if you work it out, otherwise I'll take a look at it later.

--- a/include/petscmath.h
+++ b/include/petscmath.h
@@ -112,6 +112,9 @@
 #define MPIU_SCALAR MPIU_C_COMPLEX
 #elif defined(PETSC_USE_REAL_DOUBLE)
 #define MPIU_SCALAR MPIU_C_DOUBLE_COMPLEX
+#elif defined(PETSC_USE_REAL___FLOAT128)
+#define MPIU_SCALAR MPIU_C___FLOAT128_COMPLEX
+extern MPI_Datatype MPIU_C___FLOAT128_COMPLEX
 #endif /* PETSC_USE_REAL_* */

 /*



>
> Thank you
>
> On Sun, Jan 15, 2012 at 5:43 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>
> > On Sun, Jan 15, 2012 at 05:54, Xavier Garnaud <
> > xavier.garnaud at ladhyx.polytechnique.fr> wrote:
> >
> >> Thank you for your help.
> >>
> >> quadmath.h contains quad complex functions. I naively added the
> functions
> >> for quad complex. The beginning of the compilation works, but then it
> fails
> >> with an MPI related error. I will contact you again when i manage to
> make
> >> it work,
> >>
> >
> > What was the MPI error?
> >
> > It's likely that we are missing data types and MPI_Ops for quad complex.
> >
> >
> >>
> >> Sincerely,
> >>
> >> Xavier
> >>
> >>
> >>
> >> On Mon, Jan 9, 2012 at 8:01 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> >>
> >>>
> >>>   We've never tried to do this.
> >>>
> >>>    First you need to check if quadmath.h has quad complex stuff in it?
> >>> If it does you need to add into petscmath.h the quad complex bindings
> for
> >>> all the various math operations like PetscScalar and PetscSqrtScalar()
> etc
> >>>
> >>>   Barry
> >>>
> >>>
> >>> On Jan 9, 2012, at 12:05 PM, Xavier Garnaud wrote:
> >>>
> >>> > I am trying to build PETSc with complex number and quadruple
> >>> precision, but
> >>> > I get an error at the compiling stage. I do not get this error when I
> >>> do
> >>> > the same using real numbers. Are complex numbers incompatible with
> >>> > quadruple precision?
> >>> > Thank you very much,
> >>> > Sincerely,
> >>> >
> >>> > Xavier
> >>> >
> >>> > <configure.log><make.log>
> >>>
> >>>
> >>
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120115/b8be9291/attachment.htm>


More information about the petsc-users mailing list