Better to do an update of all the code to use PetscScalar (just replace double with PetscScalar in some editor or sed script), trying to translate back and forth in the code will be a debugging nightmare.
Barry > On Jun 28, 2017, at 9:02 PM, Matthew Knepley <knep...@gmail.com> wrote: > > On Wed, Jun 28, 2017 at 9:00 PM, Hao Zhang <hbcbh1...@gmail.com> wrote: > thanks, @Matthew > > I was worried about this. is there a way to convert double to PetscScalar? > > C cast. > > incompressible code are double type everywhere else except for PETSc. could > this be the problem? > > I doubt using high precision only in the solve will make much difference, > certainly not 10^{-14}. > > Matt > > it was double type for the entire code including PETSc before this quadruple > test. > > > > > > > > > On Wed, Jun 28, 2017 at 9:27 PM, Matthew Knepley <knep...@gmail.com> wrote: > On Wed, Jun 28, 2017 at 8:22 PM, Hao Zhang <hbcbh1...@gmail.com> wrote: > It's 3d incompressible RT simulation. My pressure between serial and parallel > calculation is off by 10^(-14) in relative error. > > This could just be reordering of the calculation. > > it eventually build up at later time. I want to rule out the possibilities > that PETSc give me bad solution. pressure scale is 10^(-2). > > I use PetscScalar. thanks @Jed Brown for confirming that but I have > Segmentation Violation when retrieving x. I allocated memory for the array x > (PetscScalar type). if not for quadruple precision, there is no error. > > It sounds like maybe you are passing a double where a PetscScalar is > expected, or vice versa. Run under valgrind. > > Matt > > thanks @Satish Balay. I will update code petsc-3.7 later. > > > > -- > 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 > > http://www.caam.rice.edu/~mk51/ > > > > -- > hao > > > > -- > 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 > > http://www.caam.rice.edu/~mk51/