Commits

Jed Brown committed 4370ddd Merge

Merge branch 'jed/fix-mpi-datatype-float128'

* jed/fix-mpi-datatype-float128:
Sys: fix MPI to PETSc data type translation for __float128

  • Participants
  • Parent commits e3d2466, d5cd395

Comments (0)

Files changed (1)

src/sys/objects/ptype.c

 #if defined(PETSC_USE_COMPLEX)
 #if defined(PETSC_USE_REAL_SINGLE)
   else if (ptype == PETSC_COMPLEX)     *mtype = MPIU_C_COMPLEX;
+#elif defined(PETSC_USE_REAL___FLOAT128)
+  else if (ptype == PETSC_COMPLEX)     *mtype = MPIU___COMPLEX128;
 #else
   else if (ptype == PETSC_COMPLEX)     *mtype = MPIU_C_DOUBLE_COMPLEX;
 #endif
   else if (ptype == PETSC_FLOAT)       *mtype = MPI_FLOAT;
   else if (ptype == PETSC_CHAR)        *mtype = MPI_CHAR;
   else if (ptype == PETSC_BIT_LOGICAL) *mtype = MPI_BYTE;
-  else if (ptype == PETSC___FLOAT128)  *mtype = MPI_LONG_DOUBLE;
+#if defined(PETSC_USE_REAL___FLOAT128)
+  else if (ptype == PETSC___FLOAT128)  *mtype = MPIU___FLOAT128;
+#endif
   else SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Unknown PETSc datatype");
   PetscFunctionReturn(0);
 }
 #if defined(PETSC_USE_COMPLEX)
 #if defined(PETSC_USE_REAL_SINGLE)
   else if (mtype == MPIU_C_COMPLEX)  *ptype = PETSC_COMPLEX;
+#elif defined(PETSC_USE_REAL___FLOAT128)
+  else if (mtype == MPIU___COMPLEX128) *ptype = PETSC_COMPLEX;
 #else
   else if (mtype == MPIU_C_DOUBLE_COMPLEX) *ptype = PETSC_COMPLEX;
 #endif
   else if (mtype == MPI_SHORT)       *ptype = PETSC_SHORT;
   else if (mtype == MPI_FLOAT)       *ptype = PETSC_FLOAT;
   else if (mtype == MPI_CHAR)        *ptype = PETSC_CHAR;
-  else if (mtype == MPI_LONG_DOUBLE) *ptype = PETSC___FLOAT128;
+#if defined(PETSC_USE_REAL___FLOAT128)
+  else if (mtype == MPIU___FLOAT128) *ptype = PETSC___FLOAT128;
+#endif
   else SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"Unhandled MPI datatype");
   PetscFunctionReturn(0);
 }