[petsc-dev] PETSC_USE_COMPLEX

Satish Balay balay at mcs.anl.gov
Thu Oct 25 19:39:14 CDT 2012


Sorry - I meant to use PETSC_HAVE_COMPLEX [not PETSC_USE_COMPLEX].

The primary change I intended is:
>>>>
diff --git a/src/sys/objects/pinit.c b/src/sys/objects/pinit.c
--- a/src/sys/objects/pinit.c
+++ b/src/sys/objects/pinit.c
@@ -711,7 +711,7 @@
 #endif
   }
 
-#if !defined(PETSC_HAVE_MPI_C_DOUBLE_COMPLEX)
+#if defined(PETSC_HAVE_COMPLEX) && !defined(PETSC_HAVE_MPI_C_DOUBLE_COMPLEX)
   ierr = MPI_Type_contiguous(2,MPI_DOUBLE,&MPIU_C_DOUBLE_COMPLEX);CHKERRQ(ierr);
   ierr = MPI_Type_commit(&MPIU_C_DOUBLE_COMPLEX);CHKERRQ(ierr);
   ierr = MPI_Type_contiguous(2,MPI_FLOAT,&MPIU_C_COMPLEX);CHKERRQ(ierr);
asterix:/home/balay/spetsc>
<<<
But I figured that flag could be used for PETSC_i part of the code anyway.
[the PETSC_i part of the logic should be equivalent after this change].

So if its ok - I'll push:

>>>>>>
asterix:/home/balay/spetsc>hg diff
diff --git a/src/sys/objects/pinit.c b/src/sys/objects/pinit.c
--- a/src/sys/objects/pinit.c
+++ b/src/sys/objects/pinit.c
@@ -702,7 +702,7 @@
      shared libraries the constructors for global variables
      are not called; at least on IRIX.
   */
-#if defined(PETSC_USE_COMPLEX)
+#if defined(PETSC_HAVE_COMPLEX)
   {
 #if defined(PETSC_CLANGUAGE_CXX)
     PetscComplex ic(0.0,1.0);
@@ -718,7 +718,7 @@
   ierr = MPI_Type_contiguous(2,MPI_FLOAT,&MPIU_C_COMPLEX);CHKERRQ(ierr);
   ierr = MPI_Type_commit(&MPIU_C_COMPLEX);CHKERRQ(ierr);
 #endif
-#endif /* PETSC_USE_COMPLEX */
+#endif /* PETSC_HAVE_COMPLEX */
 
   /*
      Create the PETSc MPI reduction operator that sums of the first
asterix:/home/balay/spetsc>
<<<<<<<<<

Satish



On Thu, 25 Oct 2012, Jed Brown wrote:

> I don't want this.
> 
> https://bitbucket.org/petsc/petsc-dev/changeset/3e5bdcc83cd970452d0648da9955f789cc574198
> 
> 
> The whole reason I added PetscComplex rather than just using PetscScalar is
> that I wanted to use complex numbers for method design (polynomial
> optimization and time integration). What was the actual problem? If
> Microsoft has broken C99, then PETSC_HAVE_C99_COMPLEX should not be defined.
> 




More information about the petsc-dev mailing list